//General Functions
var dtCh= "/";
var minYear=1900;
var maxYear=2100;

//var sitePath = "projects/1site/";
//var sitePath = "/1site/";
var sitePath = "/1siteJobs/";
//var sitePath= "http://74.53.226.242/1siteJobs/";

function CheckEmpty(Val,Label) 
{ 
  if(truncateSpace(Val)=="") 
  {
   alert(Label+" Should Not be Empty") 
   return false;
  } 
  return true;
}
function CheckEmpty1(Val,Label) 
{ 
  if(truncateSpace(Val)=="") 
  {
   alert(Label+" Should Not be Selected") 
   return false;
  } 
  return true;
}
function CheckEmpty2(Val) 
{ 
  if(truncateSpace(Val)=="") 
  {
   return false;
  } 
  return true;
}

function CheckEmptyMsg(Val,Label) 
{ 
  if(truncateSpace(Val)=="") 
  {
   alert("Please enter "+Label) 
   return false;
  } 
  return true;
}

function radiobuttonchecked(val1,val2,Label)
      {
         
        if(val1.checked == false && val2.checked == false)
	{
		alert("Please select "+ Label);
		return false;
	}
          return true;

         }


function dropdownselected(val1,Label)
      {
         
        if(val1.selected == false || val1.value == "" || val1.value=="select")
	{
		alert("Please select "+ Label);
		return false;
	}
          return true;

         }
		 
		 function Checkcompare(val1,val2,Label) 
{ 
  if(val2 !=val1) 
  {
   alert(Label+" do not match"); 
   return false;
  } 
  return true;
}

function IsAmount(sText)
{
   var ValidChars = "0123456789.";
   var IsAmount=true;
   var Char;
   if(sText=="") return false
   for (i = 0; i < sText.length && IsAmount == true;i++) 	
   { 
		 Char = sText.charAt(i); 
		 if (ValidChars.indexOf(Char) == -1) 
         {
    	     IsAmount = false;
         }
   }
   return IsAmount;
}
function IsValidAmount(sText,Label)
{
	if(!IsAmount(sText))
	{
		alert("Invalid "+Label+".. "+Label+" Must Have Numeric Values")
		return false;
	}
	AmtArray = sText.split(".")
	if(AmtArray.length>2)
	{
		alert("Invalid "+Label+".. "+Label+" Must have single Period for Float")
		return false;
	}
	if(AmtArray.length>1)
	{
		FloatAmt = AmtArray[1];
		if(FloatAmt.length>2)
		{
			alert("Invalid "+Label+"..  Float Value must have two Digits")
			return false;
		}
	}
	return true
}


function CheckNumber(sText,Label)
{
   var ValidChars = "0123456789";
   var IsNumber=true;
   var Char;
   if(sText=="") {alert(Label+ " Should not be Empty");return false}
   for (i = 0; i < sText.length && IsNumber == true;i++) 
   { 
      Char = sText.charAt(i); 
      if(ValidChars.indexOf(Char) == -1) 
      {
         IsNumber = false;
      }
   }
   if(!IsNumber)
   	alert(Label+ " Must Be numeric")
   return IsNumber;
}

function truncateSpace(Val) 
{ 
 	while(''+Val.charAt(0)==' ') 
   	Val=Val.substring(1,Val.length); 
   	return Val 
}  
function trim(Val) 
{ 
 	while(''+Val.charAt(0)==' ') 
   	Val=Val.substring(1,Val.length); 
   	return Val 
}  

function isInteger(s)
{
	var i;
    for (i = 0; i < s.length; i++){   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}
function IsFax(sText,Label)
{
   var ValidChars = "0123456789-()+* ";
   var IsNumber=true;
   var Char;
   if(sText=="") {alert("Please specify a "+Label);return false}
   for (i = 0; i < sText.length && IsNumber == true; i++) 
   { 
      Char = sText.charAt(i); 
      if(ValidChars.indexOf(Char) == -1) 
      {
         IsNumber = false;
      }
   }
   if(!IsNumber)
   	alert("Please check the "+Label+ " you have entered.  Characters other than 0-9 and (), not allowed")
   return IsNumber;
}

function stripCharsInBag(s, bag){
	var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++){   
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}
function IsPasswordLength(sPass1,sPass2)
{
	if(trim(sPass1)=="")
	{
		alert("Password Should Not be Empty")
		return false
	}
	
	if(sPass1!=sPass2)
	{
		alert("Password Mismatch")
		return false
	}
	return true;
}
function IsValidURL(strURL,n)
{
		strURL 		= strURL.toUpperCase();
//		alert(strURL)		
		if(strURL==""||strURL=="HTTP://") return false	
		thePrefix 	= strURL.substr(0,7).toUpperCase();
		var Prefix2 = strURL.substr(0,8).toUpperCase();
		if( thePrefix!="HTTP://" )
		{ 
			siteFlag = 0;
			return false;
		}
		else
			siteFlag = 1;	
		if ( Prefix2!="HTTPS://" && siteFlag == 0 ) 
			return false;
		if(n!=-1) if(strURL.split("/").length>n) 
			return false;
		
		return true;
}
function CheckEmailAddr(email)
{
  var result = false;
  var theStr = new String(email);
  var index = theStr.indexOf("@");
  if (index > 0)
  {
    var pindex = theStr.indexOf(".",index);
    if ((pindex > index+1) && (theStr.length > pindex+1))
	result = true;
  }
  return result;
}

function daysInFebruary (year)
{
	// February has 29 days in any year evenly divisible by four,
    // EXCEPT for centurial years which are not also divisible by 400.
    return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}
function DaysArray(n) 
{
	for (var i = 1; i <= n; i++) {
		this[i] = 31
		if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
		if (i==2) {this[i] = 29}
   } 
   return this
}
function isDate(dtStr,Label)//mm/dd/yyyy
{
	var daysInMonth = DaysArray(12)
	var pos1=dtStr.indexOf(dtCh)
	var pos2=dtStr.indexOf(dtCh,pos1+1)
	var strDay=dtStr.substring(0,pos1)
	var strMonth=dtStr.substring(pos1+1,pos2)
	var strYear=dtStr.substring(pos2+1)
	strYr=strYear
	if (strDay.charAt(0)=="0" && strDay.length>1) 
		strDay=strDay.substring(1)
	if (strMonth.charAt(0)=="0" && strMonth.length>1) 
		strMonth=strMonth.substring(1)
	for (var i = 1; i <= 3; i++) 
	{
		if (strYr.charAt(0)=="0" && strYr.length>1) 
		   strYr=strYr.substring(1)
	}
	month=parseInt(strDay)
	day=parseInt(strMonth)
	year=parseInt(strYr)
	if (pos1==-1 || pos2==-1)
	{
		alert("The date format should be : mm/dd/yyyy for "+Label)
		return false
	}
	if (strMonth.length<1 || month<1 || month>12)
	{
		alert("Please enter a valid month for "+Label+"\nDate Format is mm/dd/yyyy")
		return false
	}
	if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month])
	{
		alert("Please enter a valid day for "+Label+"\nDate Format is mm/dd/yyyy")
		return false
	}
	if (strYear.length != 4 || year==0 || year<minYear || year>maxYear)
	{
		alert("Please enter a valid 4 digit Year ");// between "+minYear+" and "+maxYear+" for "+Label+"\nDate Format is mm/dd/yyyy")
		return false
	}
	if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false)
	{ 
		alert("Please enter a valid date for "+Label+"\nDate Format is mm/dd/yyyy")
		return false
	}
	return true
}
function isDateTwo(dtStr,Label)//mm/dd/yyyy
{
	var daysInMonth = DaysArray(12)
	var pos1=dtStr.indexOf(dtCh)
	var pos2=dtStr.indexOf(dtCh,pos1+1)
	var strDay=dtStr.substring(pos1+1,pos2)
	var strMonth=dtStr.substring(0,pos1)
	var strYear=dtStr.substring(pos2+1)
	strYr=strYear
	if (strDay.charAt(0)=="0" && strDay.length>1) 
		strDay=strDay.substring(1)
	if (strMonth.charAt(0)=="0" && strMonth.length>1) 
		strMonth=strMonth.substring(1)
	for (var i = 1; i <= 3; i++) 
	{
		if (strYr.charAt(0)=="0" && strYr.length>1) 
		   strYr=strYr.substring(1)
	}
	month=parseInt(strDay)
	day=parseInt(strMonth)
	year=parseInt(strYr)
	if (pos1==-1 || pos2==-1)
	{
		alert("The date format should be : dd/mm/yyyy for "+Label)
		return false
	}
	if (strMonth.length<1 || month<1 || month>12)
	{
		alert("Please enter a valid month for "+Label+"\nDate Format is dd/mm/yyyy")
		return false
	}
	if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month])
	{
		alert("Please enter a valid day for "+Label+"\nDate Format is dd/mm/yyyy")
		return false
	}
	if (strYear.length != 4 || year==0 || year<minYear || year>maxYear)
	{
		alert("Please enter a valid 4 digit Year ");// between "+minYear+" and "+maxYear+" for "+Label+"\nDate Format is mm/dd/yyyy")
		return false
	}
	if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false)
	{ 
		alert("Please enter a valid date for "+Label+"\nDate Format is dd/mm/yyyy")
		return false
	}
	return true
}
function isValidDate(dtStr,Label)
{
	var daysInMonth = DaysArray(12)
	var pos1=dtStr.indexOf(dtCh)
	var pos2=dtStr.indexOf(dtCh,pos1+1)
	var strMonth=dtStr.substring(0,pos1)
	var strDay=dtStr.substring(pos1+1,pos2)
	var strYear=dtStr.substring(pos2+1)
	strYr=strYear
	if (strDay.charAt(0)=="0" && strDay.length>1) 
		strDay=strDay.substring(1)
	if (strMonth.charAt(0)=="0" && strMonth.length>1)
		strMonth=strMonth.substring(1)
	for (var i = 1; i <= 3; i++) 
	{
		if (strYr.charAt(0)=="0" && strYr.length>1)
			strYr=strYr.substring(1)
	}
	month=parseInt(strMonth)
	day=parseInt(strDay)
	year=parseInt(strYr)
	if (pos1==-1 || pos2==-1){
		alert("The date format should be : mm/dd/yyyy for "+Label)
		return false
	}
	if (strMonth.length<1 || month<1 || month>12)
	{
		alert("Please enter a valid month for "+Label+"\nDate Format is mm/dd/yyyy")
		return false
	}
	if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month])
	{
		alert("Please enter a valid day for "+Label+"\nDate Format is mm/dd/yyyy")
		return false
	}
	if (strYear.length != 4 || year==0 || year<minYear || year>maxYear)
	{
		alert("Please enter a valid 4 digit year between "+minYear+" and "+maxYear+" for "+Label+"\nDate Format is mm/dd/yyyy")
		return false
	}
	if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false)
	{
		alert("Please enter a valid date for "+Label+"\nDate Format is mm/dd/yyyy")
		return false
	}
	return true
}
function CheckUnCheck(frm,tmpVal)
{
	obj		= eval("document."+frm);

	ctrlPtr	= obj.elements;
	var n = obj.elements.length;
	for(i = 0 ;i<n;i++)
	{
		if(obj.elements[i].name == "chkRecord[]" )
		{
			if( tmpVal == 1 )
			{
				obj.elements[i].checked = 0;
			}
			else
			{
				obj.elements[i].checked = 1;	
			}
		}//end of if
	}//end of for
}//end of function

function ValidateLoginData(frm)
{
	if(!CheckEmpty(frm.txtUserName.value,"User Name"))
	{
		frm.txtUserName.focus();
		return false;
	}
	if(!CheckEmpty(frm.txtPassword.value,"Password"))
	{
		frm.txtPassword.focus();
		return false;
	}
	
}//end of function
function CheckAdminLogin(frm)
{
	if(!CheckEmpty(frm.txtUser.value,"User Name"))
	{
		frm.txtUser.focus();
		return false;
	}
	if(!CheckEmpty(frm.txtPassword.value,"Password"))
	{
		frm.txtPassword.focus();
		return false;
	}
	
}//end of function
function DeleteSelected(frm,hfName)
{
	obj		= eval("document."+frm);
	objHf	= eval("document."+frm+"."+hfName);
	ctrlPtr	= obj;
	var n = obj.elements.length;
	var flg;
	for(i = 0 ;i<n;i++)
	{
		if(ctrlPtr.elements[i].name == "chkRecord[]" )
		{
			if( ctrlPtr.elements[i].checked  == 1 )
			{
				flg = 1;
				break;	
			}
		}//end of if
	}//end of for	
	if(flg == 1)
	{
		if(confirm("Are you sure to delete selected records?"))
		{
			objHf.value = 1;
			obj.submit();
		}
	}
	else
	{
		alert("You first need to select the record to delete");
	}
}//end of function
function EditRec(frm,hfName,val)
{
	obj			= eval("document."+frm);
	objHf		= eval("document."+frm+"."+hfName);
	objHf.value = val;
	obj.submit();
}
function SingleDelete(frm,hfName,val)
{
	if(confirm("Are you sure to delete record?"))
	{
		obj			= eval("document."+frm);
		objHf		= eval("document."+frm+"."+hfName);
		objHf.value = val;
		obj.submit();
	}

}//end of function
function SingleDelete1(frm,hfName,val)
{
	if(confirm("Are you sure to clear the image?"))
	{
		obj			= eval("document."+frm);
		objHf		= eval("document."+frm+"."+hfName);
		objHf.value = val;
		obj.submit();
	}

}//end of function
function SingleDeleteMsg(frm,hfName,val,msg)
{
	if(confirm("Are you sure to delete "+msg+"?"))
	{
		obj			= eval("document."+frm);
		objHf		= eval("document."+frm+"."+hfName);
		objHf.value = val;
		obj.submit();
	}

}//end of function
function SingleDeleteMsg1(frm,hfName,val,msg)
{
	if(confirm("Are you sure to delete "+msg+"? If you delete, it also delete the sub-industries under this Industry"))
	{
		obj			= eval("document."+frm);
		objHf		= eval("document."+frm+"."+hfName);
		objHf.value = val;
		obj.submit();
	}

}//end of function
function commonSetPage(frm,pageno)
{
//	alert("Testing--Paging");
	
	obj	= eval("document."+frm);
	obj.page.value = pageno;
	//alert(obj.page.value);
	obj.action = "";
	obj.target ="_self";
	obj.submit();
}
//searchbycompanycommonSetPage
function searchbycompanycommonSetPage(frm,pageno)
{
//	alert("Testing--Paging");
	
	obj	= eval("document."+frm);
	obj.page.value = pageno;
	//alert(obj.page.value);
	obj.action = "";
	obj.target ="_self";
	obj.submit();
}
function jobcommonSetPage(frm,pageno)
{
//	alert("Testing--Paging");
	
	obj	= eval("document."+frm);
	obj.page.value = pageno;
	obj.action = "";
	obj.target ="_self";
	obj.submit();
}

function searchcommonSetPage(frm,pageno)
{
//	alert("Testing--Paging");
	
	obj	= eval("document."+frm);
	//alert(obj);
		obj.page.value = pageno;
	//alert(obj.page.value);
	obj.action = "searchresults.php?page="+pageno;
	obj.target ="_self";
	obj.submit();
}
function intersearchcommonSetPage(frm,pageno)
{
//	alert("Testing--Paging");
	
	obj	= eval("document."+frm);
	//alert(obj);
		obj.page.value = pageno;
	//alert(obj.page.value);
	obj.action = "INTER_jobresults.php?page="+pageno;
	obj.target ="_self";
	obj.submit();
}
function companysearchcommonSetPage(frm,pageno)
{
//	alert("Testing--Paging");
	
	obj	= eval("document."+frm);
	//alert(obj);
		obj.page.value = pageno;
	//alert(obj.page.value);
	obj.action = "company_profile.php?page="+pageno;
	obj.target ="_self";
	obj.submit();
}
function res_searchcommonSetPage(frm,pageno)
{
//	alert("Testing--Paging");
	
	obj	= eval("document."+frm);
	//alert(obj);
		obj.page.value = pageno;
	//alert(obj.page.value);
	//obj.action = "";
	obj.action = "related_jobs.php?page="+pageno;
	obj.target ="_self";
	obj.submit();
}//


function searchcommonSetPagecountry(frm,pageno)
{
//	alert("Testing--Paging");
	
	obj	= eval("document."+frm);
	//alert(obj);
		obj.page.value = pageno;
	//alert(obj.page.value);
	obj.action = "international_jobs_countries.php";
	obj.target ="_self";
	obj.submit();
}

function searchcommonSetPageit(frm,pageno)
{
//	alert("Testing--Paging");
	
	obj	= eval("document."+frm);
	//alert(obj);
		obj.page.value = pageno;
	//alert(obj.page.value);
	obj.action = "international_jobs_ITs.php";
	obj.target ="_self";
	obj.submit();
}

function regionsearchcommonSetPage(frm,pageno)
{
//	alert("Testing--Paging");
	
	obj	= eval("document."+frm);
	//alert(obj);
		obj.page.value = pageno;
	//alert(obj.page.value);
	obj.action = "region1.php";
	obj.target ="_self";
	obj.submit();
}
function searchcommonSetPageexclusive(frm,pageno)
{
//	alert("Testing--Paging");
	
	obj	= eval("document."+frm);
	//alert(obj);
		obj.page.value = pageno;
	//alert(obj.page.value);
	obj.action = "international_jobs_exclusivecontent.php";
	obj.target ="_self";
	obj.submit();
}

function featuresearchcommonSetPage(frm,pageno)
{
//	alert("Testing--Paging");
	
	obj	= eval("document."+frm);
	//alert(obj);
		obj.page.value = pageno;
	//alert(obj.page.value);
	obj.action = "featureadv.php";
	obj.target ="_self";
	obj.submit();
}

function itsearchcommonSetPage(frm,pageno)
{
//	alert("Testing--Paging");
	
	obj	= eval("document."+frm);
	//alert(obj);
		obj.page.value = pageno;
	//alert(obj.page.value);
	obj.action = "IT_jobresults.php";
	obj.target ="_self";
	obj.submit();
}

function intsearchcommonSetPage(frm,pageno)
{
//	alert("Testing--Paging");
	
	obj	= eval("document."+frm);
	//alert(obj);
		obj.page.value = pageno;
	//alert(obj.page.value);
	obj.action = "INT_jobresults.php";
	obj.target ="_self";
	obj.submit();
	
}
function toolssearchcommonSetPage(frm,pageno)
{
//	alert("Testing--Paging");
	
	obj	= eval("document."+frm);
	//alert(obj);
		obj.page.value = pageno;
	//alert(obj.page.value);
	obj.action = "advertiser_jobs.php";
	obj.target ="_self";
	obj.submit();
	
}

function exsearchcommonSetPage(frm,pageno)
{
//	alert("Testing--Paging");
	
	obj	= eval("document."+frm);
	//alert(obj);
		obj.page.value = pageno;
		//SubDomainName
	//alert(obj.page.value);
	obj.action = "exclusive_jobresults.php";
	obj.target ="_self";
	obj.submit();
}

function subsearchcommonSetPage(frm,pageno,subd)
{
//	alert("Testing--Paging");
	
	obj	= eval("document."+frm);
	//alert(obj);
		obj.page.value = pageno;
		//SubDomainName
	//alert(obj.page.value);
	obj.action = "index.php?type=2&page="+pageno+"&SubDomainName="+subd;
	obj.target ="_self";
	obj.submit();
}

function SearchClicked()
{
	if(!CheckEmpty(document.frmSearch.txtSearch.value,"Search Text"))
	{
		document.frmSearch.txtSearch.focus();
		return false;
	}
	document.frmSearch.action="searchresults.php";	
}//end of function
//validating function for Simple Search 
function CheckSimpleJobSearchData(frm)
{
	if(frm.keywords.value == "" && frm.location.value == "" && frm.selIndustry.selectedIndex == 0)
	{
		alert("Please enter atleast one search criteria");
		return false;
	}
	if(frm.keywords.value != "")
	{
		if(!CheckEmpty(frm.keywords.value,"Keywords"))
		{
			frm.keywords.focus();
			return false;
		}
	}
	if(frm.location.value != "")
	{
		if(!CheckEmpty(frm.location.value,"Location"))
		{
			frm.location.focus();
			return false;
		}
	}
makeJobSearchRequest();
return false;
}//end of function
function CheckAdvancedJobSearchData(frm)
{
	if(frm.keywords.value == "" && frm.location.value == "" && frm.selIndustry.selectedIndex == 0 && frm.selPosition.selectedIndex == 0 && frm.chkFull.checked == false && frm.chkPart.checked == false && frm.chkLocal.checked == false && frm.chkInternational.checked == false)
	{
		alert("Please enter atleast one search criteria");
		return false;
	}
	if(frm.keywords.value != "")
	{
		if(!CheckEmpty(frm.keywords.value,"Keywords"))
		{
			frm.keywords.focus();
			return false;
		}
	}
	if(frm.location.value != "")
	{
		if(!CheckEmpty(frm.location.value,"Location"))
		{
			frm.location.focus();
			return false;
		}
	}

makeJobAdvSearchRequest();
return false;
}//end of function


function CheckIntlJobSearchData(frm)
{
	if(frm.keywords.value == "" && frm.selRegion.selectedIndex == 0 && frm.selIndustry.selectedIndex == 0 && frm.selPosition.selectedIndex == 0 && frm.chkFull.checked == false && frm.chkPart.checked == false )
	{
		alert("Please enter atleast one search criteria");
		return false;
	}
	if(frm.keywords.value != "")
	{
		if(!CheckEmpty(frm.keywords.value,"Keywords"))
		{
			frm.keywords.focus();
			return false;
		}
	}
makeJobIntlSearchRequest();
return false;
}//end of function

//*****************************************Ajax starts here************************************************************//
var http_request = false;
function getServerName()
{
    var str = window.location.protocol + '//' + window.location.hostname;
    return str;
}
//---
function makeGenRequest(frm,condFld,pagename,pageno) 
{
	alert(condFld);
	var condstr = eval("document."+frm+"."+condFld).value;
	url = getServerName()+sitePath+pagename+"?page="+pageno+"&condstr="+condstr;
	http_request = false;

	if (window.XMLHttpRequest) { // Mozilla, Safari,...
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType) {
			http_request.overrideMimeType('text/xml');
		}
	} else if (window.ActiveXObject) { // IE
		try {
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
			http_request = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}

	if (!http_request) {
		alert('Giving up :( Cannot create an XMLHTTP instance');
		return false;
	}
	http_request.onreadystatechange = writeGenPage;
	//alert(url);
	http_request.open('GET', url, true);
	http_request.send(null);
}//end of function
function writeGenPage() 
{
	if (http_request.readyState == 4) 
	{
		if (http_request.status == 200) 
		{
			document.getElementById("InnerSearchContent").innerHTML = http_request.responseText;
		} else {
			alert('There was a problem with the request.');
		}
	}
}//end of function

//--

function makeRequest(pageno) 
{
	var condstr = document.frmJobResults.hfallCondStr.value;
	if(document.frmJobResults.selOrder.value != "")
	{
		orderby=document.frmJobResults.selOrder.value;
	}
	else
	{
		//orderby =document.frmJobResults.orderby.value;
		orderby ="";
	}
	url = getServerName()+sitePath+"jobsearchresults.php?page="+pageno+"&condstr="+condstr+"&orderby="+orderby;
	http_request = false;

	if (window.XMLHttpRequest) { // Mozilla, Safari,...
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType) {
			http_request.overrideMimeType('text/xml');
		}
	} else if (window.ActiveXObject) { // IE
		try {
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
			http_request = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}

	if (!http_request) {
		alert('Giving up :( Cannot create an XMLHTTP instance');
		return false;
	}
	http_request.onreadystatechange = writeJobPage;
	//alert(url);
	http_request.open('GET', url, true);
	http_request.send(null);
}//end of function
function writeJobPage() 
{
	if (http_request.readyState == 4) 
	{
		if (http_request.status == 200) 
		{

			str = http_request.responseText;
			arr =  str.split("#$");

			document.getElementById("SearchContent").innerHTML = arr[0];//http_request.responseText;
			if(arr[1] != "")
			{
				document.getElementById("BannerDivContent").innerHTML = arr[1];
			}
		} else {
			//alert('There was a problem with the request.');
		}
	}
}//end of function

function makeJobAdvSearchRequest() 
{

	url = getServerName()+sitePath+"jobsearchresults.php";

	var FieldValues = "keywords="+document.frmSearch.keywords.value+"&location="+document.frmSearch.location.value+"&selIndustry="+document.frmSearch.selIndustry.options[document.frmSearch.selIndustry.selectedIndex].value;
	FieldValues = FieldValues+"&selPosition="+document.frmSearch.selPosition.options[document.frmSearch.selPosition.selectedIndex].value+"&chkFull="+document.frmSearch.chkFull.checked+"&chkPart="+document.frmSearch.chkPart.checked;
	FieldValues = FieldValues+"&chkLocal="+document.frmSearch.chkLocal.checked+"&chkInternational="+document.frmSearch.chkInternational.checked;
	url = url+"?"+FieldValues;
	http_request = false;

	if (window.XMLHttpRequest) { // Mozilla, Safari,...
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType) {
			http_request.overrideMimeType('text/xml');
		}
	} else if (window.ActiveXObject) { // IE
		try {
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
			http_request = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}

	if (!http_request) {
		alert('Giving up :( Cannot create an XMLHTTP instance');
		return false;
	}
	http_request.onreadystatechange = writeJobSearchContents;
	//alert(url);
	http_request.open('GET', url, true);

	http_request.send(null);
}//end of function
//international job search
function makeJobIntlSearchRequest() 
{

	url = getServerName()+sitePath+"jobsearchresults.php";

	var FieldValues = "keywords="+document.frmSearch.keywords.value+"&selRegion="+document.frmSearch.selRegion.options[document.frmSearch.selRegion.selectedIndex].value+"&selIndustry="+document.frmSearch.selIndustry.options[document.frmSearch.selIndustry.selectedIndex].value;
	FieldValues = FieldValues+"&selPosition="+document.frmSearch.selPosition.options[document.frmSearch.selPosition.selectedIndex].value+"&chkFull="+document.frmSearch.chkFull.checked+"&chkPart="+document.frmSearch.chkPart.checked;
	FieldValues = FieldValues+"&chkLocal=false&chkInternational=true";
	url = url+"?"+FieldValues;
	http_request = false;

	if (window.XMLHttpRequest) { // Mozilla, Safari,...
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType) {
			http_request.overrideMimeType('text/xml');
		}
	} else if (window.ActiveXObject) { // IE
		try {
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
			http_request = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}

	if (!http_request) {
		alert('Giving up :( Cannot create an XMLHTTP instance');
		return false;
	}
	http_request.onreadystatechange = writeJobSearchContents;
	//alert(url);
	http_request.open('GET', url, true);

	http_request.send(null);
}//end of function

//end of international job search
function makeJobSearchRequest() 
{

	url = getServerName()+sitePath+"jobsearchresults.php";

	var FieldValues = "keywords="+document.frmSearch.keywords.value+"&location="+document.frmSearch.location.value+"&selIndustry="+document.frmSearch.selIndustry.options[document.frmSearch.selIndustry.selectedIndex].value;
	
	url = url+"?"+FieldValues;
/*	var qrystr = '';
	if(document.frmSearch.hfSearchType.value == 1)
	{
		qrystr = "&excl=1";
	}
	url = url + qrystr;
*/
	http_request = false;

	if (window.XMLHttpRequest) { // Mozilla, Safari,...
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType) {
			http_request.overrideMimeType('text/xml');
		}
	} else if (window.ActiveXObject) { // IE
		try {
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
			http_request = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}

	if (!http_request) {
		alert('Giving up :( Cannot create an XMLHTTP instance');
		return false;
	}
	http_request.onreadystatechange = writeJobSearchContents;
	//alert(url);
	http_request.open('GET', url, true);

	http_request.send(null);
}//end of function
function writeJobSearchContents() 
{

	if (http_request.readyState == 4) 
	{
		if (http_request.status == 200) 
		{
			str = http_request.responseText;
			arr = str.split("#$");
			
			document.getElementById("SearchContent").innerHTML = arr[0];//http_request.responseText;
			if(arr[1] != "")
			{
				document.getElementById("BannerDivContent").innerHTML = arr[1];
			}
		} else {
			alert('There was a problem with the request.');
		}
	}
}//end of function
//General function
var pathStr = "/1site/";
function makeGeneralRequest(url) 
{
	url = getServerName()+pathStr+url;
//	alert(url);
	http_request = false;

	if (window.XMLHttpRequest) { // Mozilla, Safari,...
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType) {
			http_request.overrideMimeType('text/xml');
		}
	} else if (window.ActiveXObject) { // IE
		try {
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
			http_request = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}

	if (!http_request) {
		alert('Giving up :( Cannot create an XMLHTTP instance');
		return false;
	}
	http_request.onreadystatechange = writeGeneralContents;
	//alert(url);
	http_request.open('GET', url, true);

	http_request.send(null);
}//end of function
function writeGeneralContents() 
{
	if (http_request.readyState == 4) 
	{
		if (http_request.status == 200) 
		{
			document.getElementById("JobSearchBox").innerHTML = http_request.responseText;
		} else {
			alert('There was a problem with the request.');
		}
	}
}//end of function
//end of general function
//*************************Ajax ends here**********************************************************************//
//When Job Search clicked
function JobSearchSimple() 
{

	url = getServerName()+sitePath+"include/simplesearch.php";
//	alert(url);
//	var FieldValues = "keywords="+document.frmSearch.keywords.value+"&location="+document.frmSearch.location.value+"&selIndustry="+document.frmSearch.selIndustry.options[document.frmSearch.selIndustry.selectedIndex].value;
//	url = url+"?"+FieldValues;
//	alert(FieldValues);
	http_request = false;

	if (window.XMLHttpRequest) { // Mozilla, Safari,...
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType) {
			http_request.overrideMimeType('text/xml');
		}
	} else if (window.ActiveXObject) { // IE
		try {
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
			http_request = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}

	if (!http_request) {
		alert('Giving up :( Cannot create an XMLHTTP instance');
		return false;
	}
	http_request.onreadystatechange = writeJobSearchSimpleContents;
	//alert(url);
	http_request.open('GET', url, true);

	http_request.send(null);

	document.getElementById("SimpSearchImg").src = "images/search_bu.jpg";
	document.getElementById("AdvSearchImg").src = "images/advanced_search2.jpg";

}//end of function
function writeJobSearchSimpleContents() 
{

	if (http_request.readyState == 4) 
	{
		if (http_request.status == 200) 
		{
			document.getElementById("SearchBox").innerHTML = http_request.responseText;
		} else {
			alert('There was a problem with the request.');
		}
	}
}//end of function
//when Advanced search is clicked 
function JobSearchAdvanced() 
{

	url = getServerName()+sitePath+"include/advancedsearch.php";

//	var FieldValues = "keywords="+document.frmSearch.keywords.value+"&location="+document.frmSearch.location.value+"&selIndustry="+document.frmSearch.selIndustry.options[document.frmSearch.selIndustry.selectedIndex].value;
//	url = url+"?"+FieldValues;
//	alert(FieldValues);
	http_request = false;

	if (window.XMLHttpRequest) { // Mozilla, Safari,...
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType) {
			http_request.overrideMimeType('text/xml');
		}
	} else if (window.ActiveXObject) { // IE
		try {
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
			http_request = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}

	if (!http_request) {
		alert('Giving up :( Cannot create an XMLHTTP instance');
		return false;
	}
	http_request.onreadystatechange = writeJobSearchAdvContents;
	//alert(url);
	http_request.open('GET', url, true);

	http_request.send(null);
	document.getElementById("SimpSearchImg").src = "images/search_bu1.jpg";
	document.getElementById("AdvSearchImg").src = "images/advanced_search1.jpg";
}//end of function
function writeJobSearchAdvContents() 
{

	if (http_request.readyState == 4) 
	{
		if (http_request.status == 200) 
		{
			document.getElementById("SearchBox").innerHTML = http_request.responseText;
		} else {
			alert('There was a problem with the request.');
		}
	}
}//end of function

//end of Job Advanced Search Click
function CheckAdvancedJobSearchData1(frm)
{
/*

if(frm.keywords.value == "" && frm.location.value == "" && frm.selIndustry.selectedIndex == 0 && frm.selPosition.selectedIndex == 0 )
	{
		alert("Please enter atleast one search criteria");
		return false;
	}
	if(frm.keywords.value != "")
	{
		if(!CheckEmpty(frm.keywords.value,"Keywords"))
		{
			frm.keywords.focus();
			return false;
		}
	}
	if(frm.location.value != "")
	{
		if(!CheckEmpty(frm.location.value,"Location"))
		{
			frm.location.focus();
			return false;
		}
	}


*/

makeJobAdvSearchRequest1();
return false;
}//end of function

//makeJobAdvSearchRequest1();
//return false;
//}//end of function

function makeJobAdvSearchRequest1() 
{

	url = getServerName()+sitePath+"jobsearchresults.php";

	var FieldValues = "keywords="+document.frmSearch.keywords.value+"&location="+document.frmSearch.location.value+"&selIndustry="+document.frmSearch.selIndustry.options[document.frmSearch.selIndustry.selectedIndex].value;
	FieldValues = FieldValues+"&selPosition="+document.frmSearch.selPosition.options[document.frmSearch.selPosition.selectedIndex].value+"&salary="+document.frmSearch.salary.options[document.frmSearch.salary.selectedIndex].value;
	url = url+"?"+FieldValues;
	http_request = false;

	if (window.XMLHttpRequest) { // Mozilla, Safari,...
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType) {
			http_request.overrideMimeType('text/xml');
		}
	} else if (window.ActiveXObject) { // IE
		try {
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
			http_request = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}

	if (!http_request) {
		alert('Giving up :( Cannot create an XMLHTTP instance');
		return false;
	}
	http_request.onreadystatechange = writeJobSearchContents1;
	//alert(url);
	http_request.open('GET', url, true);

	http_request.send(null);
}//end of function
function writeJobSearchContents1() 
{

	if (http_request.readyState == 4) 
	{
		if (http_request.status == 200) 
		{
			str = http_request.responseText;
			arr = str.split("#$");
			
			document.getElementById("SearchContent").innerHTML = arr[0];//http_request.responseText;
			if(arr[1] != "")
			{
				document.getElementById("BannerDivContent").innerHTML = arr[1];
			}
		} else {
			//alert('There was a problem with the request.');
		}
	}
}//end of function

function makeRequest1(pageno) 
{
	var condstr = document.frmSearch.hfallCondStr.value;
	
	if(document.frmSearch.selOrder.value != "")
	{
		orderby=document.frmSearch.selOrder.value;
	}
	else
	{
		//orderby =document.frmSearch.orderby.value;
		orderby="";
	}
	url = getServerName()+sitePath+"jobsearchresults1.php?page="+pageno+"&condstr="+condstr+"&orderby="+orderby;
	http_request = false;

	if (window.XMLHttpRequest) { // Mozilla, Safari,...
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType) {
			http_request.overrideMimeType('text/xml');
		}
	} else if (window.ActiveXObject) { // IE
		try {
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
			http_request = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}

	if (!http_request) {
		alert('Giving up :( Cannot create an XMLHTTP instance');
		return false;
	}
	http_request.onreadystatechange = writeJobPage1;
	//alert(url);
	http_request.open('GET', url, true);
	http_request.send(null);
}//end of function


function writeJobPage1() 
{
	if (http_request.readyState == 4) 
	{
		if (http_request.status == 200) 
		{

			str = http_request.responseText;
			arr =  str.split("#$");

			document.getElementById("SearchContent").innerHTML = arr[0];//http_request.responseText;
			if(arr[1] != "")
			{
				document.getElementById("BannerDivContent").innerHTML = arr[1];
			}
		} else {
			//alert('There was a problem with the request.');
		}
	}
}//end of function

function session_makeRequest(AJAXURL) 
{

	url = getServerName()+sitePath+"jobsearchresults.php?" + AJAXURL + '& ms=' + new Date().getTime();
	http_request = false;

	if (window.XMLHttpRequest) { // Mozilla, Safari,...
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType) {
			http_request.overrideMimeType('text/xml');
		}
	} else if (window.ActiveXObject) { // IE
		try {
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
			http_request = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}

	if (!http_request) {
		alert('Giving up :( Cannot create an XMLHTTP instance');
		return false;
	}
	http_request.onreadystatechange = writeJobPage;
	//alert(url);
	http_request.open('GET', url, true);
	http_request.send(null);
	
}

function SearchmakeRequest(myurl) {
        var httpRequest;
		url = getServerName() + sitePath + myurl + '?ms=' + new Date().getTime();
        if (window.XMLHttpRequest) { // Mozilla, Safari, ...
            httpRequest = new XMLHttpRequest();
            if (httpRequest.overrideMimeType) {
                httpRequest.overrideMimeType('text/xml');
                // See note below about this line
            }
        } 
        else if (window.ActiveXObject) { // IE
            try {
                httpRequest = new ActiveXObject("Msxml2.XMLHTTP");
                } 
                catch (e) {
                           try {
                                httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
                               } 
                             catch (e) {}
                          }
                                       }

        if (!httpRequest) {
            alert('Giving up :( Cannot create an XMLHTTP instance');
            return false;
        }
        httpRequest.onreadystatechange = function() { alertContents(httpRequest); };
        httpRequest.open('GET', url, true);
        httpRequest.send(null);

    }
function alertContents(httpRequest) {

        if (httpRequest.readyState == 4) {
            if (httpRequest.status == 200) {
                document.getElementById('SearchId').innerHTML = httpRequest.responseText;
            } else {
                alert('There was a problem with the request.');
            }
        }

    }	
	
	//for subdomain
	
	function subdomainmakeRequest(pageno) 
{
	var condstr = document.frmJobResults.hfallCondStr.value;
	if(document.frmJobResults.selOrder.value != "")
	{
		orderby=document.frmJobResults.selOrder.value;
	}
	else
	{
		//orderby =document.frmJobResults.orderby.value;
		orderby ="";
	}
	url = getServerName()+sitePath+"subdomainjobsearchresults.php?page="+pageno+"&condstr="+condstr+"&orderby="+orderby;
	http_request = false;

	if (window.XMLHttpRequest) { // Mozilla, Safari,...
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType) {
			http_request.overrideMimeType('text/xml');
		}
	} else if (window.ActiveXObject) { // IE
		try {
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
			http_request = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}

	if (!http_request) {
		alert('Giving up :( Cannot create an XMLHTTP instance');
		return false;
	}
	http_request.onreadystatechange = writesubdomainJobPage;
	//alert(url);
	http_request.open('GET', url, true);
	http_request.send(null);
}//end of function

function writesubdomainJobPage() 
{
	if (http_request.readyState == 4) 
	{
		if (http_request.status == 200) 
		{

			str = http_request.responseText;
			arr =  str.split("#$");

			document.getElementById("SearchContent").innerHTML = arr[0];//http_request.responseText;
			if(arr[1] != "")
			{
				document.getElementById("BannerDivContent").innerHTML = arr[1];
			}
		} else {
			//alert('There was a problem with the request.');
		}
	}
}//end of function


function session_makesubdomainRequest(AJAXURL) 
{

	url = getServerName()+sitePath+"subdomainjobsearchresults.php?" + AJAXURL + '& ms=' + new Date().getTime();
	http_request = false;

	if (window.XMLHttpRequest) { // Mozilla, Safari,...
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType) {
			http_request.overrideMimeType('text/xml');
		}
	} else if (window.ActiveXObject) { // IE
		try {
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
			http_request = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}

	if (!http_request) {
		alert('Giving up :( Cannot create an XMLHTTP instance');
		return false;
	}
	http_request.onreadystatechange = writesubdomainJobPage;
	//alert(url);
	http_request.open('GET', url, true);
	http_request.send(null);
	
}

//Javascript pwd indicator
  
    var minpwlength = 6;
    var fairpwlength = 8;
    
    var STRENGTH_SHORT = 0;  // less than minpwlength 
    var STRENGTH_WEAK = 1;  // less than fairpwlength
    var STRENGTH_FAIR = 2;  // fairpwlength or over, no numbers
    var STRENGTH_STRONG = 3; // fairpwlength or over with at least one number
    //
    img0 = new Image(); 
    img1 = new Image();
    img2 = new Image();
    img3 = new Image();
    
    img0.src = 'images/tooshort.jpg';
    img1.src = 'images/fair.jpg';
    img2.src = 'images/medium.jpg';
    img3.src = 'images/strong.jpg';
	
    
    var strengthlevel = 0;
    
    var strengthimages = Array( img0.src,
                                img1.src,
                                img2.src,
                                img3.src );

//var showme=0;

	//function which checks password strength
	function checkpwdstrength(pw)
	{
		var ValidChars = "0123456789";
		var Alphabets  = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
		var len = pw.length;
		var eachChar ;
		var k=0;
		NumberFlag = 0;
		AlphaFlag  = 0;
		SplFlag	   = 0;
		
		for(var i=0;i<len;i++)
		{
			eachChar = pw.substr(i,1);
		

			if(ValidChars.indexOf(eachChar) >= 0 )
			{
				NumberFlag = 1;
			}
			else if(Alphabets.indexOf(eachChar) >= 0)
			{
				AlphaFlag 	= 1;
			}
			else
			{
				SplFlag     = 1;
			}
		}//END OF FOR
        
		if(NumberFlag==1 && AlphaFlag==1 && SplFlag==1)
		showme=3;
		else if((NumberFlag==1 && AlphaFlag==1) || (AlphaFlag==1 && SplFlag==1) || (NumberFlag==1 && SplFlag==1))
		showme=2;
		else if(NumberFlag==1 ||  AlphaFlag==1 || SplFlag==1)
		showme=1;
		return true;

	}//end of function


    function updatestrength( pw ) {

     if( istoosmall( pw ) ) {
    
            strengthlevel = STRENGTH_SHORT;
    
        }
 else if( !isfair( pw ) ) { 
    
            strengthlevel = STRENGTH_WEAK;
    
        }    
else 
        if( checkpwdstrength( pw ) ) {

if(showme==3)
  strengthlevel = STRENGTH_STRONG;
else if(showme==1)
  strengthlevel = STRENGTH_WEAK;
else if(showme==2)
  strengthlevel = STRENGTH_FAIR;

else
  strengthlevel = STRENGTH_SHORT;


}
    document.getElementById( 'strength' ).src = strengthimages[ strengthlevel ];      
    
   
    
    }
 function istoosmall( pw ) {
    
        if( pw.length < minpwlength ) {
    
            return true;
    
        }
        else {
    
            return false;

        }
    
    }
      function isfair( pw ) {
    
        if( pw.length < fairpwlength ) {
    
            return false;
    
        }
        else { 
    
            return true;
    
        }
    
    }
 //pwd indicator
//for subdomain _index

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_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++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

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];}
}
//job termination
function JobTerminationMsg(frm,hfName,val,msg)
{
	if(confirm("Warning !: Terminating job ad  The job ad will no longer be displayed.Are you sure to terminate the"+msg+"?"))
	{
		obj			= eval("document."+frm);
		objHf		= eval("document."+frm+"."+hfName);
		objHf.value = val;
		obj.submit();
	}

}//end of function
//job untermination
function JobUnTerminationMsg(frm,hfName,val,msg)
{
	if(confirm("Warning !: Are you sure to unterminate the"+msg+"?"))
	{
		obj			= eval("document."+frm);
		objHf		= eval("document."+frm+"."+hfName);
		objHf.value = val;
		obj.submit();
	}

}//end of function
function checklogin(frm,jobseeker,jsid,jsname,msg)
{
if(jobseeker==1 && jsid==1 && jsname==1)
{
if(confirm("you have logged in as a candidate. Do you want to logout and login as an "+msg+"?"))
	{
location.href="changestatus.php?changestatus=true";
}
}
else
{
location.href="advertisers_login.php";
}
}


function checklogin1(frm,advertiser,advid,advname,msg)
{

if(advertiser==1 && advid==1 && advname==1)
{
if(confirm("you have logged in as a advertiser. Do you want to logout and login as an "+msg+"?"))
	{
location.href="changestatus1.php?changestatus=true";
}
}
else
{
location.href="myaccount_login.php";
}
}
//
function IsValidURL1(strURL,n)
{
		strURL 		= strURL.toUpperCase();

		//if(strURL==""||strURL=="HTTP://") return false	
		thePrefix 	= strURL.substr(0,3).toUpperCase();
		var Prefix2 = strURL.substr(0,4).toUpperCase();
alert(thePrefix);
alert(Prefix2 );
		if( thePrefix!="WWW" )
		{ 
			siteFlag = 0;
			return false;
		}
		else
			siteFlag = 1;	
		if ( Prefix2!="WWW." && siteFlag == 0 ) 

			return false;
		if(n!=-1) if(strURL.split("/").length>n) 
			return false;
		
		return true;
}


//adv_new
function CheckEmptynew(Val,Label) 
{ 
  if(truncateSpace(Val)=="") 
  {
   alert(Label+" do not match") 
   return false;
  } 
  return true;
}
function CheckEmptyspecify(Val,Label) 
{ 
  if(truncateSpace(Val)=="") 
  {
   alert("Please specify "+Label) 
   return false;
  } 
  return true;
}

/* ON HOVER WINDOW JS */

function Get_Content(id)
{

if(id!='')
{
xmlHttp=GetXmlHttpObjectRequest()
if (xmlHttp==null)
{
alert ("Your browser does not support AJAX!");
return;
}
var url="show_review.php?UserID="+id;
xmlHttp.onreadystatechange=function()
{
if (xmlHttp.readyState==4)
{
var check=xmlHttp.responseText;
document.getElementById("txtHint"+id).innerHTML=xmlHttp.responseText;
}
}
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
else
{
return;
}
}

function GetXmlHttpObjectRequest()
{
var xmlHttp=null;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
// Internet Explorer
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}

