<!--
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_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_FindNoCaseObj(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_FindNoCaseObj(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_FindNoCaseObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


var originalClass = "";

//Changes the class of an object and store the original
function changeClass(row,cssClass) { 
	originalClass=row.className; 
	row.className=cssClass; 
}

// ===================================================================
// Author: Matt Kruse <matt@mattkruse.com>
// WWW: http://www.mattkruse.com/
//
// NOTICE: You may use this code for any purpose, commercial or
// private, without any further permission from the author. You may
// remove this notice from your final code if you wish, however it is
// appreciated by the author if at least my web site address is kept.
//
// You may *NOT* re-distribute this code in any way except through its
// use. That means, you can include it in your product, or your web
// site, or any other form where the code is actually being used. You
// may not put the plain javascript up on your site for download or
// include it in your javascript libraries for download. 
// If you wish to share this code with others, please just point them
// to the URL instead.
// Please DO NOT link directly to my .js files from your site. Copy
// the files to your server and use them there. Thank you.
// ===================================================================

// -------------------------------------------------------------------
// TabNext()
// Function to auto-tab phone field
// Arguments:
//   obj :  The input object (this)
//   event: Either 'up' or 'down' depending on the keypress event
//   len  : Max length of field - tab when input reaches this length
//   next_field: input object to get focus after this one
// -------------------------------------------------------------------
var phone_field_length=0;
function TabNext(obj,event,len,next_field) {
	if (event == "down") {
		phone_field_length=obj.value.length;
		}
	else if (event == "up") {
		if (obj.value.length != phone_field_length) {
			phone_field_length=obj.value.length;
			if (phone_field_length == len) {
				next_field.focus();
				}
			}
		}
}
//show layers
function showLayers(lstLayers) {
	var aryLayers=lstLayers.split(",");
	for (var intCtr=0, len=aryLayers.length; intCtr < len; ++intCtr ) {
		//alert(aryLayers[intCtr]);
		document.getElementById(aryLayers[intCtr]).className="display_all";
	}
}
//hide layers
function hideLayers(lstLayers) {
	var aryLayers=lstLayers.split(",");
	for (var intCtr=0, len=aryLayers.length; intCtr < len; ++intCtr ) {
		document.getElementById(aryLayers[intCtr]).className="display_none";
	}
}

//add field to validation
function appendValidationField( vField, vError ){
	removeValidationField( vField, vError );
	if( document.inputForm.v_Fields.value.length > 0 )
		var delim = '|';
	else
		var delim = '';
	document.inputForm.v_Fields.value += delim + vField;
	document.inputForm.v_Errors.value += delim + vError;
	return 1;
}

//remove field from validation
function removeValidationField( vField, vError ){
	removeFromField( '|' + vField, '|' + vError );
	removeFromField( vField, vError );
}

//remove field from validation (don't call this one, use above function)
function removeFromField( vField, vError ){
	var FieldVal = document.inputForm.v_Fields.value;
	var FieldStartIndex = FieldVal.indexOf( vField );
	var FieldEndIndex = FieldVal.indexOf( vField ) + vField.length;
	var ErrorVal = document.inputForm.v_Errors.value;
	var ErrorStartIndex = ErrorVal.indexOf( vError );
	var ErrorEndIndex = ErrorVal.indexOf( vError ) + vError.length;
	if( FieldStartIndex != -1 && ErrorStartIndex != -1 ){
		document.inputForm.v_Fields.value = FieldVal.substr( 0, FieldStartIndex ) + FieldVal.substr( FieldEndIndex, FieldVal.length - FieldEndIndex );
		document.inputForm.v_Errors.value = ErrorVal.substr( 0, ErrorStartIndex ) + ErrorVal.substr( ErrorEndIndex, ErrorVal.length - ErrorEndIndex );
		if( document.inputForm.v_Fields.value.charAt(0) == '|' ){
			document.inputForm.v_Fields.value = document.inputForm.v_Fields.value.substr(1,document.inputForm.v_Fields.value.length);
			document.inputForm.v_Errors.value = document.inputForm.v_Errors.value.substr(1,document.inputForm.v_Errors.value.length);
		}
		return 1;
	}else{
		return 0;
	}
}

//update the selected option in a dropdown to match a text input
function updateDropdownOption( compareValue, dropdownID ){
	var selobject = document.getElementById( dropdownID );
	var tempstr = "";
	for (var x=0; x < selobject.length; x++){
		tempstr = selobject.options[x].text.toUpperCase();
		if( tempstr.indexOf( compareValue.toUpperCase() ) == 0 ) {
			selobject.selectedIndex = x;
			return true;
		}
	}
}

//-->