function quick_search()
{
	
	var FunctArea = document.quickSearch.USER_SEARCH_FUNCTIONAL_ID.value;
	var Keyword =  document.quickSearch.USER_SEARCH_KEYWORD.value;
	if(FunctArea=="" && Keyword=="")
	{
	 alert("Please specify either Functional Area or Keywords to search jobs");
	 document.quickSearch.USER_SEARCH_KEYWORD.focus();
      return false;
	}
	return true;	
}
function edit_quick_search()
{
	
	var FunctArea = document.EditQuickSearch.USER_SEARCH_FUNCTIONAL_ID.value;
	var Keyword =  document.EditQuickSearch.USER_SEARCH_KEYWORD.value;
	var SavedName =  document.EditQuickSearch.USER_SEARCH_NAME.value;	
	if(SavedName=="")
	{
	 alert("Please specify the name of the search agent");
	 document.EditQuickSearch.USER_SEARCH_NAME.focus();
      return false;
	}	
	if(FunctArea=="" && Keyword=="")
	{
	 alert("Please specify either Functional Area or Keywords to search jobs");
	 document.EditQuickSearch.USER_SEARCH_KEYWORD.focus();
      return false;
	}
	return true;
}
function adv_search()
{
	
	var FunctArea = document.advSearch.USER_SEARCH_FUNCTIONAL_ID.value;
	var Keyword =  document.advSearch.USER_SEARCH_KEYWORD.value;
	var Industry =  document.advSearch.USER_SEARCH_INDUSTRY_ID.value;	
	if(FunctArea=="" && Keyword=="" && Industry=="")
		{
		 alert("Please specify either Industry type or Functional Area or Keywords or Country to search jobs");
		 document.advSearch.USER_SEARCH_KEYWORD.focus();
		  return false;
		}
		return true;	
	}
function edit_adv_search()
{
	
	var FunctArea = document.EditAdvSearch.USER_SEARCH_FUNCTIONAL_ID.value;
	var Keyword =  document.EditAdvSearch.USER_SEARCH_KEYWORD.value;
	var Industry =  document.EditAdvSearch.USER_SEARCH_INDUSTRY_ID.value;
	var SavedName =  document.EditAdvSearch.USER_SEARCH_NAME.value;	
	if(SavedName=="")
	{
	 alert("Please specify the name of the search agent");
	 document.EditAdvSearch.USER_SEARCH_NAME.focus();
      return false;
	}	
	if(FunctArea=="" && Keyword=="" && Industry=="")
	{
	 alert("Please specify either Industry type or Functional Area or Keywords to search jobs");
	 document.EditAdvSearch.USER_SEARCH_KEYWORD.focus();
      return false;
	}
	return true;	
}
function role_search()
{
	var FunctArea = document.roleSearch.USER_SEARCH_FUNCTIONAL_ID.value;
	if(FunctArea=="")
	{
	 alert("Please select Functional Area");
      return false;
	}
	return true;	
}
function edit_role_search()
{
	
	var FunctArea = document.EditRoleSearch.USER_SEARCH_FUNCTIONAL_ID.value;
	var SavedName =  document.EditRoleSearch.USER_SEARCH_NAME.value;	
	if(SavedName=="")
	{
	 alert("Please specify the name of the search agent");
	 document.EditRoleSearch.USER_SEARCH_NAME.focus();
      return false;
	}	
	if(FunctArea=="")
	{
	 alert("Please select Functional Area");
      return false;
	}
	return true;	
}

function validate_roles()
{
	  var docF=document.listRoles;
	  var element1,element2;
	  elements2 =0;
     for(var x1=0;x1<docF.elements.length;x1++)
	{
		if(docF.elements[x1].type=='checkbox')
		{
		  if(docF.elements[x1].checked)
		   elements2 =elements2 + 1;
		}
	}
	if(elements2 ==0)
	{
	alert("Please select a Role(s) in order to view search results");
	return false;
	}
	else if(elements2 > 7)
	{
	alert("You can select a maximum of 7 roles at one time");
	return false;
	}
	return true;
	
}

 function setRole(role_id){
		var theform;
		if (window.navigator.appName.toLowerCase().indexOf("microsoft") > -1)
		{
			theform = document.searchForm;
		}
		else
		{
			theform = document.forms["searchForm"];
		}
		theform.COL_ID.value =''
		theform.ORD_ID.value = '';
		theform.OFF_SET.value = '';
		theform.USER_SEARCH_ROLES_ID.value = role_id;
		theform.submit();
		
 }
 
  function setIndustry(industry_id){
		var theform;
		if (window.navigator.appName.toLowerCase().indexOf("microsoft") > -1)
		{
			theform = document.searchForm;
		}
		else
		{
			theform = document.forms["searchForm"];
		}
		theform.COL_ID.value =''
		theform.ORD_ID.value = '';
		theform.OFF_SET.value = '';
		theform.USER_SEARCH_INDUSTRY_ID.value = industry_id;
		theform.submit();
		
 }
 
 function resetIndustry(){
		var theform;
		if (window.navigator.appName.toLowerCase().indexOf("microsoft") > -1) {
			theform = document.searchForm;
		}
		else {
			theform = document.forms["searchForm"];
		}
		theform.COL_ID.value = '';
		theform.ORD_ID.value = '';
		theform.OFF_SET.value = '';
		theform.USER_SEARCH_INDUSTRY_ID.value = '';
		theform.submit();
		
 }
 
  function resetRole(){
		var theform;
		if (window.navigator.appName.toLowerCase().indexOf("microsoft") > -1) {
			theform = document.searchForm;
		}
		else {
			theform = document.forms["searchForm"];
		}
		theform.COL_ID.value = '';
		theform.ORD_ID.value = '';
		theform.OFF_SET.value = '';
		theform.USER_SEARCH_ROLES_ID.value = '';
		theform.submit();
		
 }
 function hot_jobs(){
		var theform;
		if (window.navigator.appName.toLowerCase().indexOf("microsoft") > -1) {
			theform = document.hotJobs;
		}
		else {
			theform = document.forms["hotJobs"];
		}
		theform.submit();		
 }
  function form_submit(){
		var theform;
		if (window.navigator.appName.toLowerCase().indexOf("microsoft") > -1) {
			theform = document.FreeRegister;
		}
		else {
			theform = document.forms["FreeRegister"];
		}
		theform.submit();		
 }
function confirm_delete()
{
var agree=confirm("Are you sure?");
if (agree)
	return true ;
else
	return false ;
}

function validate_apply(form_action)
{
	var docF=document.applyForm;
	docF.action=form_action;
	var element1,element2;
	elements2 =0;
    for(var x1=0;x1<docF.elements.length;x1++)
	{
		if(docF.elements[x1].type=='checkbox')
		{
		  if(docF.elements[x1].checked)
		   elements2 =elements2 + 1;
		}
	}
	if(elements2 ==0)
	{
	   alert("Please select atleast one job to apply");
	   return false;
	}
	docF.submit();	
} 

function free_resume_search()
{
	var FunctArea = document.freeResume.FUNCTIONAL_AREA_ID.value;
	if(FunctArea=="")
	{
	 alert("Please select Functional Area");
      return false;
	}
	return true;	
}