﻿// JScript File

function Validatesearch()
{
var radiobtn=document.aspnetForm.ctl00_ContentPlaceHolder1_UC_regular1_rad1;
if(radiobtn.checked==true)
{
 var searchval=document.aspnetForm.ctl00_ContentPlaceHolder1_UC_regular1_txtsearch;
if((searchval.value==null)||(searchval.value==""))
{
alert("Please Enter The Search Text!"); 
searchval.focus();
return false;

}
}
return;
}

function emailid()
{ 
   var getpath=location.href;
   if(getpath=="http://www.careers360.com")     
  {  
                                 
  var mail = document.aspnetForm.ctl00_ContentPlaceHolder1_ctl04_txt_email.value;  
  }
  else
  {
   var mail = document.aspnetForm.ctl00_ContentPlaceHolder1_Ask_us1_txt_email.value;  
  }
  
  
  
 
  if(!mail.match(/^[A-Za-z0-9\._\-+]+@[A-Za-z0-9_\-+]+(\.[A-Za-z0-9_\-+]+)+$/))
   {
     alert('Invalid mail id.');
     
     var getpath=location.href;
      if(getpath=="http://www.careers360.com")     
      {  
                         
     document.aspnetForm.ctl00_ContentPlaceHolder1_ctl04_txt_email.focus();
     }
     else
     
     {
     document.aspnetForm.ctl00_ContentPlaceHolder1_Ask_us1_txt_email.focus();
     
     }
       return false;
  }
 else
   {
    return true;  
 }  
}

function ValidateForm()
{

          var getpath=location.href;
          if(getpath=="http://www.careers360.com")     
        {
        var emailID=document.aspnetForm.ctl00_ContentPlaceHolder1_ctl04_txt_email;
        var ques=document.aspnetForm.ctl00_ContentPlaceHolder1_ctl04_txt_qust;
        }
        else
        {
        var emailID=document.aspnetForm.ctl00_ContentPlaceHolder1_Ask_us1_txt_email;
        var ques=document.aspnetForm.ctl00_ContentPlaceHolder1_Ask_us1_txt_qust;
	        
        }	                             
	
if((ques.value==null)||(ques.value=="") || ques.value=="Type your question here")
{
alert("Please Enter the Question!"); 
ques.focus();
return false;
}

if((emailID.value==null)||(emailID.value=="")){
		alert("Please Enter your Email ID!");
		emailID.focus();
		return false;
	}
if(emailid(emailID.value)==false){
		emailID.value="";
		emailID.focus();
		return false;
	}
	
return true;
}
function toggle_visibility1(getdivid)
 {
 
 var id=getdivid;
 
 
 var e= document.getElementById(getdivid);
 if(e.style.display=='none')
 {
 e.style.display='block';
 }
 else{
 e.style.display='none';
 }
 var h=e.offsetHeight;
 var str=document.getElementById('imgL').style.top;
 str=str.substring(0, str.length-2);
 str=parseInt(str)+parseInt(h);
 document.getElementById('imgL').style.top=str+'px';
 document.getElementById('imgR').style.top=str+'px';
 
  document.location.href=document.location+"#2'";

}
function oncancel(getbtnid)
{

}
 
 
 function toggle_visibility()
 {
 
 
 var e= document.getElementById('ctl00_ContentPlaceHolder1_hidden_div');
 if(e.style.display=='none')
 {
 e.style.display='block';
 }
 else{
 e.style.display='none';
 }
 var h=e.offsetHeight;
 var str=document.getElementById('imgL').style.top;
 str=str.substring(0, str.length-2);
 str=parseInt(str)+parseInt(h);
 document.getElementById('imgL').style.top=str+'px';
 document.getElementById('imgR').style.top=str+'px';
}
function validatecomments()
{
var name=document.aspnetForm.ctl00_ContentPlaceHolder1_txt_name;
var email = document.aspnetForm.ctl00_ContentPlaceHolder1_txtmail.value;  
var comments=document.aspnetForm.ctl00_ContentPlaceHolder1_txt_comments;
if( (name.value==null)||(name.value=="")){
alert('Please enter your Name!');
name.focus();
return false;
}
if((email==null)||(email=="")){
		alert("Please Enter your Email ID!");
		document.aspnetForm.ctl00_ContentPlaceHolder1_txtmail.focus();
		return false;
 
	}
	
 if(!email.match(/^[A-Za-z0-9\._\-+]+@[A-Za-z0-9_\-+]+(\.[A-Za-z0-9_\-+]+)+$/))
   {
     alert('Invalid mail id.');
     document.aspnetForm.ctl00_ContentPlaceHolder1_txtmail.focus();
       return false;
  }
if((comments.value==null)||(comments.value==""))
{
alert('Please enter the Comment!');
comments.focus();
return false;
}
return true;
}
function doClick(ctl00_ContentPlaceHolder1_btn_sub,e)
    {
//the purpose of this function is to allow the enter key to 
//point to the correct button to click.
        var key;

         if(window.event)
              key = window.event.keyCode;     //IE
         else
              key = e.which;     //firefox
    
        if (key == 13)
        {
            //Get the button the user wants to have clicked
            var btn = document.getElementById(ctl00_ContentPlaceHolder1_btn_sub);
            if (btn != null)
            { //If we find the button click it
                btn.click();
                event.keyCode = 0
            }
        }
   }


