RE_NUMBER           = new RegExp(/^[0-9]+$/);
RE_EMAIL    = new RegExp(/^[A-Za-z0-9](([_|\.|\-]?[a-zA-Z0-9]+)*)@([A-Za-z0-9]+)(([_|\.|\-]?[a-zA-Z0-9]+)*)\.([A-Za-z]{2,})$/);
RE_NAME     = new RegExp(/[^A-Z^a-z^ ^\.\^]$/);
//onClick="if(addInquiry()){saveInquiry();return true;}else{ return false;}
var httpSaveInquiry      = getHTTPObject();

function getHTTPObject()
{
  var xmlhttp;

  if (!xmlhttp )
  {
    if(window.XMLHttpRequest) 
    {
    	try {
			      xmlhttp = new XMLHttpRequest();
          } 
          catch(e) {
			               xmlhttp = false;
                   }
     }
     else if(window.ActiveXObject)
     {
       	try {
        	    xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
      	    }
            catch(E) {
        	             try {
          		               xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        	                 } catch(e) {
          		                          xmlhttp = false;
        	                            }
				             }
     }
  
  }  
  
  return xmlhttp;
}
 
//======This function for select all  Field =======
function checkAll()
{
			
	var job_specialization_id = Array();
	
	var j=0;
	for(j; j<=chk_job_specialization_id; j++)
	{
		job_specialization_id[j] = document.getElementById('CHK'+j);
		 job_specialization_id[j].checked = true 
		
	}		
  
}
//=========End of checkAll()==========================

//======This function for checknone all  Field =======

function checknoneAll()
{
			
	var job_specialization_id = Array();
	
	var j=0;
	for(j; j<=chk_job_specialization_id; j++)
	{
		job_specialization_id[j] = document.getElementById('CHK'+j);
		 job_specialization_id[j].checked = false 
		
	}		
  
}
//=========End of checknoneAll()==========================



function setspecialization()
{
			
	var job_specialization_id = Array();
	var job_specializationStr ='';
	//var field_of_studyID ='';
	var j=0;
	for(j; j<=chk_job_specialization_id; j++)
	{
		job_specialization_id[j] = document.getElementById('CHK'+j);
		if ( job_specialization_id[j].checked )
		{
			  job_specializationStr += job_specialization_id[j].value+'|';
			 // field_of_studyID +='CHK'+j+",";
		}
	}
	job_specializationStr = job_specializationStr.substr(0,job_specializationStr.length-1);	
	
	document.advancesearch.selected_specialization.value=job_specializationStr;		
  
}//=========End of setadvancesearch()==================

function setPositionLevel()
{
			
	var position_level = Array();
	var position_levelStr ='';
	//var field_of_studyID ='';
	var j=1;
	for(j; j<=6; j++)
	{
		position_level[j] = document.getElementById('position_level'+j);
		if ( position_level[j].checked )
		{
			  position_levelStr += position_level[j].value+'|';
			 // field_of_studyID +='CHK'+j+",";
		}
	}
	position_levelStr = position_levelStr.substr(0,position_levelStr.length-1);	
	
	document.advancesearch.selected_position_level.value=position_levelStr;		
  
}//=========End of setadvancesearch()==========================

//===================START===setExperienceYear=======================



function setExperienceYear()
{
			
	var experience_min = Array();
	var experience_minStr ='';
	//var field_of_studyID ='';
	var j=1;
	for(j; j<=6; j++)
	{
		experience_min[j] = document.getElementById('experience_min'+j);
		if ( experience_min[j].selected )
		{
			 experience_minStr += experience_min[j].value+'|';
			 // field_of_studyID +='CHK'+j+",";
		}
	}
	experience_minStr = experience_minStr.substr(0,experience_minStr.length-1);	
	
	document.advancesearch.selected_Years_of_experience.value=experience_minStr;		
  
}
//==========================END=setExperienceYear=================================


//=================Start_setEmploymenttype====================
function setEmploymenttype()
{
			
	var employment_type = Array();
	var employment_typeStr ='';
	//var field_of_studyID ='';
	var j=1;
	for(j; j<=3; j++)
	{
		employment_type[j] = document.getElementById('employment_type'+j);
		if ( employment_type[j].checked )
		{
			  employment_typeStr += employment_type[j].value+'|';
			 // field_of_studyID +='CHK'+j+",";
		}
	}
	employment_typeStr = employment_typeStr.substr(0,employment_typeStr.length-1);	
	
	document.advancesearch.selected_employment_type.value=employment_typeStr;		
  
}//=========End_setEmploymenttype=====================

//=============================================
//=================Start_setEmploymenttype====================
function setEmploymenttype()
{
			
	var employment_type = Array();
	var employment_typeStr ='';
	//var field_of_studyID ='';
	var j=1;
	for(j; j<=3; j++)
	{
		employment_type[j] = document.getElementById('employment_type'+j);
		if ( employment_type[j].checked )
		{
			  employment_typeStr += employment_type[j].value+'|';
			 // field_of_studyID +='CHK'+j+",";
		}
	}
	employment_typeStr = employment_typeStr.substr(0,employment_typeStr.length-1);	
	
	document.advancesearch.selected_employment_type.value=employment_typeStr;		
  
}//=========End_setEmploymenttype=====================
//==========Start_setLocationtype==========
function setLocation()
{
			
	var location = Array();
	var locationStr ='';
	//var field_of_studyID ='';
	var j=1;
	for(j; j<=6; j++)
	{
		location[j] = document.getElementById('location'+j);
		if ( location[j].checked )
		{
			  locationStr += location[j].value+'|';
			 // field_of_studyID +='CHK'+j+",";
		}
	}
	locationStr = locationStr.substr(0,locationStr.length-1);	
	
	document.advancesearch.selected_location.value=locationStr;
}
//===========End_setLocationtype===========


//=============================================
//========advanceSearch============
function advanceSearch()
{  
   setspecialization(); 
   setPositionLevel();
   setEmploymenttype();
   setLocation();
   setExperienceYear();
}

//======End advanceSearch ==========
function cancelEmployer()
{
	window.location=CANCEL_URL;
}

function Trim(TRIM_VALUE){
if(TRIM_VALUE.length < 1){
return"";
}
TRIM_VALUE = RTrim(TRIM_VALUE);
TRIM_VALUE = LTrim(TRIM_VALUE);
if(TRIM_VALUE==""){

return "";
}

else{
return TRIM_VALUE;
}
} //End Function

function RTrim(VALUE){
var w_space = String.fromCharCode(32);
var v_length = VALUE.length;
var strTemp = "";
if(v_length < 0){
return"";
}
var iTemp = v_length -1;

while(iTemp > -1){
if(VALUE.charAt(iTemp) == w_space){
}
else{
strTemp = VALUE.substring(0,iTemp +1);
break;
}
iTemp = iTemp-1;

} //End While
return strTemp;

} //End Function

function LTrim(VALUE){
var w_space = String.fromCharCode(32);
if(v_length < 1){
return"";
}
var v_length = VALUE.length;
var strTemp = "";

var iTemp = 0;

while(iTemp < v_length){
if(VALUE.charAt(iTemp) == w_space){
}
else{
strTemp = VALUE.substring(iTemp,v_length);
break;
}
iTemp = iTemp + 1;
} //End While
return strTemp;
} //End Function