//Verify email account

function validate_form(fr)
{	
	var flag=0;
	if(fr.full_name.value=="")
	{
		document.images.i_name.src="images/wrong.png";
	}
	else
	{	document.images.i_name.src="images/right.png";
		flag++;
		}
	if(!verify_email(fr.emailid.value))
	{
		document.images.i_id.src="images/wrong.png";
	}
	else
	{	document.images.i_id.src="images/right.png";
		flag++;
		}
	if(fr.contact.value==""||(fr.contact.value.length!=12))
	{
		document.images.i_cnt.src="images/wrong.png";
	}
	else
	{	document.images.i_cnt.src="images/right.png";
		flag++;
	}
	if(fr.dd.value==""||fr.mnt.value==""||fr.year.value=="")
	{
		document.images.i_date.src="images/wrong.png";
	}
	else
	{	document.images.i_date.src="images/right.png";
		flag++;
	}
	if(fr.address.value=="")
	{
		document.images.i_address.src="images/wrong.png";
	}
	else
	{	document.images.i_address.src="images/right.png";
		flag++;
	}
	if(fr.city.value=="")
	{
		document.images.i_city.src="images/wrong.png";
	}
	else
	{	document.images.i_city.src="images/right.png";
		flag++;
	}
	if(fr.country.value=="")
	{
		document.images.i_country.src="images/wrong.png";
	}
	else
	{	document.images.i_country.src="images/right.png";
		flag++;
	}
	if(fr.txt_state.value=="")
	{
		document.images.i_state.src="images/wrong.png";
	}
	else
	{	document.images.i_state.src="images/right.png";
		flag++;
	}
	if(fr.job_code.value=="")
	{
		document.images.i_job.src="images/wrong.png";
	}
	else
	{	document.images.i_job.src="images/right.png";
		flag++;
	}
	if(fr.txt_quali.value=="")
	{
		document.images.i_quali.src="images/wrong.png";
	}
	else
	{	document.images.i_quali.src="images/right.png";
		flag++;
	}
	if(fr.txt_exp.value=="")
	{
		document.images.i_exp.src="images/wrong.png";
	}
	else
	{	document.images.i_exp.src="images/right.png";
		flag++;
	}
	if(fr.skills.value=="")
	{
		document.images.i_skills.src="images/wrong.png";
	}
	else
	{	document.images.i_skills.src="images/right.png";
		flag++;
	}
	if(fr.resume.value=="")
	{
		document.images.i_resume.src="images/wrong.png";
	}
	else
	{	document.images.i_resume.src="images/right.png";
		flag++;
	}
	if(flag<13)
	{	
		return (false);
	}
	else
	{
		return (true);	
		}
}

function reset_images()
{
	document.images.i_name.src="images/spacer.gif";
	document.images.i_id.src="images/spacer.gif";
	document.images.i_cnt.src="images/spacer.gif";
	document.images.i_date.src="images/spacer.gif";
	document.images.i_address.src="images/spacer.gif";
	document.images.i_city.src="images/spacer.gif";
	document.images.i_country.src="images/spacer.gif";
	document.images.i_state.src="images/spacer.gif";
	document.images.i_job.src="images/spacer.gif";
	document.images.i_quali.src="images/spacer.gif";
	document.images.i_exp.src="images/spacer.gif";
	document.images.i_skills.src="images/spacer.gif";
	document.images.i_resume.src="images/spacer.gif";
}

function chk_search(fr)
{	
	if(fr.sitesearch.value=="eainfotech.com")
	{	
		fr.q.value="site:eainfotech.com "+fr.q.value;		
	}
	return true;
}
	
function verify(f) 
{				if(f.Name.value=="")
				{
					alert("Enter Your Name");
					f.Name.focus();
					return(false);
				}
				if (verify_email(f.email_ID.value)==false)
				{	return(false);
				}
				if(f.Phone.value.length<10||f.Phone.value.lenght>12)
				{
					alert("Enter 10-12 digit phone number");
					return(false);
				}
		return(true);
}

function verify_email(id)
{	var pass=-1;
	var npass=-1;
	var pass1=-1;
	if(id=="")
	{	
		
		return(false);
	}
	if(id != "") 
	{
		pass = id.indexOf('@',0);
		if((pass<1)) 
		{
			alert("Enter valid email Address");
			return (false);
		}
		else
		{	
			npass=id.indexOf('@',pass+1);
			if(npass>-1)
			{
				alert("Enter '@' Char once in your email Address"+npass);
				return (false);
			}
		}
		pass1 = id.indexOf('.',pass);
		if((pass1<5)||pass1==id.length-1)
		{
			alert("Enter valid email Address");
			return(false);
		}
	}
	return (true);
}

function onlyChar(evt)
{
  		 var charCode = evt.keyCode;
         if ((charCode > 64 && charCode <91)||( charCode >96&& charCode< 123)||(charCode==32))
		 {	return true;
         }
		 return false;
}

function onlyNum(evt) {
         evt = (evt) ? evt : window.event;
         var charCode = (evt.charCode) ? evt.charCode : ((evt.which) ? evt.which : evt.keyCode);
         if (charCode > 31 && (charCode < 48 || charCode > 57))
		 {
            return false;
         }
		 return true;
}

function onlyEmail(evt){
		var c=evt.keyCode;
		if((c>47&&c<58)||(c>64&&c<91)||(c>96&&c<123)||(c==46)||(c==64)||(c==95))
		{
			return true;
		}
		return false;
}

function menutd(lnk,data,wdth)
{	document.write('<td background="images/lefttab.gif" width="20" height="35"><img src="images/spacer.gif" width="20" height="35"></td>');
	document.write('<td background="images/midtab.gif" width="'+wdth+'"><a class="mnu" href="'+lnk+'">'+data+'</a></td>');
	document.write('<td background="images/righttab.gif" width="20" height="35"><img src="images/spacer.gif" width="20" height="35"></td>');
}
function menusel(lnk,data,wdth)
{	document.write('<td background="images/lefttabover.gif" width="20" height="35"><img src="images/spacer.gif" width="20" height="35"></td>');
	document.write('<td background="images/midtabover.gif" width="'+wdth+'"><a class="mnu" href="'+lnk+'">'+data+'</td>');
	document.write('<td background="images/righttabover.gif" width="20" height="35"><img src="images/spacer.gif" width="20" height="35"></td>');
}



//Pre Load Images
function ImgPreload()
{ 
  var args= new Array;
  document.imageArray = new Array(args.length);
  for(var i=0; i<args.length; i++)
  {
    document.imageArray[i] = new Image;
    document.imageArray[i].src = args[i];
  }
}

// Set Status Bar
function setStatusBar(e)
{ self.status = "Welcome to e-Achievers Infotech Group.";
	
}

// To Disable Right Click
function disableRightClick(e)
{
  var message = "Welcome to e-Achievers Infotech Group. Call 09860444470 for Enquiry";
  
  if(!document.rightClickDisabled) // initialize
  {
    if(document.layers) 
    {
      document.captureEvents(Event.MOUSEDOWN);
      document.onmousedown = disableRightClick;
    }
    else document.oncontextmenu = disableRightClick;
    return document.rightClickDisabled = true;
  }
  if(document.layers || (document.getElementById && !document.all))
  {
    if (e.which==2||e.which==3)
    {
      alert(message);
      return false;
    }
  }
  else
  {
    alert(message);
    return false;
  }
}
disableRightClick();

// Tool Tip Layer Starts

var ns4 = document.layers;
var ns6 = document.getElementById && !document.all;
var ie4 = document.all;
offsetX = 0;
offsetY = 20;
var toolTipSTYLE="";
function initToolTips()
{
  if(ns4||ns6||ie4)
  {
    if(ns4) toolTipSTYLE = document.toolTipLayer;
    else if(ns6) toolTipSTYLE = document.getElementById("toolTipLayer").style;
    else if(ie4) toolTipSTYLE = document.all.toolTipLayer.style;
    if(ns4) document.captureEvents(Event.MOUSEMOVE);
    else
    {
      toolTipSTYLE.visibility = "visible";
      toolTipSTYLE.display = "none";
    }
    document.onmousemove = moveToMouseLoc;
  }
}
function toolTip(msg, fg, bg, wdt)
{
  if(toolTip.arguments.length < 1) // hide
  {
    if(ns4) toolTipSTYLE.visibility = "hidden";
    else toolTipSTYLE.display = "none";
  }
  else // show
  {
    if(!fg) fg = "#777777";
    if(!bg) bg = "#FFFFFF";
    var content =
    '<table border="0" cellspacing="0" cellpadding="1" width="'+wdt+'" bgcolor="' + fg + '"><td>' +
    '<table border="0" cellspacing="0" cellpadding="1" bgcolor="' + bg + 
    '"><td align="justify"><font face="sans-serif" align="justify" color="' + fg +
    '" size="-2">&nbsp\;' + msg +
    '&nbsp\;</font></td></table></td></table>';
    if(ns4)
    {
      toolTipSTYLE.document.write(content);
      toolTipSTYLE.document.close();
      toolTipSTYLE.visibility = "visible";
    }
    if(ns6)
    {
      document.getElementById("toolTipLayer").innerHTML = content;
      toolTipSTYLE.display='block'
    }
    if(ie4)
    {
      document.all("toolTipLayer").innerHTML=content;
      toolTipSTYLE.display='block'
    }
  }
}
function moveToMouseLoc(e)
{
  if(ns4||ns6)
  {
    x = e.pageX;
    y = e.pageY;
  }
  else
  {
    x = event.x + document.body.scrollLeft;
    y = event.y + document.body.scrollTop;
  }
  toolTipSTYLE.left = x + offsetX;
  toolTipSTYLE.top = y + offsetY;
  return true;
}

//End Of ToolTip Layer