// JavaScript Document



function chkSmt(slctd)
{  
	if(document.frmSearch.searchtype.value=="People")
	{
		document.getElementById("companyDiv").style.display="none";
	}
	 
		if(slctd=="People")
	   {
			document.getElementById("companyDiv").style.display="none";
			document.getElementById("basicDiv").style.display="none";
			document.getElementById("ownerDiv").style.display="block";	 
			document.frmSearch.Owner.focus(); 
	   }
	   if(slctd=="Company")
	   {
			document.getElementById("ownerDiv").style.display="none";
			document.getElementById("companyDiv").style.display="block";
			document.getElementById("basicDiv").style.display="none";
			document.frmSearch.Company.focus(); 
	   }
	   if(slctd=="Basic")
	   {
			document.getElementById("ownerDiv").style.display="none";
			document.getElementById("companyDiv").style.display="none";
			document.getElementById("basicDiv").style.display="block";
			document.frmSearch.firstName.focus(); 
	   }
		 
}


 function frmgetListedValidate()
 {
	if(document.frmEditUsers.txtLoginUsername.value=="")
			 { 
				alert("Please enter your Username");
				return false;
			 }
			else if(document.frmEditUsers.txtLoginPassword.value=="")
			{
				alert("Please enter your Password");
				return false;
			}
			else if(document.frmEditUsers.txtUsersNewCompany.value=="" && document.frmEditUsers.txtUsersCompany.selectedIndex==false)
			{
				alert("Please select either Company or enter your Company name");
				return false;
			}
			else if(document.frmEditUsers.txtUsersName.value=="")
			{
				alert("Please enter your Name");
				return false;
			}
			 else {
			  return true;
		     } 
			
}

function frmfrogotPasswordValidate()
{
	if(validateForm(document.frmUserLogin,false,false,false,false))
	 { 
	 	
	 }else{
		 return false;
	 }
}

 function frmsignUpValidate()
 {
			 if(document.frmEditUsers.txtUsersNewCompany.value=="" && document.frmEditUsers.txtUsersCompany.selectedIndex==false)
			{
				alert("Please select either Company or enter your Company name");
				return false;
			}
			 /*if(document.frmEditUsers.txtUsersNewCompany1.value=="" && document.frmEditUsers.txtUsersCompany1.selectedIndex==false)
			{
				alert("Please select either Previously with 1 or enter your Company name");
				return false;
			}
			 if(document.frmEditUsers.txtUsersNewCompany2.value=="" && document.frmEditUsers.txtUsersCompany2.selectedIndex==false)
			{
				alert("Please select either Previously with 2 or enter your Company name");
				return false;
			}
			 if(document.frmEditUsers.txtUsersNewCompany3.value=="" && document.frmEditUsers.txtUsersCompany3.selectedIndex==false)
			{
				alert("Please select either Previously with 3 or enter your Company name");
				return false;
			}*/
			 if(validateForm(document.frmEditUsers,false,false,false,false))
			 { 
						 	
			 }else{
				return false;
		     } 
			
}


function chk(elementSel)
{ 
	document.getElementById(elementSel).disabled=true;
}
function chk1(elementSel)
{
	document.getElementById(elementSel).disabled=false;
}

  function showNext(ch)
  {  
		if(document.getElementById('prevCompany2').style.display=="none")	
	  { document.getElementById('prevCompany2').style.display='block';} else if(document.getElementById('prevCompany3').style.display=="none")
	  { document.getElementById('prevCompany3').style.display="block"; document.getElementById('addAnother').style.display="none";  }		 
  }
  function showNextE()
  {
		if(document.getElementById('preEdu2').style.display=="none")	
	  { document.getElementById('preEdu2').style.display='block'; } else if(document.getElementById('preEdu3').style.display=="none")
	  { document.getElementById('preEdu3').style.display="block"; document.getElementById('addEdu').style.display="none";  }	
  }
  
function chkForm()
{
	if(document.frmSearch.Company.value!="")
	{
		if(document.frmSearch.Company.value.search("^([a-zA-Z0-9])"))
		{
			alert("Only alpha-numeric characters allowed !!");
			return false;
		} 
	}
	 if(document.frmSearch.Owner.value!="")
	{
		if(document.frmSearch.Owner.value.search("^([a-zA-Z0-9])"))
		{
			alert("Only alpha-numeric characters allowed !!");
			return false;
		} 
	}
	 if(document.frmSearch.firstName.value!="")
	{
		if(document.frmSearch.firstName.value.search("^([a-zA-Z0-9])"))
		{
			alert("Only alpha-numeric characters allowed !!");
			return false;
		} 
	}
	  if(document.frmSearch.lastName.value!="")
	{
		if(document.frmSearch.lastName.value.search("^([a-zA-Z0-9])"))
		{
			alert("Only alpha-numeric characters allowed !!");
			return false;
		} 
	}
	 if(document.frmSearch.coName.value!="")
	{
		if(document.frmSearch.coName.value.search("^([a-zA-Z0-9])"))
		{
			alert("Only alpha-numeric characters allowed !!");
			return false;
		} 
	}
	  if(document.frmSearch.focus.value!="")
	{
		if(document.frmSearch.focus.value.search("^([a-zA-Z0-9])"))
		{
			alert("Only alpha-numeric characters allowed !!");
			return false;
		} 
	}
	  if(document.frmSearch.aquire.value!="")
	{
		if(document.frmSearch.aquire.value.search("^([a-zA-Z0-9])"))
		{
			alert("Only alpha-numeric characters allowed !!");
			return false;
		} 
	}
	 if(document.frmSearch.divest.value!="")
	{
		if(document.frmSearch.divest.value.search("^([a-zA-Z0-9])"))
		{
			alert("Only alpha-numeric characters allowed !!");
			return false;
		} 
	}
	  if(document.frmSearch.city.value!="")
	{
		if(document.frmSearch.city.value.search("^([a-zA-Z0-9])"))
		{
			alert("Only alpha-numeric characters allowed !!");
			return false;
		} 
	}
	  if(document.frmSearch.sports.value!="")
	{
		if(document.frmSearch.sports.value.search("^([a-zA-Z0-9])"))
		{
			alert("Only alpha-numeric characters allowed !!");
			return false;
		} 
	}
	 
}
function showTags(tags)
{
	if(tags=="focus")
	{
		document.getElementById("focusTab").style.display="block";		
		document.getElementById("interestTab").style.display="none";
	}
	else if(tags=="interest")
	{
		document.getElementById("focusTab").style.display="none";
		document.getElementById("interestTab").style.display="block";
	}
}
  
  
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++)
    	{ 
			d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];
		}
	}
}

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_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  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];}
}

	function loginSbmt()
	{
		if(document.frmLogin.log_username.value=="")
		{
			alert("Please enter Username");
			document.frmLogin.log_username.focus();
			return false;
		}
		else if(document.frmLogin.log_password.value=="")
		{
			alert("Please enter Password");
			document.frmLogin.log_password.focus();
			return false;
		}else { return true; }
	}
