// *************************// This section was in the original asepco.js file. DPB thinks it's obsolete in 2005.function validateForm (){    if ( ! firstNameCheck (document.register.firstname))        return false;    if ( ! lastNameCheck (document.register.lastname))        return false;    if ( ! titleCheck (document.register.title))    	 return false;    if ( ! companyCheck (document.register.company))    	 return false;    if ( ! checkEmail (document.register.email, false))        return false;    if ( ! checkUSPhone (document.register.phone, false, true))    	 return false;    if ( ! checkUSPhone (document.register.fax, false, true))    	 return false;    if ( ! addressCheck (document.register.coaddress))        return false;    if ( ! cityCheck (document.register.cocity))        return false;    if ( ! stateCheck (document.forms.register.costate))        return false;    if ( ! checkZIPCode (document.register.cozip, false, true))    	 return false;    if ( ! checkZIPCode (document.register.altzip, true, true))    	 return false;}function preCheckUSPhone(phone, bool, bool2){	if ( ! checkUSPhone (phone, bool, bool2))	{		phone.focus();		phone.select();		return false;	}	return true;}function preCheckEmail(email, bool){	if ( ! checkEmail (email, bool))	{		email.focus();		email.select();		return false;	}	return true;}function preCheckStateCode(state, bool){	if ( ! checkStateCode (state, bool))	{		state.focus();		state.select();		return false;	}	return true;}function preCheckZIPCode(zip, bool){	if ( ! checkZIPCode (zip, false))	{		zip.focus();		zip.select();		return false;	}	return true;}function companyCheck(company){    if( isEmpty (company.value))    {        alert("You must specify your company.");        company.focus();        company.select();        return false;    }    return true;}function titleCheck(title){    if( isEmpty (title.value))    {        alert("You must specify your title.");        title.focus();        title.select();        return false;    }    return true;}function firstNameCheck(first){    if( isEmpty (first.value))    {        alert("You must specify your first name.");        first.focus();        first.select();        return false;    }    return true;}function lastNameCheck(last){    if( isEmpty (last.value))    {        alert("You must specify your last name.");        last.focus();        last.select();        return false;    }    return true;}function addressCheck(address){    if( isEmpty (address.value))    {        alert("You must specify a street address.");        address.focus();        address.select();        return false;    }    return true;}function cityCheck(city){    if( isEmpty (city.value))    {        alert("You must specify a city.");        city.focus();        city.select();        return false;    }    return true;}function stateCheck(state){    if( state.options[state.selectedIndex].text == "" )    {        alert("You must select a state.");        state.focus();        return false;    }    return true;}function getAsepcoDate(){	var mydate=new Date();	var year=mydate.getYear();	if(year<1000)		year+=1900;	var day=mydate.getDay();	var month=mydate.getMonth();	var daym=mydate.getDate();	if(daym<10)		daym="0"+daym;	var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December");	return (montharray[month]+" "+daym+", "+year);}// *************************// The following section was added to include code to support Online.// dkeith: added 11-14-03: function to check for numeric entries in the Qty field in product catalog pages.//         Blanks out the incorrect entry.function validateNum( name, num ){	isNum = /^[0-9]*$/;		if ( !isNum.test( num ) )	{		alert( 'Only numbers can be entered in the Quantity box' );		name.value = "";	}}// dkeith: added 11-14-03: function to check for numeric entries in the Qty field in product catalog pages.//         Restores the original value.function validateNumRestore( orgnum, name, num ){	isNum = /^[0-9]*$/;		// dbrown: added * to above regexp to allow multi-digit and empty results. 12/10/03	if ( !isNum.test( num ) )	{		alert( 'Only numbers can be entered in the Quantity box' );		name.value = orgnum;	}}// dkeith: added 11-18-03: set focus on a given object in the page; //         typically called by an onLoad handler.function setFocus( obj ){		obj.focus();}// dkeith 1-31-04: don't allow all zeros or all blanks in the // Orders or Quote Carts// dbrown 2-23-04: Changed error message on the alert.function validate_quantities(){		orderTotal = 0;		allNaN = true;			for ( i=0; i < document.forms[0].elements.length; i++ )		{				myname =  document.forms[0].elements[i].name;									if  (  myname.substr(0,5) == "PLine" )				{ 		 	 			if (  isNaN(parseInt(document.forms[0].elements[i].value)) == false )						{								allNaN = false;								orderTotal =  orderTotal + parseInt(document.forms[0].elements[i].value);						}				}		}		if ( orderTotal < 1 || allNaN )		{				alert("You have not entered a quantity for any of the products in this Cart.\nPlease enter a quantity for each product you want to order.\nTo delete a product from your cart, check the Delete box and select Update Cart.");    			return(false);		}} // validate_quantities// dkeith 2-26-04: copied from an old version of altsearch.html in //        conjunction with restoring the "# of additional ports" //        control in altsearchports.html. (re: bug #238)function setButton( val ){	if ( val >= 1 )	{		document.altsearch.submit2.disabled = false;	}	else	{		document.altsearch.submit2.disabled = true;	}}// *************************// The following is MacroMedia code for mouseOver effects. Added here to remove from individual pages.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];}}}/* ****** Remove v3.0; replace below w. v4.0function MM_findObj(n, d) { //v3.0	alert("MM_findObj w. n = " + n);  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);     return x;}*/function MM_findObj(n, d) { //v4.0	// Find and return an object in document d with name n	// debugging: alert("MM_findObj w. n = " + n);	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); 	// debugging: if (x) {alert("x.src = " + x.src)} else {alert("x is null.")};	return x;}function MM_swapImage() { //v3.0	// debugging: alert("Entering 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];}	// debugging: if (x) {alert("x.src = " + x.src)} else {alert("x is null.")};}function popChildWindow(target, name, width, height){    window.open(target,name,"width=" + width +",height=" + height + ",resizable=no,scrollbars=yes");}function MM_openBrWindow(theURL,winName,features) { //v2.0  window.open(theURL,winName,features);}// Added to hardwire the Help window features for use in the Online application.// DPB 8/19/2003function popHelpWindow(theURL) { // DPB 8/19/03  window.open(theURL,'HelpWindow','scrollbars=yes,resizable=yes,width=680,height=725');}// Added to implement the stop sign for off-color stuff.// DPB 4/22/2005function popOffColorJokeWindow(theURL) { 	if (confirm("This page contains EXTREMELY salty language that may be objectionable - Are you sure you wish to view it?" )) {		window.open(theURL,'JokeWindow','scrollbars=yes,resizable=yes,width=680,height=725');	}} // popOffColorJokeWindow// Added to centralize the preLoad images code.// DPB 6/4/2004function preLoadOnlineImages (relativePath) {	// relativePath is the relative path from the calling page to the images folder	// e.g. '../images/	// It is prepended to each image that is to be preloaded.	MM_preloadImages(		relativePath + 'helpOver.gif',		relativePath + 'help_lrgOver.gif',		relativePath + 'mainOver.gif',		relativePath + 'main_lrgOver.gif',		relativePath + 'catalogOver.gif',		relativePath + 'catalog_lrgOver.gif',		relativePath + 'quotesOver.gif',		relativePath + 'quotes_lrgOver.gif',		relativePath + 'ordersOver.gif',		relativePath + 'orders_lrgOver.gif',		relativePath + 'projectsOver.gif',		relativePath + 'projects_lrgOver.gif',		relativePath + 'help_r2_c2.gif',    // These can be removed after pages have been converted to new embedded style.		relativePath + 'help_r2_c2_f2.gif',		relativePath + 'main_r2_c2.gif',		relativePath + 'main_r2_c2_f2.gif',		relativePath + 'catalog_r2_c2.gif',		relativePath + 'catalog_r2_c2_f2.gif',		relativePath + 'quotes_r2_c2.gif',		relativePath + 'quotes_r2_c2_f2.gif',		relativePath + 'orders_r2_c2.gif',		relativePath + 'orders_r2_c2_f2.gif'		)} // preLoadOnlineImages// Added to centralize the preLoad images code for the main site// DPB 12/20/2004var topButtonsArray = new Array ("home","products","design","ordering","about","faqs","pub");var productsButtonsArray = new Array ("valves","diaphragms","actuators","mixers");var aboutButtonsArray = new Array ("","","");var pubButtonsArray = new Array ("","","");function preLoadPublicImages (relativePath, buttonArray) {	// relativePath is the relative path from the calling page to the images folder	// e.g. '../images/	// It is prepended to each image that is to be preloaded.	// buttonArray is the list of buttons to load.	// The naming convention is that "Over" is added to the button's base name.	// This is a modified version of MM_preloadImages.    var d=document; 	if(d.images) { 		if(!d.MM_p) d.MM_p=new Array();   		var i,j=d.MM_p.length,a=buttonArray; 		for (i=0; i<a.length; i++) {   			// if (a[i].indexOf("#")!=0){ 				d.MM_p[j]=new Image; d.MM_p[j++].src= relativePath + a[i] + "Over.gif";			// }		}	}} // preLoadOnlineImages// *************************// This section contains code generated by GoLive to do the Odyssey. // removed by DPB 050418. Stored in bonepile.js// *************************// The following section was part of the original site for doing the menu popup windows. Now obsolete (2005).// removed by DPB 050418. Stored in bonepile.jsfunction xsMailTo(whoTo, domainTo, linkText, subjectTo, bodyTo ) {	// xsMailTo is a function that puts a mailto: link into a file without making the email address obviously visible to	// robots that might be trying to harvest email addresses.	// whoTo specifies the target email address without the domain part.	// domainTo specifies the domain for the address.	// linkText is what appears to the visitor in her browser.	// subjectTo is an optional Subject for the message to be sent.	// bodyTo is an optional Body for the message to be sent.	// Sample usage: 	//   <script language="JavaScript" type="text/javascript"> xsMailTo("webinquiry", "xs.com", "webInquiry at xs.com", "Free Developmental Edit",	//                   "Please contact me about a free developmental edit on the document of my choice."); </script >	if (!subjectTo) { subjectTo = ""; };	if (!bodyTo) { bodyTo = ""; };	document.write('<a href=\"mai' + 'lto:' + whoTo + '&#64;' + domainTo + '?subject=' + subjectTo + '&body=' + bodyTo				   + '\" onMouseOver=\"window.status=\' \';return true\">' + linkText + '</a>');	} // xsMailTo// Created by Denny Brown of Expert Support Inc. on 071212// Copyright 2007 Expert Support Inc.function hideDOMObject(strObjName, doc) {	// hideDOMObject uses the string version of a DOM object, finds that object, and the sets its visibility to hidden.	// strObjName is the string version of the object's name. 	// doc is the document in which to find the object; if empty, it defaults to the current document.	// Return value is meaningless; this function is called for the side effect.	// alert("Starting hideDOMObject with " + strObjName); // for debugging...	if (!doc) {doc = document;};	var domObj = MM_findObj(strObjName, document);	if (domObj) {		domObj.style.visibility = "hidden";	// } else { // for debugging...		// alert("Could not find DOM object for " + strObjName); // for debugging...	};	// alert("Exit hideDOMObject with " + strObjName); // for debugging...	return(true);} // hideDOMObject// Added by DPB 060424. Enable making things disappear if they are not relevant to the current selections.//function setVisibilityOfElement(whichElement, visibilitySwitch) {	// This function turns the visibility of the object identified by whichElement on or off.	// whichElement is a string identifying the element.	// visibilitySwitch is TRUE for ON, FALSE for OFF.	var visValue;	if (visibilitySwitch) {visValue="inherit"} else {visValue="hidden"};	var theObject = MM_findObj(whichElement, document);	if (theObject) {		theObject.style.visibility = visValue;	} else {		// alert ("I cannot find the element " & whichElement & " on this page.");	};} // setVisibilityOfElementfunction setDisplayOfElement(whichElement, displaySwitch) {	// This function sets the display of the object identified by whichElement to displaySwitch.	// displaySwitch should be one of: none, block, incline, compact, inline-table, list-item,	// run-in, table, table-caption, table-cell, table-column-group, table-footer-group,	// table-header-group, table-row, table-row-group.	// cf page 815 of JavaScript Bible	var theObject = MM_findObj(whichElement, document);	if (theObject) {		theObject.style.display = displaySwitch;	} else {		// alert ("I cannot find the element " & whichElement & " on this page.");	};	} // setDisplayOfElement// *************************// From the web. skeleton function to call php from javascript. Not tested. dpb 070716   function javaFunction(){	// In the varArray are all the variables you want to give with the function	var varArray = new Array();	varArray[0] = "var1";	varArray[1] = "var2";   	// the url which you have to reload is this page, but you add an action to the GET- or POST-variable	var url="<?php echo $_SERVER[PHP_SELF];?>?action=phpFunction&vars="+varArray;		// Opens the url in the same window	   window.open(url, "_self");	  }WO_LoadedMsg = "Asepco.js loaded. ";