browser = (((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 3 )) || ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4 )))

if ( browser) 
{
	normal = new MakeImagesArray(2);
	over = new MakeImagesArray(2);

	normal[1].src = "/_images/pest-control-banner1.gif";
	over[1].src = "/_images/pest-control-banner2.gif";

}


function cellout(cellNum) {
	if (cellNum == 1) {
		document.images['cell1_tl'].src = normal[2].src;
	}

}
function verify_survey()
{
 if (document.getElementsByName('surveyname')[0].value == "") 
  {
   alert("Please enter your name or company name");
   return false;
  }
}
function verify()
{
 if (document.getElementsByName('contactname')[0].value == "") 
  {
   alert("You must enter a Contact Name.");
   return false;
  }

 if (document.getElementsByName('companyname')[0].value == "") 
  {
   alert("You must enter a Company Name.");
   return false;
  }

 if (document.getElementsByName('address')[0].value == "") 
  {
   alert("You must enter an Address.");
   return false;
  }
 if (document.getElementsByName('city')[0].value == "") 
  {
   alert("You must enter a City.");
   return false;
  }
 if (document.getElementsByName('state')[0].value == "") 
  {
   alert("You must enter a State/Province.");
   return false;
  }
 if (document.getElementsByName('country')[0].value == "") 
  {
   alert("You must enter a Country.");
   return false;
  }
 if (document.getElementsByName('phone')[0].value == "") 
  {
   alert("You must enter a Phone number.");
   return false;
  }  
 if (document.getElementsByName('email')[0].value == "") 
  {
   alert("You must enter an Email address.");
   return false;
  }
 if (document.getElementsByName('zipcode')[0].value == "") 
  {
   alert("You must enter a ZIP code.");
   return false;
  }

}
function verify_new()
{
 if (document.getElementsByName('contactname')[0].value == "") 
  {
   alert("You must enter a Contact Name.");
   return false;
  }

 if (document.getElementsByName('companyname')[0].value == "") 
  {
   alert("You must enter a Company Name.");
   return false;
  }

 if (document.getElementsByName('address')[0].value == "") 
  {
   alert("You must enter an Address.");
   return false;
  }
 if (document.getElementsByName('city')[0].value == "") 
  {
   alert("You must enter a City.");
   return false;
  }
 if (document.getElementsByName('state')[0].value == "") 
  {
   alert("You must enter a State/Province.");
   return false;
  }
 if (document.getElementsByName('country')[0].value == "") 
  {
   alert("You must enter a Country.");
   return false;
  }
 if (document.getElementsByName('phone')[0].value == "") 
  {
   alert("You must enter a Phone number.");
   return false;
  }  
 if (document.getElementsByName('email')[0].value == "") 
  {
   alert("You must enter an Email address.");
   return false;
  }
 if (document.getElementsByName('zipcode')[0].value == "") 
  {
   alert("You must enter a ZIP code.");
   return false;
  }
 if (document.getElementsByName('trial_cd')[0].checked == false && document.getElementsByName('download')[0].checked == false) 
  {
   alert("Please specify how would you like to get a trial version.");
   return false;
  }

}

function changecellbg(divName,color)
{
	var body = document.getElementById(divName);
	
	if(body) {body.style.background = color;}

}

function checkform2 ( form )
{

  if (form.query.value == "" || form.query.value.length<3) {
    //alert( "Please enter query." );
    form.query.focus();
    return false ;
  }
  return true ;
}

function MakeImagesArray(n) {
	
	this.length = n

	for (var i = 1; i<=n; i++) {
		this[i] = new Image();
	}
	return this;
}

function msover(imageName, num) {
	if ( browser) { 
		document.images[imageName].src = over[num].src;
	}
}

function msout(imageName, num) {
	if ( browser) {
		document.images[imageName].src = normal[num].src;
	}
}

function generateAddress (name)
{
var serv = "AvailSuite.com";
eml = name +  "@" + serv;
return eml;
}

function printAddress (name)
{
document.write (generateAddress(name));
}

function sendLetter (name, sub)
{
eml = "mailto:" + generateAddress(name);
if (sub != "") eml += "?subject=" + sub;
window.location.href = eml;
}

function sendLetter2 (name, domain)
{
eml = "mailto:" + name +  "@" + domain;
window.location.href = eml;
}

function printAddress2 (name, domain)
{
document.write (name +  "@" + domain);
}

function changeLinkDivState(linkName, divName)
{
	var link = document.getElementById(linkName);
	var body = document.getElementById(divName);
	
	if(body)
	{
		if(body.style.display == "none")
		{
			body.style.display = "block";
			if(link)
				link.className = "faqLinkNow";
		}
		else
		{
			body.style.display = "none";
			if(link)
				link.className = "faqLink";
		}
	}
}

function showMessage(message){
	if (message != '') alert(message);
}

function downloadFile(filename){
	window.location.href="/files/" + filename;
}

function downloadSetupFile(filename){

	GoogleConversationClick('1069634492');

	//window.location.href="/files/" + filename;
	window.open("http://www.availsuite.com/files/" + filename, "_blank", "height=200,width=200");
	window.location.href = "/subscribe/";
}

function downloadSetupFilePC(filename){

	GoogleConversationClick('1069634492');

	//window.location.href="/files/" + filename;
	window.open("http://www.availsuite.com/files/" + filename, "_blank", "height=200,width=200");
	window.location.href = "/pest-control/subscribe/";
}

function GoogleConversationClick(code){
	// Google Code for PageView Conversion Page
	googleImage = new Image(1,1);
	googleImage.src = "http://www.googleadservices.com/pagead/conversion/" + code + "/?value=1.0&label=PageView&script=0";
}

// ------ Product menu end

var NewWindow=null;

function ShowImage(ImgSource,ImgWidth,ImgHeight,Title,Text) { 
	var WinLeft=0, WinTop=0;

 	//window.status='Click Here';
   	//if (NewWindow) {
	//	NewWindow.close();
	//}

	WinLeft=new String((window.screen.availWidth-ImgWidth)/2);
	WinTop=new String((window.screen.availHeight-ImgHeight)/2);

	var WinAppearence = 'scrollbars=no,width='+(ImgWidth)+',height='+(ImgHeight)+',top='+WinTop+',left='+WinLeft;
	var Hypertext = '<html><head><title>'+ Title +'</title><base href="'+location.href+'"></head><body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" bgcolor="#ffffff"><img width="' + ImgWidth + '" height="' + ImgHeight + '" src="' + ImgSource + '" border="0" alt="' + Title + '"><p style="font-family: Arial; font-size: 12px;">'+ Text +'</body></html>';
	
   NewWindow=window.open( '','NewWindow'+Math.floor(Math.random() * 100),WinAppearence);
   NewWindow.document.writeln(Hypertext);
   NewWindow.focus();
}
function MM_openBrWindow(theURL,winName) { //v2.0
window.open(theURL,winName,'scrollbars=no,top=5,left=5,width=1000,height=700');
//,width=1000,height=700
}
