// JavaScript Document selBusinessCategory
function checkCategoryForm()
{
	    with (window.document.frmCategory) {
		if (isEmpty(txtName, 'Enter First name')) {
			return false;
		} else if (isEmpty(txtLName, 'Enter Last name')) {
			return false;
		}  else if (isEmpty(txtEmail, 'Enter Email ID')) {
			return false;
		}  else if ((txtEmail.value!="") && (echeck(txtEmail.value)==false)) {
			txtEmail.value="";
			txtEmail.focus();
			return false; 
		} else if (isEmpty(txtDesi, 'Enter Job Title/Designation')) {
			return false;
		}  else if (isEmpty(txtCom, 'Enter Company Name')) {
			return false;
		} else if (SelectAnnual.selectedIndex == 0) {
			alert('Company Annual Revenue');
			SelectAnnual.focus();
			return false;
		} else if (SelectCountry.selectedIndex == 0) {
			alert('Select SelectCountry');
			SelectCountry.focus();
			return false;
		} else if (SelectRelationship.selectedIndex == 0) {
			alert('Select Relationship');
			SelectRelationship.focus();
			return false;
	   }  else if ((txtPhoneNo.value!="") && (numeric(txtPhoneNo.value)==false)) {
	    	txtPhoneNo.value="";
			txtPhoneNo.focus();
			return false; 
		} else if (isEmpty(txtDis, 'Please describe the need what you are interested in')) {
			return false;
		} else if (txtcaptcha.value=="") {
		 alert('Enter the captcha value');
		 txtcaptcha.focus();
			return false;
		} else  {
		 submit();
		}
		return true;
	}
}

function validate()
{

	    with (window.document.career) {
	    var VideoForm=document.getElementById('<%= FileUpload2.ClientID %>');
		if (isEmpty(txtFirstName, 'Enter First name')) {
			return false;
		} else if (isEmpty(txtLastName, 'Enter Last name')) {
			return false;
		}  else if (isEmpty(txtEmail, 'Enter Email ID')) {
			return false;
        }  else if ((txtEmail.value!="") && (echeck(txtEmail.value)==false)) {
			txtEmail.value="";
			txtEmail.focus();
			return false; 	
		} else if (cboBaseCountry.selectedIndex == 0) {
			alert('Enter Country Applying from ');
			cboBaseCountry.focus();
			return false;
		} else if (cboDate.selectedIndex == 0) {
			alert('Select Date');
			cboDate.focus();
			return false;
		} else if (cboMonth.selectedIndex == 0) {
			alert('Select Month');
			cboMonth.focus();
			return false;
		}  else if (cboYear.selectedIndex == 0) {
			alert('Select Date');
			cboYear.focus();
			return false;
		} else if (cboITExperienceYears.selectedIndex == 0) {
			alert('Select Total IT Work Experience Year');
			cboITExperienceYears.focus();
			return false;
		} else if (cboITExperienceMonths.selectedIndex == 0) {
			alert('Select  Total IT Work Experience Month');
			cboITExperienceMonths.focus();
			return false;
		} else if (cboNonITExperienceYears.selectedIndex == 0) {
			alert('Select Non-IT Work Experience in year');
			cboNonITExperienceYears.focus();
			return false;
		} else if (cboNonITExperienceMonths.selectedIndex == 0) {
			alert('Select Non-IT Work Experience in Month');
			cboNonITExperienceMonths.focus();
			return false;
		} else if (cboHighestEducationalQualification.selectedIndex == 0) {
			alert('Select Highest Educational Qualification');
			cboHighestEducationalQualification.focus();
			return false;
		} else if (isEmpty(txtQualificationTitle, 'Enter Qualification Title')) {
			return false; 
		}  else if (isEmpty(txtAddress1, 'Enter Address1')) {
			return false; 
		} else if (cboContactCountry.selectedIndex == 0) {
			alert('Select Country');
			cboContactCountry.focus();
			return false;
		}  else if (isEmpty(txtState, 'Enter State')) {
			return false;
		}  else if (isEmpty(txtPostalCode, 'Enter Postal Code/Zip Code')) {
			return false;
		}  else if ((txtPostalCode.value!="") && (pincode(txtPostalCode.value)==false)) {
	    	txtPostalCode.value="";
			txtPostalCode.focus();
			return false; 
		} else if (cboDayCountry.selectedIndex == 0) {
			alert('Select country');
			cboDayCountry.focus();
			return false;	
		}  else if (isEmpty(txtDayAreaCode, 'Enter Area Code')) {
			return false;	
		}  else if ((txtDayAreaCode.value!="") && (areacode(txtDayAreaCode.value)==false)) {
	    	txtDayAreaCode.value="";
			txtDayAreaCode.focus();
			return false; 	
		}  else if (isEmpty(txtDayNumber, 'Enter Phone no.')) {
			return false;	
		}  else if ((txtDayNumber.value!="") && (numeric(txtDayNumber.value)==false)) {
	    	txtDayNumber.value="";
			txtDayNumber.focus();txtMobile
			return false; 	
		}  else if ((txtMobile.value!="") && (numeric(txtMobile.value)==false)) {
	    	txtMobile.value="";
			txtMobile.focus();
			return false; 
		} else if (isEmpty(FileUpload2, 'Please Attach Resume')) {
	     return false;
		} else if ((FileUpload2.value!="") && (resume(FileUpload2.value)==false)) {
	    	FileUpload2.value="";
			FileUpload2.focus();
			return false; 
		} else if (txtcaptcha.value=="") {
		 alert('Enter the captcha value');
		 txtcaptcha.focus();
			return false;
		} else  {
			submit();
		}
		return true;
	}
}
function resume(txtvalue)
{

var VideoForm=txtvalue; //document.getElementById('<%= FileUpload2.ClientID %>');

			if ( VideoForm == "" )
			{
				alert( "Please select your Image file." );
				return false;
			}
			var     extPos = VideoForm.lastIndexOf( "." );
//			alert(extPos);
            if ( extPos == - 1)
            {
                alert( "Only .doc or .docx files can be upload." );
				return false;
			}
            else
            {
				var extn =  VideoForm.substring(
					extPos + 1, VideoForm.length );
				if ( extn != "doc" && extn != "docx" )
				{
                	alert( "Only .doc or .docx files can be upload." );
					return false;
				}
			}
}
function addCategory()
{
	targetUrl = 'index.php?view=add';
	window.location.href = targetUrl;
}

function modifyCategory(id)
{
	window.location.href = 'index.php?view=modify&id=' + id;
}

function deleteCategory(id)
{
	if (confirm('Delete this record.\nAre you sure?')) {
		window.location.href = 'process.php?action=delete&id=' + id;
	}
}

function doSpeciesDiv()
{
	document.getElementById("select_container").style.visibility='visible';
}

function doProductServicesDiv()
{
	document.getElementById("select_containerps").style.visibility='visible';
}
function close1()
{
	document.getElementById("select_containerps").style.visibility='hidden';
}

function close()
{
	document.getElementById("select_container").style.visibility='hidden';
}


function setHtype(str)
{
  document.getElementById("hType").value=str;
  if(str=='Scientific') {
	  document.getElementById("tradeTab").style.display="none";
	  document.getElementById("scientificTab").style.display="block";
  }
   if(str=='Trade') {
	   document.getElementById("scientificTab").style.display="none";
	  document.getElementById("tradeTab").style.display="block";
  } 
   close();
}



function stateChangedSpecies() 
{ if (xmlHttp.readyState==4){ 
document.getElementById("a1").innerHTML=xmlHttp.responseText;
}
}

function setSpecies(str,sln)
{
var selId=document.getElementById("txtSpecies").value;
var selIdTrade=document.getElementById("txtTrade").value;

xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="selSpecies.php";
url=url+"?id="+str;
url=url+"&selid="+selId;
url=url+"&selIdTrade="+selIdTrade;
url=url+"&slnid="+sln;
url=url+"&type=1";
url=url+"&sid="+Math.random();
//alert(url);
xmlHttp.onreadystatechange=stateChangedSpecies;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function removeSpecies(str,sln)
{
var selId=document.getElementById("txtSpecies").value;
var selIdTrade=document.getElementById("txtTrade").value;

xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="selSpecies.php";
url=url+"?id="+str;
url=url+"&selid="+selId;
url=url+"&selIdTrade="+selIdTrade;
url=url+"&slnid="+sln;
url=url+"&type=2";
url=url+"&sid="+Math.random();
//alert(url);
xmlHttp.onreadystatechange=stateChangedSpecies1;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
function stateChangedSpecies1() 
{ if (xmlHttp.readyState==4){ 
document.getElementById("a1").innerHTML=xmlHttp.responseText;
}
}

////
function stateChangedPS1() 
{ if (xmlHttp.readyState==4){ 
document.getElementById("a2").innerHTML=xmlHttp.responseText;
}
}

function setPS(str)
{
var selId=document.getElementById("selProductServices").value;

xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="selPS.php";
url=url+"?id="+str;
url=url+"&selid="+selId;
url=url+"&type=1";
url=url+"&sid="+Math.random();
//alert(url);
xmlHttp.onreadystatechange=stateChangedPS1;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
///////
function stateChangedPS2() 
{ if (xmlHttp.readyState==4){ 
document.getElementById("a2").innerHTML=xmlHttp.responseText;
}
}

function removePS(str)
{
var selId=document.getElementById("selProductServices").value;

xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="selPS.php";
url=url+"?id="+str;
url=url+"&selid="+selId;
url=url+"&type=2";
url=url+"&sid="+Math.random();
//alert(url);
xmlHttp.onreadystatechange=stateChangedPS2;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

		