<!--

function MM_findObj(n, d) { //v3.0 waztech.com
	var p,i,x;
	if (!d) d=document;
	if ( (p=n.indexOf("?") ) > 0 && parent.frames.length ) // if there are frames
	{	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);	}
	
	if (!(x=d[n]) && d.all)  x=d.all[n]; 
	/* if Internet Explorer (d.all) and you can't find the object 
	in the root of the document tree, crawl through the forms collection */

	for (i=0; !x && i<d.forms.length; i++) x=d.forms[i][n];
	/* loop through all forms on the page to find the element */
	
	/* if netscape (with layers), loop through all layers, call the function again, referencing the document of each layer  */
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	
	// return the object reference
	return x;
}



function MM_validateForm() 
{ //v5 waztech.com
  var i,p,di,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments,objForm;

objForm=MM_findObj(args[0]).form;
//alert(objForm);

  for (i=0; i<(args.length-2); i+=3) 
  { 	test=args[i+2];
  
  		val=MM_findObj(args[i]); 

		if (val) 
		{ nm=val.name; 
			if ((val=val.value)!="") 
			{	if (test.indexOf('isEmail')!=-1) 
				{ p=val.indexOf('@'); di=val.lastIndexOf('.');
					if ( p<1 || p==(val.length-1) || di<p || di==p+1 || di>=val.length-2 )
					{ errors+='- '+nm+' must contain a valid e-mail address.\n'; }
				}
			else if (test!='R') 
			{	num = parseFloat(val);
		        if (val!=''+num) errors+='- '+nm+' must contain a number.\n';
		        if (test.indexOf('inRange') != -1) 
				{	p=test.indexOf(':'); min=test.substring(8,p); max=test.substring(p+1);
					if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
				}
			}
		}
		else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; 
		}
  }

  if (errors) 
  	{ 	alert('The following error(s) occurred:\n'+errors); 
		document.MM_returnValue = false;
	}
	else
	{	disableForm(objForm);
		document.MM_returnValue = true;
	}

}

/* this function will disable the form button, so it can't be clicked on after the form is submitted */
function disableForm(theform) 
	{	if (document.all || document.getElementById) 
		{	for (i = 0; i < theform.length; i++) 
			{	var tempobj = theform.elements[i];
				if (tempobj.type.toLowerCase() == "submit") tempobj.disabled = true;
			}
		}
		else // show alert if we can't find the submit button.
		{ setTimeout("alert('The information is being sent. Thank you.');", 3000); }
	return true;
	}
// end function




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_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_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_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}

function Help(url) {
	window.open('http://www.waztech.com/' + url, 'helpframe', "height=400,width=600,status=no,directories=no,location=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,screenY=0,screenX=300,top=0,left=300");
}

//-->
