window.onerror = null; // Disable script error popups
var formClashArray = new Array(); // Create a new array of form element names for DHTML/form clash prevention
var formClashIndex = 0;

/* Functions that swaps images. */
function MM_swapImage() { //v3.0
	//alert ("MM_swapImage");
  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_swapImgRestore() { //v3.0
//alert ("MM_swapImgRestore");
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

/* Functions that handle preload. */
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];}}
}

// stop hiding -->

function MM_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.getElementById(n); return x;
}

function openWin(theURL, pW, pH, toolbar, directories, status, menubar, scrollbars, resizable) {
	var toolbar		= toolbar || 0;
	var directories	= directories || 0;
	var status		= status || 0;
	var menubar		= menubar || 0;
	var scrollbars	= scrollbars || 1;
	var resizable	= resizable || 1;
	var pW			= pW || 400;	
	var pH			= pH || 500;
	var pWidth      = pW ? pW+20 : 800;		
	var pHeight     = pH ? pH : 600;						    // Popup height
	var pXOffset    = (screen) ? (screen.width / 2) - (pWidth / 2) : (800 / 2) - (pWidth / 2);		// Popup X placement
	var pYOffset    = 200;										// Popup Y placement
	
	nsWin = window.open (theURL, 'gaPopup', 'left=' + pXOffset + ',top=' + pYOffset + ',height=' + pHeight + ',width=' + pWidth + ',toolbar=' + toolbar + ',directories=' + directories + ',status=' + status + ',menubar=' + menubar + ',scrollbars=' + scrollbars + ',resizable=' + resizable);
}

function textLimit(formfield, limit) {
	// If the length of the value in the formfield is over the limit
	if(formfield.value.length >= limit)
		formfield.value = formfield.value.substr(0, limit); // Truncate the form field to that limit
}

// Identify user agent
isIE4 = (document.all) ? true : false;
isW3C = (document.getElementById && !isIE4) ? true : false;
isNN4 = (document.layers) ? true : false;


function styleChange(elementID) {
	if (isIE4) {
		return document.all[elementID];
	} else if(isW3C) {
		return document.getElementById(elementID);
	}
}

// For DHTML menus
if(window.event + "" == "undefined") event = null;
function HM_f_PopUp(){return false};
function HM_f_PopDown(){return false};
popUp = HM_f_PopUp;
popDown = HM_f_PopDown;