<!--
// this page will going to store the commonly use javascript functions.

function trim(strText) { 
    // this will get rid of leading spaces 
    while (strText.substring(0,1) == ' ') 
        strText = strText.substring(1, strText.length);

    // this will get rid of trailing spaces 
    while (strText.substring(strText.length-1,strText.length) == ' ')
        strText = strText.substring(0, strText.length-1);

   return strText;
} 

function Bustframe(){
	if (self != top) {
	top.location = self.location
	}
}

function setCookieString(strText){
	strText += "; path=/;" 
    document.cookie = strText;
}
function VSelectLength(fLength){ //this func validates how may records has been selected
	if (fLength == 0) {fLength = 10}
	var k=0;

	if (!bestselect.fid.length){	//(!undefined) will evalue to true
		var numclients=1;
		if (bestselect.fid.checked) k=1;
	}else{
		var numclients=bestselect.fid.length;	
		for (var n=0; n<numclients; n++){
			if(bestselect.fid[n].checked) k=k+1;
		}
	}

	if (k>fLength){
		alert("You have selected " + k + '-- Please limit your selection to maximum of '+ fLength + '.' );
		return false;
		}
	else if(k==0){
		alert("Please select at least one listing...");
		return false;
		}
	return true;
}

function pageOffset() {
    if (document.layers) {
        document.layers['layerName'].pageX = window.pageXOffset + 599;
        document.layers['layerName'].pageY = window.pageYOffset + 115;
    }
    else if (document.all) {
        document.all['layerName'].style.posLeft = document.body.scrollLeft + 599;
        document.all['layerName'].style.posTop = document.body.scrollTop + 115;
    }
    setTimeout('pageOffset()',100);
}


function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function ValidateGenform(){
	var theform=document.formSelect
	if (theform.selcapital.value == "") {
		 theform.selcapital.value = "0"
		} 
	if (theform.selindustry.value == "") {
		 theform.selindustry.value = "0"
		} 	 
	if ((theform.selcapital.value == "0" ) || (theform.selindustry.value == "0" ))  { 
		alert("Please select an industry and an investment range for better results.");
		theform.selcapital.focus();  
		return false;  
	}
	else
		return true; 
}

function reloadCaptchaImage()
{
	var rnum = parseInt(Math.random()*10);
	img = document.getElementById('Captcha'); 
	var newImgName = img.src +  "&rnum="+rnum;
	img.src = newImgName;
}
function bgchbxcolor(checkbox) {
	tr = checkbox.parentNode.parentNode;
	tr.style.backgroundColor = (checkbox.checked) ? "#483d95" : "#898989";
}
function InitiatePageRefresh()
{
	var sURL = unescape(window.location.pathname);
	window.location.href = sURL;
}
function showHide(ID) {

	var theseDivs = document.getElementById(ID).childNodes;
	for(var j=1; j<theseDivs.length;j++) {
		if(theseDivs[j].className=='tab_inner') {
			if(theseDivs[j].style.display=="block")  {
			theseDivs[j].style.display="none";
			document.getElementById(ID).firstChild.style.backgroundImage='url(/images/plus.gif)';
			}
		else  {
			theseDivs[j].style.display="block";
			document.getElementById(ID).firstChild.style.backgroundImage='url(/images/minus.gif)';
			}
		}
	}
}
function verifygen(button)	{
	var formhere=document.frmLeads
	{
		button.value = 'Please Wait';
		button.disabled = true;
		//return true;
		formhere.submit();
	}
}	
function showProvince(theProvince) {
var province = document.getElementById("prov");
//alert(theProvince.options[theProvince.selectedIndex].value);
	if (theProvince.options[theProvince.selectedIndex].value != "203") {
	province.style.display = "";
	}
	else {
	province.value="";
	province.style.display = "none";
	}
}				
-->