function menuover(myelement){
if (myelement=="getthecode"){
	document.getElementById("getthecode").src="images/getthecode-over.gif";
	}
if (myelement=="benchmark"){
	document.getElementById("benchmark").src="images/benchmark-over.gif";
	}
}
function menuout(myelement){
	if (myelement=="getthecode"){
	document.getElementById("getthecode").src="images/getthecode.gif";
	}
if (myelement=="benchmark"){
	document.getElementById("benchmark").src="images/benchmark.gif";
	}
}

function imagepreload(){
  if (document.images)    {      
		preload_image_object = new Image();      
		// set image url      
		image_url = new Array();      
		image_url[0] = "images/getthecode-over.jpg";      
		image_url[1] = "images/benchmark-over.jpg";       
		var i = 0;       
		for(i=0; i<=1; i++)      {    
			preload_image_object.src = image_url[i];    
		}	 
	}
}

function validinfo(){
document.getElementById("checkingform").style.visibility="visible";
var msg = "Required information has not been completed:-\n\n";

	if(document.getElementById("campaignname").value==""){
			msg = msg + " - Enter a campaign name or reference\n";
	}
	if (document.getElementById("industrysector").value=="") {
			msg = msg + " - Choose an industry sector for your business\n";
	}
	if (document.getElementById("campaignvolume").value=="") {
			msg = msg + " - Enter how many emails are being sent\n";
	}
	else{
			if (IsNumeric(document.getElementById("campaignvolume").value) == false) {
			msg = msg + " - Enter a numeric value for number of emails being sent\n";
			}
	}
	if (document.getElementById("campaignclickurl").value=="http://www.") {
			msg = msg + " - Provide a click-thru URL\n";
	}

	if(msg!="Required information has not been completed:-\n\n"){
		alert(msg);
		document.getElementById("checkingform").style.visibility="hidden";
		return false;
	}
	else{
		 checkurl(document.getElementById("campaignclickurl").value);			
	}
}

function IsNumeric(strString)
   //  check for valid numeric strings	
   {
   var strValidChars = "0123456789.-";
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return false;

   //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
   return blnResult;
   }

function ajax(){
// Create ajax object for updates
	try{
		request=new XMLHttpRequest();
		
	}
	catch (tryms){
		try{
			request = new ActiveXObject("Msxml2.XMLHTTP");
		}		
		catch (oldms){		
		try{
			request = new ActiveXObject("Microsoft.XMLHTTP");	
		}		 
		catch (failed){
			request=null;
		}
		}
	}
	if(request==null){
		alert("Ajax Error");
	}		
}
