function test()
{
	alert('hi world');
}

function openWizardx() {

	
	var screenX = (document.documentElement.clientWidth  /2) - 275;
  	var screenY = (document.documentElement.clientHeight /2) - 150;

	//var screenX = (screen.width /2) - 275;
  	//var screenY = (screen.height /2) - 150;
	features ="width=545, height=400, screenX=" + screenX + ", screenY=" + screenY + ", top=" + screenY + ", left=" + screenX;
	window.open("http://www.asentria.com/PriceWizard/Wizard.html","price_wizard",features);
	//window.location = "/contact/info.asp";
}



// all this script relates to opening price wizard centered on browser window //

		/* Returns a Boolean which indicates whether IE 6 is being used. */
		function IsRunningIE6()
		{
			var is_ie6 = (window.external && typeof window.XMLHttpRequest == "undefined");
			return is_ie6;
		}


		function openPage(url , popW, popH)
		{
		  var possition = false;
		  var w = 480, h = 340;
		  var y = 0, x = 0;
		  if (document.all)
		   {
			/* the following is only available after onLoad */
			w = document.body.clientWidth;
			h = document.body.clientHeight;
			x = window.screenTop;
			y = window.screenLeft;
		  }
		  else if (document.layers) 
		  {
			w = window.innerWidth;
			h = window.innerHeight;
			x = window.screenX;
			y = window.screenY;
		  }

		  	var leftPos = ((w-popW)/2)+y, topPos = ((h-popH)/2)+x;
			window.open(url,"_blank","top=" + topPos + ", left=" + leftPos + ", toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=" + popW + ", height=" + popH);
		}

		function openWizard()
		{
			var newPage = "../PriceWizard/Wizard.html";
			var newPageWidth = 545, newPageHeight = 400;
			
			if(IsRunningIE6())
				openPage(newPage , newPageWidth , newPageHeight);
			else
				openCenteredOnOpenerWindow( newPage , "name1" , newPageWidth , newPageHeight , false , false , "toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no" , "name2" );
		}
		
		// Open a window at the center of the parent window
		function openCenteredOnOpenerWindow(url, name, width, height, status, scrollbars, moreProperties, openerName) {
		   var centerX = 0;
		   var centerY = 0;
		   if (window.screenX != null && window.outerWidth) {
		      centerX = window.screenX + (window.outerWidth / 2);
		      centerY = window.screenY + (window.outerHeight / 2);
		   }
		   else if (window.screenLeft) {
		      if (document.documentElement) {
		         centerX = window.screenLeft + (document.documentElement.offsetWidth / 2);
		         centerY = window.screenTop + (document.documentElement.offsetHeight / 2);
		      }
		      else if (document.body && document.body.offsetWidth) {
		         centerX = window.screenLeft + (document.body.offsetWidth / 2);
		         centerY = window.screenTop + (document.body.offsetHeight / 2);
		      }
		   }
		   
		   if (centerX == 0) {
		      openCenteredWindow(url, name, width, height, status, scrollbars, moreProperties, openerName);
		   }
		   var x = parseInt(centerX - (width / 2));
		   var y = parseInt(centerY - (height / 2));
		   if (!status) status = '';
		   if (!openerName) openerName = '';
		   var reference = openPositionedWindow(url, name, width, height, x, y, status, scrollbars, moreProperties, openerName);
		   return reference;
		}   
		
			// Open a window at the center of the screen
			function openCenteredWindow(url, name, width, height, status, scrollbars, moreProperties, openerName) {
			   var x, y = 0;
			   if (screen) {
				  x = (screen.availWidth - width) / 2;
				  y = (screen.availHeight - height) / 2;
			   }
			   if (!status) status = '';
			   if (!openerName) openerName = '';
			   var reference = openPositionedWindow(url, name, width, height, x, y, status, scrollbars, moreProperties, openerName);
			   return reference;
			}   		
		
			// Open a window at a given position on the screen
			function openPositionedWindow(url, name, width, height, x, y, status, scrollbars, moreProperties, openerName) {
			   
			   // ie 4.5 and 5.0 mac - windows are 2 pixels too short; if a statusbar is used, the window will be an additional 15 pixels short
			   var agent = navigator.userAgent.toLowerCase();
			   if (agent.indexOf("mac") != -1 && agent.indexOf("msie") != -1 && (agent.indexOf("msie 4") != -1 || agent.indexOf("msie 5.0") != -1) ) {
				  height += (status) ? 17 : 2;
			   }
			
			   // Adjust width if scrollbars are used (pc places scrollbars inside the content area; mac outside) 
			   width += (scrollbars != '' && scrollbars != null && agent.indexOf("mac") == -1) ? 16 : 0;
			
			   var properties = 'width=' + width + ',height=' + height + ',screenX=' + x + ',screenY=' + y + ',left=' + x + ',top=' + y + ((status) ? ',status' : '') + ',scrollbars' + ((scrollbars) ? '' : '=no') + ((moreProperties) ? ',' + moreProperties : '');
			   var reference = openWindow(url, name, properties, openerName);
			   
			   // resize window in ie if we can resize in ns; very messy
			   // commented out because openPositionedWindow() doesn't set the resizable attribute
			   // left in for reference
			   /*if (resizable && agent.indexOf("msie") != -1) {
				  if (agent.indexOf("mac") != -1) {
					 height += (status) ? 15 : 2;
					 if (parseFloat(navigator.appVersion) > 5) width -= 11;
				  }
				  else {
					 height += (status) ? 49 : 31;
					 width += 13;
				  }
				  setTimeout('if (reference != null && !reference.closed) reference.resizeTo(' + width + ',' + height + ');', 150);
			   }*/
			
			   return reference;
			}

// Core utility function that actually creates the window and gives focus to it
function openWindow(url, name, properties, openerName) {

   // ie4.x pc can't give focus to windows containing documents from a different domain
   // in this case, initially load a local interstisial page to allow focussing before loading final url
   var agent = navigator.userAgent.toLowerCase();
   if (agent.indexOf("msie") != -1 && parseInt(navigator.appVersion) == 4 && agent.indexOf("msie 5") == -1 && agent.indexOf("msie5") == -1 && agent.indexOf("win") != -1 && url.indexOf('http://') == 0) {
      winReference = window.open('about:blank', name, properties);
      
      setTimeout('if (winReference && !winReference.closed) winReference.location.replace("' + url + '")', 300);
   }
   else {
      winReference = window.open(url, name, properties);
   }

   // ie doesn't like giving focus immediately (to new window in 4.5 on mac; to existing ones in 5 on pc)
   setTimeout('if (winReference && !winReference.closed) winReference.focus()', 200);
   
   if (openerName) self.name = openerName;
   return winReference;
}


// end of script relating to price wizard //









//Returns the value of a paramater
function getParam( parameterName, parameterString  ) 
{
  var queryString = parameterString;
  //alert(queryString);
  //if (queryString.length==0) {return "null";}
  var parameters = new Array();
  parameters = queryString.split('&');
  for(var i = 0; i < parameters.length; i++) {
    //alert(parameters[i]);
    //alert(parameters[i].indexOf(parameterName));
    if (parameters[i].indexOf(parameterName)>=0) {
      //alert(parameters[i]);
      var parameterValue = new Array();
      parameterValue = parameters[i].split('=');
      return unescape(parameterValue[1]);
    }
  }
  return null;
}


//Returns the value of a paramater submitted as part of a query string
function getParameter( parameterName ) 
{
  var queryString = window.location.search.substring(1);
  //alert(queryString);
  //if (queryString.length==0) {return "null";}
  var parameters = new Array();
  parameters = queryString.split('&');
  for(var i = 0; i < parameters.length; i++) {
    //alert(parameters[i]);
    //alert(parameters[i].indexOf(parameterName));
    if (parameters[i].indexOf(parameterName)>=0) {
      //alert(parameters[i]);
      var parameterValue = new Array();
      parameterValue = parameters[i].split('=');
      return unescape(parameterValue[1]);
    }
  }
  return null;
}


/* The myunescape () function works by converting all occurrences of "+" in the input 
string to "%20". The resulting string is then handed over to the original unescape() 
function for processing, and the correct result is returned. */
function myUnescape(str)
{
	str = "" + str;
	while (true)
	{
		var i = str . indexOf ('+');
		if (i < 0)
			break;
		str = str . substring (0, i) + '%20' +
			str . substring (i + 1, str . length);
	}
	return unescape (str);
}



//Strips leading and trailing spaces from the specified string
function TrimString(sInString) 
{
  sInString = sInString.replace( /^\s+/g, "" );// strip leading
  return sInString.replace( /\s+$/g, "" );// strip trailing
}



/* Remember that IP addresses must have 4 parts, separated by periods, and that each part must be in 
   the range of 0 to 255. Also note that "000" for a part would be valid, as would "0". So, the first 
   thing we do is make sure there are 4 groups of numbers (anywhere from 1 to 3 digits) separated by 
   periods. Use a regular expression to do that. If the string passes that test, then split up the string
   into its 4 parts. The first part cannot be the number zero, so a check is done for that. None of the 
   parts can be greater than 255, so just use a little loop to check the value of each part to make sure 
   it is less than or equal to 255. If everything passes, return true, otherwise return false.
   
   NOTE: This script was taken from http://www.breakingpar.com/bkp/home.nsf/0/87256B280015193F87256C87006CC664
*/
function isValidIPAddress(ipaddr) 
{
 	var re = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/;
 	if (re.test(ipaddr)) 
	{
    	var parts = ipaddr.split(".");
    	if (parseInt(parseFloat(parts[0])) == 0) 
			return false; 

    	for (var i=0; i<parts.length; i++) 
    		if (parseInt(parseFloat(parts[i])) > 255)
				return false; 
    			
   		 return true;
 	} 
	else 
	{
    	return false;
 	}
}