var httpRemoveComments      = getHTTPObject();
var httpUpdate      		= getHTTPObject();
var httpCheckUser           = 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;
}
//============= Email Matching ==================

var fixedh = "8";
var fixedm = "01";
var fixeds = "01 PM";
function countTime()
{   
	var dateObject = new Date();	
	var displaytime = dateObject.toLocaleTimeString();
	
	var now = displaytime.split(':');
	var hr =trim(now[0]);
	var mm =trim(now[1]);
	var ss =trim(now[2]);
		
	//alert(hr);alert(mm);alert(ss);
	setTimeout("countTime()",1000);
	
	if(fixedh==hr && fixedm==mm && fixeds==ss)
	{	
		sendRequest4matchingEmail();	
		//alert(displaytime); 
	}
}

function sendRequest4matchingEmail()
{
	  httpUpdate.onreadystatechange = handleSaveResponse;
	  httpUpdate.open("GET", 'index.php?app=home&cmd=email_matching', true);  	
  	  httpUpdate.send(null);
}
function handleSaveResponse()
{
   
    if(httpUpdate.readyState == 4)
    {    	
    	//alert(trim(httpUpdate.responseText));      
    }   
    
}
//==============End Email Matching=============

function showTip()
{ 
  document.getElementById('ltip').style.display = 'block';
  document.getElementById('ltip').style.visibility = 'show';  
  if(document.getElementById('ltip').style.visibility =="hidden")
  {
  	document.getElementById('ltip').style.visibility = 'show'; 	
  }
     
} 
function hideTip()
{ 	 
 document.getElementById('ltip').style.display = 'none';
 document.getElementById('ltip').style.visibility = 'show'; 	
	    
 } 
function _select(elid)
{
	if(elid.checked == true)
	{
		elid.checked = true;
	}
	else 
	{
		elid.checked= false;
	}
}

function _selectAll(elid)
{
	if(elid.checked == true)
	{
		elid.checked = false;
	}
	else 
	{
		elid.checked= true;
	}
}


function CheckAll(chk, frm)
{
	var chkall = document.getElementById('chkall');
	var tf;
	if(chkall.checked == true)
	{
		tf = true;
	}
	else
	{
		tf = false;
	}
		var el_collection = eval("document.forms."+frm+"."+chk);
		for(c=0;c<=el_collection.length;c++)
		{
			if(tf)
			{
				//el_collection[c].checked = false;
				_selectAll(el_collection[c]);
			}
			else
			{
				//el_collection[c].checked = true;
				_selectAll(el_collection[c]);
			}
		}
}//EoF CheckAll


function addFaq_user()
{
	var user_question = document.getElementById('user_question').value;	
	if(user_question)
	{
		return true;	
	}
	else
	{
		alert('Question can not be empty...');
		faq_frm.user_question.focus();
		return false;		
	}
	
}
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


function gotoSignUpwithRegEmail(){
	var regEmail = document.getElementById('regEmail').value;
	
	if(RE_EMAIL.exec(regEmail)){
		window.location = "?app=jobseeker_signup&regEmail="+regEmail;
     }else{
        alert("Please provide a valid email!!!");
	 }
}












function validate_form()
{
	valid = true;

      if ( document.frmSearch.position_level.value == ""   )
        {
		        alert("Please select any option");
                valid = false;
        }
      else if ( document.frmSearch.position_based_in.value == ""   )
        {
		        alert("Please select any option");
                valid = false;
        }

        return valid;
}







// left training and workshop scroll

var delayb4scroll=2000 //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
var marqueespeed=2 //Specify marquee scroll speed (larger is faster 1-10)
var pauseit=1 //Pause marquee onMousever (0=no. 1=yes)?

////NO NEED TO EDIT BELOW THIS LINE////////////

/*var copyspeed=marqueespeed
var pausespeed=(pauseit==0)? copyspeed: 0
var actualheight=''

function scrollmarquee(){
if (parseInt(cross_marquee.style.top)>(actualheight*(-1)+8))
cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed+"px"
else
cross_marquee.style.top=parseInt(marqueeheight)+8+"px"
}

function initializemarquee(){
cross_marquee=document.getElementById("vmarquee")
cross_marquee.style.top=0
marqueeheight=document.getElementById("marqueecontainer").offsetHeight
actualheight=cross_marquee.offsetHeight
if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1){ //if Opera or Netscape 7x, add scrollbars to scroll and exit
cross_marquee.style.height=marqueeheight+"px"
cross_marquee.style.overflow="scroll"
return
}
setTimeout('lefttime=setInterval("scrollmarquee()",30)', delayb4scroll)
}

if (window.addEventListener)
window.addEventListener("load", initializemarquee, false)
else if (window.attachEvent)
window.attachEvent("onload", initializemarquee)
else if (document.getElementById)
window.onload=initializemarquee
*/
// end

