
function ClientCallbackSearch(result,context)
{
document.getElementById(context).innerHTML = result;
}
function ClientCallback(result,context)
{     
    if(navigator.appName == "Microsoft Internet Explorer")
        {   
            document.getElementById(context).outerHTML = result;
         }
        else
        {  
          if(result.substring(0,7).toLowerCase()=="<select")
            {
                firstpos=result.indexOf(">");
                result=result.substring(firstpos+1,result.length);
                result=result.replace("</select>","");
            }
            
             document.getElementById(context).innerHTML = result;
           
        }
       
}
// function to control the apperance of the header search

function ClientCallbackQSearch(result,context)
{    
//             if(navigator.appName != "Microsoft Internet Explorer")
//             {
//                firstpos=result.toLowerCase().indexOf("<select");     
//                result1=result.substring(0,firstpos);
//                result=result.substring(firstpos+1,result.length);
//                if (firstpos > -1)
//                {   
//                    firstpos=result.indexOf(">");
//                    result=result1 + result.substring(firstpos+1,result.length);
//                    result=result.replace("</select>","");
//                }
//                
//                 document.getElementById(context).innerHTML = result;
//                 
//                 alert(result);
//             }

//            else
//            {
                document.getElementById(context).outerHTML = result;   
//            }
     
            if(result.toLowerCase().indexOf("option")>-1)
            {
                document.getElementById(context).style.display='block';
            }
            else
            {
                document.getElementById(context).style.display='none'; 
            }
      
         
}


// end of the function to control the apperance of the header search
function QuickSearch(mainID,childID,userid,usertype)
{
var mainValue= document.getElementById(mainID).value;
var URLPath=document.URL.substring(0,document.URL.indexOf("en"))
if(childID!='null')
{
var VarValue= document.getElementById(childID).value;
}
if (document.URL.toLowerCase().indexOf("newemployer") > 0 )
{
  if (userid!='0' && usertype!="seeker" )
   window.location=URLPath+'en/Employer/ResumeSearchResult.aspx?Params=,,1,0,0,0,'+VarValue+',0,'+mainValue+',,,,,,0,,,1,,,,,,0';
  else
  window.location=URLPath+'en/SignIn.aspx?Page=Employer/ResumeSearchResult.aspx?Params=,,1,0,0,0,'+VarValue+',0,'+mainValue+',,,,,,0,,,1,,,,,,0';
 } 
else if (document.URL.toLowerCase().indexOf("employer") > 0 )
{
  if (userid!='0' && usertype=="employer")
   window.location=URLPath+'en/Employer/ResumeSearchResult.aspx?Params=,,1,0,0,0,'+VarValue+',0,'+mainValue+',,,,,,0,,,1,,,,,,0';
  else
  window.location=URLPath+'en/SignIn.aspx?Page=Employer/ResumeSearchResult.aspx?Params=,,1,0,0,0,'+VarValue+',0,'+mainValue+',,,,,,0,,,1,,,,,,0';
 } 
else if (document.URL.toLowerCase().indexOf("recruiter") > 0 )
{
  if (userid!='0' & usertype.match("recruiter"))
   window.location=URLPath+'en/recruiter/ResumeSearchResult.aspx?Params=,,1,0,0,0,'+VarValue+',0,'+mainValue+',,,,,,0,,,1,,,,,,0';
  else
   window.location=URLPath+'en/SignIn.aspx?Page=Recruiter/ResumeSearchResult.aspx?Params=,,1,0,0,0,'+VarValue+',0,'+mainValue+',,,,,,0,,,1,,,,,,0';
   
 }
else
{
if (mainValue!='0' & VarValue!='0')
window.location=URLPath+'en/Seeker/JobSearchResult.aspx?Params=,,,,0,'+mainValue+',0,,0,-1,0,,0&C='+VarValue;
else if (mainValue!='0' & VarValue=='0')
window.location=URLPath+'en/Seeker/JobSearchResult.aspx?Params=,,,,0,'+mainValue+',0,,0,-1,0,,0&C=';
if (mainValue=='0' & VarValue=='0')
window.location=URLPath+'en/Seeker/JobSearchResult.aspx?Params=,,,,0,0,0,,0,-1,0,,0&C=';
 }
}

