// Flash Functions
function getFlashMovieObject(movieName) {
  if (window.document[movieName]) {
      return window.document[movieName];
  }
  if (navigator.appName.indexOf("Microsoft Internet")==-1) {
    if (document.embeds && document.embeds[movieName])
      return document.embeds[movieName]; 
  } else {
    return document.getElementById(movieName);
  }  
}

function gotoFlashFrame(movieName, frame) {
	var flashMovie = getFlashMovieObject(movieName);
	flashMovie.GotoFrame(frame - 1);
}	

function toggleDefaultValue(control, defaultValue, text, getFocus) { 
	if (control.value == defaultValue) {
		if (getFocus) {
			control.value = text;
			control.select();			
		} else {
			control.value = text;
		}
	}
}	

function openWindow(theURL,winName,features) {

	newWindow = window.open(theURL, winName, features);
	newWindow.focus();
	//return newWindow;
}

function setAllCheckboxes(e) {

	for (i = 0; i < e.form.elements.length; i++) {
		o = e.form.elements[i];
		if (o.type == "checkbox") {
			o.checked = e.checked;
		}
	}
}
function formatCurrency(s, symbol) {
	if (symbol == null) {
		symbol = "";
	}
	s = formatNumber(s);
	if (s.length > 0) {
		s = symbol + s;
		if ((i = s.indexOf(".")) != -1) {
			l = s.length;
			if (l - i == 2) {
				s += "0";
			}
			if (l - i == 1) {
				s += "00";
			}
		} else {
			s += ".00";
		}
	}
	return s;
}

function preventDoubleSubmit(control) {
	control.form.onsubmit = function() {
		control.disabled = true;
		control.value = 'Please wait...';
	}
	return true;
}

function formatNumber(s) {
	sign = s.charAt(0);
	
	s = numbersOnly(s);
	
	var t = s;
	s = "";
	dotIndex = t.indexOf(".");
	if (dotIndex > -1) {
		s = t.substring(dotIndex, t.length);
	} else {
		dotIndex = t.length;
	}
	//dotIndex  = 0;
	for(i=1; i <= dotIndex; i++) {
		s = t.charAt(dotIndex-i) + s;
		if ((i%3 == 0) && (i != dotIndex)) {
			s = "," + s;
		}
	}
	if (sign == "-") {
		return "-" + s;
	} else {
		return s;
	}	
}
function formatInteger(s) {
	s = numbersOnly(s);
	dotIndex = s.indexOf(".");
	if (dotIndex > -1) {
		return formatNumber(s.substring(0, dotIndex));
	} else {
		return formatNumber(s);
	}
}
function numbersOnly(s) {
	s = s.replace(/[.][.]+/,".");
	s = s.replace(/[^0-9.]/g,"");
	//s = s.replace(/^(.*?\..*?)\..*/g,"$1");

	if (s != "0") {
		s = s.replace(/^0+/,"");
	}

	return s;
}
function formatTelephoneNumber(s) {
	return s.replace(/[^0-9()-+\s]+/,"");
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
	window.open(theURL,winName,features);
}
function setLayerFromInput(objName,textObj) {
	obj = MM_findObj(textObj);
	MM_setTextOfLayer(objName,0,obj.value);
	obj = MM_findObj(objName);
	if (obj.className == "visible_layer") {
		obj.className = "hidden_layer";
	} else {
		obj.className = "visible_layer"
	}
}
function setAndSubmit(formId, id, value) {
	form = MM_findObj(formId);
	setValue(id, value);
	form.submit();
}

function setValue(id, value) {
	obj = MM_findObj(id);
	obj.value = value;
}

function setDateMonthYear(date, month, year) {
	date = MM_findObj(date);
	month = MM_findObj(month);
	year = MM_findObj(year);

	date.value = year.value + "-" + pad(month.value, 2) + "-01";
}
function MM_setTextOfLayer(objName,x,newText) { //v4.01
	if ((obj=MM_findObj(objName))!=null) with (obj)
		if (document.layers) {document.write(unescape(newText)); document.close();}
		else innerHTML = unescape(newText);
}

function MM_preloadImages() { //v3.0
	var d=document; if (d.images) { if (!d.MM_p) d.MM_p=new Array();
		var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
		if (a[i].indexOf("#")!=0) { d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
	var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
	var p,i,x;  if (!d) d=document; if ((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	if (!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	if (!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
	var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	if ((x=MM_findObj(a[i]))!=null) {document.MM_sr[j++]=x; if (!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
	if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
		document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
	else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function BW_centerLayers() { //v4.1.1
	if (document.layers || document.all || document.getElementById) {
		var winWidth, winHeight, i, horz, vert, width, height, offsetX, offsetY, negX, negY, group, x, y, args;
		args = BW_centerLayers.arguments;

		onresize = BW_reload;


		winWidth = (document.all)?document.body.clientWidth:window.innerWidth;
		winHeight = (document.all)?document.body.clientHeight:window.innerHeight;

		for (i=0; i<(args.length-9); i+=10) {
			horz    = args[i+1];
			vert    = args[i+2];
			width   = parseInt(args[i+3]);
			height  = parseInt(args[i+4]);
			offsetX = parseInt(args[i+5]);
			offsetY = parseInt(args[i+6]);
			negX    = args[i+7];
			negY    = args[i+8];

			x = ((winWidth - width)/2) + offsetX;
			y = ((winHeight - height)/2) + offsetY;

			x = (negX=='false' && (x < 0))?0:x;
			y = (negY=='false' && (y < 0))?0:y;

			layerObj = (document.getElementById)?document.getElementById(args[i]):MM_findObj(args[i]);

			if (layerObj!=null) {
				layerObj = (layerObj.style)?layerObj.style:layerObj;
				layerObj.left = (horz=="true")?x:layerObj.left;
				layerObj.top = (vert=="true")?y:layerObj.top;
			}
		}
	}
}

function MM_showHideLayers() { //v3.0
	var i,p,v,obj,args=MM_showHideLayers.arguments;
	for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
		if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
		obj.visibility=v; }
}

function toggleVisibility(id) {
	id = MM_findObj(id);
	if (id.className == "hidden") {
		id.className = "visible";
	} else {
		id.className = "hidden";
	}
}

function setVisibility(id, show) {
	id = MM_findObj(id);
	if (show) {
		id.className = "visible";
	} else {
		id.className = "hidden";
	}
}

function BW_reload() {location.reload();}

var ie4 = document.all;
var ns4 = document.layers;
var ns6 = document.getElementById && !document.all;

function removeListValue(value,selectedObj) {
	var tmpArray = selectedObj.value.split(",");
	var newArray = Array();
	for (i=0;i<tmpArray.length;i++) {
		if (value != tmpArray[i]) {
			newArray.push(tmpArray[i]);
		}
	}
	selectedObj.value = newArray.toString();
}

function addListValue(value,selectedObj) {
	var tmpArray = new Array();
	if (selectedObj.value != "") {
		tmpArray = selectedObj.value.split(",");
	}
	var found = false;
	for (i=0;i<tmpArray.length;i++) {
		if (value == tmpArray[i]) {
			found = true;
		}
	}
	if (!found) {
		tmpArray.push(value);
		selectedObj.value = tmpArray.toString();
	}
}

function toggleSelect(obj,id,selectedObj) {
	if (obj.selected) {
		obj.selected = false;
		obj.className="";
		removeListValue(id,selectedObj);
	}	else {
		obj.selected = true;
		obj.className="SelectedRow";
		addListValue(id,selectedObj);
	}
}

function toggleCheckBox(checkBoxObj,e) {
	var elem = (e.target) ? e.target : e.srcElement;
	if (elem.id == checkBoxObj.id) {
			return;
	}
	if (checkBoxObj.checked) {
		checkBoxObj.checked = false;
	}	else {
		checkBoxObj.checked = true;
	}
}

function toggleRow(row) {
	if (row.className == "SelectedRow") {
		row.className = row.oldClassName;
	} else {
		row.oldClassName = row.className;
		row.className = "SelectedRow";
	}
}

function toggleRowSent(row) {
	if (row.className == "SelectedRowSent") {
		row.className = row.oldClassName;
	} else {
		row.oldClassName = row.className;
		row.className = "SelectedRowSent";
	}
}
function toggleRowList(row) {
	if (row.className == "SelectedRowList") {
		row.className = row.oldClassName;
	} else {
		row.oldClassName = row.className;
		row.className = "SelectedRowList";
	}
}

function doCustomTag(objName,startTag,stopTag) {
	obj = MM_findObj(objName);
	if (obj) {
		obj.focus();
		if (ns6) {
			var selectionStart = obj.selectionStart;
			var selectionEnd = obj.selectionEnd;
			selectedText = obj.value.substring(selectionStart,selectionEnd);
			obj.value = obj.value.substring(0, selectionStart) + startTag + selectedText +stopTag + obj.value.substring(selectionEnd);
			obj.setSelectionRange(selectionStart+startTag.length,selectionStart+startTag.length+selectedText.length);
		} else if (ns4) {
			obj.value += startTag+'<Type Here>'+stopTag;
			obj.setSelectionRange(obj.value.length-stopTag.length-11,obj.value.length-stopTag.length);
		} else if (ie4) {
			if (document.selection != null) {
				tr = document.selection.createRange();
				tr.text = startTag+tr.text+stopTag;
				tr.select();
			} else {
				obj.value += startTag + stopTag;
			}
		}
		obj.focus();
	}
}
function previewText(textControl,divid) {
	s = textControl.value.replace(/\n/g,"<br />");
	MM_setTextOfLayer(divid,0,s);
}
function getSelectedText(obj) {
 if (obj) {
		if (ie4) {
			tr = document.selection.createRange();
			return tr.text;
		} else if (ns6) {
			var selectionStart = obj.selectionStart;
			var selectionEnd = obj.selectionEnd;
			return obj.value.substring(selectionStart,selectionEnd);
		}
	}
}
function overwriteWithText(obj,text) {
	if (obj) {
		if (ie4) {
			tr = document.selection.createRange();
			tr.text = text;
			tr.select();
		} else if (ns6) {
			var selectionStart = obj.selectionStart;
			var selectionEnd = obj.selectionEnd;
			selectedText = obj.value.substring(selectionStart,selectionEnd);
			obj.value = obj.value.substring(0, selectionStart) + text + obj.value.substring(selectionEnd);
			obj.setSelectionRange(selectionStart,selectionStart+text.length);
		} else if (ns4) {
			obj.value += startTag+'<Type Here>'+stopTag;
			obj.setSelectionRange(obj.value.length-stopTag.length-11,obj.value.length-stopTag.length);
		}
	}
	obj.focus();
}

function toLower(obj) {
	obj.value = obj.value.toLowerCase();
}

function toUpper(obj) {
	obj.value = obj.value.toUpperCase();
}
function formatLower(value) {
	return value.toLowerCase();
}

function formatUpper(value) {
	return value.toUpperCase();
}

function showImageFile(img,fileObj,width) {
	var src = fileObj.value.replace(/\\\\/,"@");
	src = src.replace(/\\/g,"/");
	src = src.replace(/\@/g,"///");
	img.src = "file://"+src;
	img.width = width;
}
function showImageURL(img,src,width) {
	img.src = src;
	img.width = width;
}

function checkBoxes(control, name, state) {
	form = control.form;
	count = eval("form." + name + ".length");
	code = "form." + name + "[i].checked = state";
	for (i=0;i<count;i++)
	eval(code);
}

function jumpMenu(targ,selObj,restore) { //v3.0
	eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	if (restore) selObj.selectedIndex=0;
}

function preloadImage() { //v3.0
	var d=document; if (d.images) { if (!d.p) d.p=new Array();
		var i,j=d.p.length,a=preloadImage.arguments; for(i=0; i<a.length; i++)
		if (a[i].indexOf("#")!=0) { d.p[j]=new Image; d.p[j++].src=a[i];}}
}

function maxTextLength(obj,i, showDetail) {
	result = true;
	if (obj.value.length > i) {
		obj.value=obj.value.substr(0,i);
		result = false;
	}
	if (window.event) {
		window.event.returnValue = result;
	}
	if (showDetail != null) {
		MM_setTextOfLayer(showDetail, 0, obj.value.length + "/" + i);
	}
	return result;
}

function disable(obj) {
		obj.disabled=true;
}
function enable(obj) {
		obj.disabled=false;
}

function mod10( cardNumber ) { // LUHN Formula for validation of credit card numbers.
	var ar = new Array( cardNumber.length );
	var i = 0,sum = 0;

	for( i = 0; i < cardNumber.length; ++i ) {
		ar[i] = parseInt(cardNumber.charAt(i));
	}
 // you have to start from the right, and work back.
 for( i = ar.length -2; i >= 0; i-=2 ) {
	 // every second digit starting with the right most (check digit)
	 // will be doubled, and summed with the skipped digits.
	 // if the double digit is > 9, ADD those individual digits together
		ar[i] *= 2;
		if ( ar[i] > 9 ) ar[i]-=9;
	}

	for( i = 0; i < ar.length; ++i ) {
		// if the sum is divisible by 10 mod10 succeeds
		sum += ar[i];
	}
	return (((sum%10)==0)?true:false);
}

var newwin;

function launchwin(winurl,winname,winfeatures)
{
	//This launches a new window and then
	//focuses it if window.focus() is supported.
	newwin = window.open(winurl,winname,winfeatures);
	if (javascript_version > 1.0)
	{
		//delay a bit here because IE4 encounters errors
		//when trying to focus a recently opened window
		setTimeout('newwin.focus();',250);
	}
}
function showHideLinkDialog(obj,insertTo,textObj) {
	obj = MM_findObj(obj);
	if (obj.style.visibility=="visible") {
		obj.style.visibility = "hidden";
	} else {
		obj.style.visibility = "visible";
		insertTo = MM_findObj(insertTo);
		insertTo.value = getSelectedText(textObj);
	}
}

// My own version of the findObject
function findObject(nameToFind, documentObject)
{
	// Loop counter
  var i;
	var oFoundObject;
	var oParent;

	// If no document object is passed in then
	// set to the main document object
	if(!documentObject)
		documentObject = document;

	oParent = nameToFind.indexOf("?");

	if ((oParent > 0) && parent.frames.length)
	{
    documentObject = parent.frames[nameToFind.substring(oParent+1)].document;
		nameToFind = nameToFind.substring(0,oParent);
	}
  if (!(oFoundObject=documentObject[nameToFind]) && documentObject.all)
		oFoundObject = documentObject.all[nameToFind];

	for (i=0;!oFoundObject && i < documentObject.forms.length;i++)
		oFoundObject = documentObject.forms[i][nameToFind];

  for (i=0;!oFoundObject && documentObject.layers && i < documentObject.layers.length;i++)
	{
		oFoundObject = findObj(nameToFind,documentObject.layers[i].document);
	}
  if (!oFoundObject && document.getElementById)
		oFoundObject=document.getElementById(nameToFind);

	return oFoundObject;
}

function ClockCal(controlName,defaultValue,onChange,startYear,stopYear) {


	this.pad = function(value,length) {
		zeros = "";
		i = 0;
		valueString = ""+value;
		while(i++<length-valueString.length) {
			zeros +="0";
		}
		return zeros+""+value;
	}

	this.setMonth = function(month) {
		month = parseInt(month)-1;
		if (month < 0) {
			this.setYear(this.year-1);
			this.month=11;
			return
		}
		if (month > 11) {
			this.setYear(this.year+1);
			this.month=0;
			return
		}
		this.month = month;
		this.day = Math.min(this.day, this.getDaysInMonth());
	}

	this.setYear = function(year) {
		this.year = parseFloat(year);
		this.setMonth(this.month + 1);
	}

	this.getYear = function() {
		return this.year;
	}

	this.setDate = function(defaultValue) {
		if (defaultValue) {
			defaultValue = defaultValue.replace(/-/g,"");
			this.year = parseFloat(defaultValue.substring(0,4));
			this.setMonth(parseFloat(defaultValue.substring(4,6)));
			this.day = parseFloat(defaultValue.substring(6,9));
		}
	}

	this.getDate = function (defaultValue) {
		return this.pad(this.getYear(),4)+"-"+this.pad(this.getMonth(),2)+"-"+this.pad(this.getDay(),2)
	}

	this.getStartDayOffset = function() {
		var tmpdate = new Date(this.year,this.month,1);
		i = tmpdate.getDay();
		return -i+1;
	}

	this.getDaysInMonth = function() {
		var tmpdate = new Date(this.year,this.month,32);
		return 32-tmpdate.getDate();
	}

	this.getDaysInLastMonth = function() {
		var tmpdate = new Date(this.year,this.month,0);
		return tmpdate.getDate();
	}

	this.displayDay = function(day,daysInMonth,daysInLastMonth) {
		if (day < 1) {
			return "<span class=\"CalDulled\">"+(daysInLastMonth+day)+"</span>";
		} else if (day > daysInMonth ) {
			return "<span class=\"CalDulled\">"+(-daysInMonth+day)+"</span>";
		}
		return day;
	}

	this.setDay = function(day) {
		day = parseInt(day);
		if (day < 1) {
			i = this.getDaysInLastMonth();
			this.setMonth(this.month);
			this.day = i+day;
			return;
		}
		i = this.getDaysInMonth();
		if (day > i) {
			this.day = day - i;
			this.setMonth(this.month + 2);
			return;
		}
		this.day = day;
	}

	this.getMonth = function () {
		return parseInt(this.month) + 1;
	}

	this.getDay = function () {
		return parseInt(this.day);
	}

	this.setAfterControl = function(afterControlName) {
		if (this.getDate() > afterControlName.getDate()) {
			afterControlName.setDate(this.getDate());
			afterControlName.update()
		}
	}

	this.makeMonthList = function () {
		var returnValue = "";
		returnValue = "<select id=\""+this.controlName+"Month\" onChange=\""+this.controlName+"Inst.setMonth(parseInt(this.options[this.selectedIndex].value)+1);"+this.controlName+"Inst.update('"+this.controlName+"');\">\n";
		for (i=0;i<12;i++) {
			returnValue += "<option value=\""+i+"\" "+(this.month==i?"selected":"")+">"+this.monthArray[i]+"</option>\n";
		}
		returnValue += "</select>\n";
		return returnValue;
	}
	this.makeYearList = function () {
		var returnValue = "";
		returnValue = "<select id=\""+this.controlName+"Year\" onChange=\""+this.controlName+"Inst.setYear(this.options[this.selectedIndex].value);"+this.controlName+"Inst.update('"+this.controlName+"');\">\n";
		for (i=this.startYear;i<=this.stopYear;i++) {
			returnValue += "<option value=\""+i+"\" "+(this.year==i?"selected":"")+">"+i+"</option>\n";
		}
		returnValue += "</select>\n";
		return returnValue;
	}
	this.setDisable = function(value) {
		this.disabled = value;
		this.update(true);
		this.monthControl.disabled=value;
		this.yearControl.disabled=value;
	}
	this.update = function(creating) {
		var daysInMonth = this.getDaysInMonth();
		var daysInLastMonth = this.getDaysInLastMonth();
		var dayCounter = this.getStartDayOffset();
		var calTable;
		calTable = "<input name=\""+this.controlName+"\" id=\""+this.controlName+"\" type=\"hidden\" value=\""+this.getDate()+"\">";
		calTable += "<table><tr><td><table width=\"100%\" class=\"CalMonthYear\"><tr><td align=\"left\">"+this.makeMonthList()+"</td><td align=\"right\">"+this.makeYearList()+"</td></tr><tr></table></td></tr><td>";
		calTable += "<table class=\"CalTable\">";
		calTable += "<tr><th>Su</th><th>Mo</th><th>Tu</th><th>We</th><th>Th</th><th>Fr</th><th>Sa</th></tr>";
		if (this.disabled) {
			for (e=0;e<6;e++){
				calTable += "<tr>";
				for (i=0;i<7;i++){
						calTable += "<td "+(((i == 0) || (i == 6))?"class=\"CalWeekendDisabled\"":"class=\"CalDisabled\"")+">"+this.displayDay(dayCounter++,daysInMonth,daysInLastMonth)+"</td>";
				}
				calTable += "</tr>";
			}
		} else {
			for (e=0;e<6;e++){
				calTable += "<tr>";
				for (i=0;i<7;i++){
					calTable += "<td onclick=\""+this.controlName+"Inst.setDay("+dayCounter+");"+this.controlName+"Inst.update();\" onmouseover=\"if (this.oldClassName != null) { this.oldClassName=this.className;this.className='CalRollOver'; }\" onmouseout=\"if (this.oldClassName != null) this.className=this.oldClassName;\" "+(dayCounter==this.day?"class=\"CalSelectedDay\"":(i == 0 || i == 6?"class=\"CalWeekend\"":""))+">"+this.displayDay(dayCounter++,daysInMonth,daysInLastMonth)+"</td>";
				}
				calTable += "</tr>";
			}
		}

		calTable += "</td></tr></table>";
		MM_setTextOfLayer(this.controlName+"Layer",'',calTable);
		this.monthControl = findObject(this.controlName+"Month");
		this.yearControl = findObject(this.controlName+"Year");
		if (!creating) {
			eval(onChange);
			return;
		}
	}

	this.controlName = controlName;
	eval(this.controlName +"Inst = this");
	document.write("<div id=\""+this.controlName+"Layer\" class=\"CalControl\"></div>");
	this.date = new Date();

	this.monthArray = new Array(
		"Jan", "Feb", "Mar", "Apr", "May", "Jun",
		"Jul","Aug","Sep","Oct","Nov","Dec"
	);

	this.day=this.date.getDate();
	this.month=this.date.getMonth();
	this.year=this.date.getFullYear();
	this.setDate(defaultValue);
	this.startYear = startYear?startYear:1999;
	this.stopYear = stopYear?stopYear:2015;
	this.onChange = onChange;
	this.disabled = false;
	this.update(true);
}

function MM_findObj(n, d) { //v4.01
	var p,i,x;  if (!d) d=document; if ((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	if (!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	if (!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_nbGroup(event, grpName) { //v6.0
	var i,img,nbArr,args=MM_nbGroup.arguments;
	if (event == "init" && args.length > 2) {
		if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
			img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
			if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
			nbArr[nbArr.length] = img;
			for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
				if (!img.MM_up) img.MM_up = img.src;
				img.src = img.MM_dn = args[i+1];
				nbArr[nbArr.length] = img;
		} }
	} else if (event == "over") {
		document.MM_nbOver = nbArr = new Array();
		for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
			if (!img.MM_up) img.MM_up = img.src;
			img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])? args[i+1] : img.MM_up);
			nbArr[nbArr.length] = img;
		}
	} else if (event == "out" ) {
		for (i=0; i < document.MM_nbOver.length; i++) {
			img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
	} else if (event == "down") {
		nbArr = document[grpName];
		if (nbArr)
			for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
		document[grpName] = nbArr = new Array();
		for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
			if (!img.MM_up) img.MM_up = img.src;
			img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
			nbArr[nbArr.length] = img;
	} }
}
function preview(url, control) {
		obj = findObject(control);
		newWindow = openWindow("", 'preview', "width=700, height=700");
		httpPost(url, "Submit=Preview&Content=" + obj.value.replace('&', '%26'), newWindow);
		newWindow.focus();
}
