﻿function ShowPopup(hoveritem,x,y,prnt)
{
var html;
if(prnt=="contact")
  { html="<table bgcolor='#E9CEC4 1px solid'><tr><td><font color='#ffffff'><span style='font-size:10px'>Contact information</font></td></tr><tr><td bgcolor='#8796CE'> <span style='font-size:10px'>Provide your Details fields marked with * are required.<br> (click to exit)</span></td></tr></table>";}
if(prnt=="email")
  {html="<table bgcolor='#E9CEC4 1px solid'><tr><td><font color='#ffffff'><span style='font-size:10px'>Login</font></td></tr><tr><td bgcolor='#8796CE'><span style='font-size:10px'>Enter your Email and Password.<br>(click to exit)</span></td></tr></table>";}
if(prnt=="career")
  {html="<table bgcolor='#E9CEC4 1px solid'><tr><td><font color='#ffffff'><span style='font-size:10px'>Career </font></td></tr><tr><td bgcolor='#8796CE'><span style='font-size:10px'>Specify your career information.<br>(click to exit)</span></td></tr></table>";}
if(prnt=="personal")
  {html="<table bgcolor='#E9CEC4 1px solid'><tr><td><font color='#ffffff'><span style='font-size:10px'>Personal information </font></td></tr><tr><td bgcolor='#8796CE'><span style='font-size:10px'>Please Provide your personal information.<br>(click to exit)</span></td></tr></table>";}
if(prnt=="resume")
  {html="<table bgcolor='#E9CEC4 1px solid'><tr><td><font color='#ffffff'><span style='font-size:10px'>Resume</font></td></tr><tr><td bgcolor='#8796CE'><span style='font-size:10px'>Select one of options below.<br>(click to exit)</span></td></tr></table>";}
if(prnt=="heatload")
  {html="<img id='new' border='0' src='images/dyntxt.gif' border='0' onmouseout='HidePopup()'>"}
if(prnt=="rem")
  {html="<img id='new' border='0' src='images/real.gif' border='0' onmouseout='HidePopup()'>"}

document.getElementById('hoverpopup').innerHTML=html;
hp = document.getElementById('hoverpopup');
// Set position of hover-over popup
  hp.style.top = hoveritem.offsetTop + x;
  hp.style.left = hoveritem.offsetLeft + y;
// Set popup to visible
hp.style.visibility = "Visible";
}


function HidePopup()
{
hp = document.getElementById("hoverpopup");
hp.style.visibility = "Hidden";
}
    function centerOnElement(baseElemID, posElemID, x, y) {
    baseElem = document.getElementById(baseElemID);
    posElem = document.getElementById(posElemID);
  
    var offsetTrail = baseElem;
    var offsetLeft = x;
    var offsetTop = y;
    // account for IE 6 CSS compatibility mode
    while (offsetTrail) 
    {
   
        offsetLeft += offsetTrail.offsetLeft;
        offsetTop += offsetTrail.offsetTop;
        offsetTrail = offsetTrail.offsetParent;
    }
    if (navigator.userAgent.indexOf("Mac") != -1 && typeof document.body.leftMargin != "undefined") 
    {
        offsetLeft += document.body.leftMargin;
        offsetTop += document.body.topMargin;
    }
   
    posElem.style.left = offsetLeft + parseInt(baseElem.offsetWidth/2) - parseInt(posElem.offsetWidth/2) + "px"
    posElem.style.top = offsetTop + parseInt(baseElem.offsetHeight/2) - parseInt(posElem.offsetHeight/2)+ "px"
}



function chkdate(date)
{   
    var dtCh="/";
    var dtStr = date;
	var pos1=dtStr.indexOf(dtCh);
	var pos2=dtStr.indexOf(dtCh,pos1+1);

	if (pos1==-1 || pos2==-1)
	{
    document.getElementById("errtxt").innerHTML="Wrong Date Format";
    //		alert("The date format should be : mm/dd/yyyy")
		return "F";
	}
	else
	{
	 document.getElementById("errtxt").innerHTML="or type in 01/01/2001 format.";
	}
  
  if (Date.parse(date) > Date.parse("01/01/1990"))
    {
	 alert("Invalid Date !\nDate cannot be "+date+" !")
	 return "F";
	}
  if (Date.parse(date) < Date.parse("01/01/1960")) 
   {
	alert("Invalid Date !\nDate cannot be "+date+" !")
	return "F";
	}

}




function min(eid,name)
{ eid.src="images/"+name+"over.gif";
  eid.style.cursor="pointer"; }

function mout(eid,name)
{ eid.src="images/"+name+"normal.gif";
  eid.style.cursor="pointer"; }

function srch(eng)
   {
document.getElementById('selsrch').selectedIndex='0';
   if(eng=='Google Search')
      {
      open("http://www.google.com");
      }
    if(eng=='Yahoo Search')
    {
      open('http://www.search.yahoo.com');
    }
    if(eng=='Altavista Search')
    {
     open('http://www.altavista.com');
    }
   if(eng=='Live Search')
     {
      open('http://www.live.com');
     }
if(eng=='Netscape Search')
     {
      open('http://www.Netscape.com');
     }

if(eng=='Lycos')
     {
      open('http://www.Lycos.com');
     }

if(eng=='LookSmart')
     {
      open('http://www.LookSmart.com');
     }
if(eng=='Gigablast')
     {
      open('http://www.Gigablast.com');
     }
if(eng=='HotBot')
     {
      open('http://www.HotBot.com');
     }
if(eng=='AOL Search')
     {
      open('http://www.AOL.com');
     }
if(eng=='AllTheWeb.com')
     {
      open('http://www.alltheweb.com');
     }
if(eng=='Ask')
     {
      open('http://www.Ask.com');
     }
  }
  
  
function validate()
 {
		if (form1.sName.value == "")
		  {
alert("Please type your name");
		    form1.sName.focus();

		    return (false);
		   }
		  
 /* 
     if (form1.LastName.value == "")
		  {
alert("Please type your last name");
		   form1.LastName.focus();

		    return (false);
		   }
		   
/*
		   
	if (form1.Address1.value == "")
		  {
alert("Please type your Address");
		   form1.Address1.focus();

		    return (false);
		   }
		  
/*	   
		   
		   if (form1.City.value == "")
		  {
alert("Please select City");
		   form1.City.focus();

		    return (false);
		    
		   }
	
/*
		   if (form1.State.value == "")
		  {
alert("Please select State");
		   form1.State.focus();

		    return (false);
		   }

		   
/*		   if (form1.ZIPCode.value == "")
		  {
alert("Please write ZIPCode");
		   form1.ZIPCode.focus();

		    return (false);
		   }
	
	   
	/*	   if (form1.PhoneNumber.value == "")
		  {
alert("Please specifiy Phone Number");
		   form1.PhoneNumber.focus();

		    return (false);
		   }
		  

	/*	   if (form1.MobNumber.value == "")
		  {
alert("Please specifiy Mobile Number");
		   form1.MobNumber.focus();

		    return (false);
		   }
		   
	*/

//STARTS---------------------------------------------------------------PRIMARY email validation		 
			   
	 if (form1.Email.value == "")
		{
          alert("please specify your email id");
           form1.Email.focus();

      	   return (false);
		   }
		  
		

	 if (form1.Email.value.charAt(0) == " ")
		{
		             alert("Invalid Email id");
		    form1.Email.focus();

		    return (false);
		  }
	
		  
	   if (form1.Email.value.indexOf('@')==-1)
		{
		             alert("Invalid Email id");
		             			form1.Email.focus();

			return (false);
		}
		

	   if (form1.Email.value.indexOf('.')==-1)
		{
		             alert("Invalid Email id");
		             			form1.Email.focus();

			return (false);
		}

		txt="";
		txt1=" ";
		 txt=form1.Email.value;
		 for(i1=0;i1<txt.length;i1++)
		  {
		   if(txt1==txt.charAt(i1))
			{
			 alert("Invalid Email ID");
			  form1.Email.focus();
			  return (false);
			}
		  }
		  		   
		if((parseInt(form1.Email.value.indexOf('.'))-parseInt(form1.Email.value.indexOf('@'))==1)||(parseInt(form1.Email.value.length)-parseInt(form1.Email.value.indexOf('.'))<3))
		{
			  alert("Invalid Email ID");
			  form1.Email.focus();
			  return (false);
		}
//ENDS---------------------------------------------------------------PRIMARY email validation

		
//---------------------------------------------------------------secondary email validation
		
 /*if (form1.secEmail.value == "")
		{
               	  
		   }

  else{
	 if (form1.secEmail.value.charAt(0) == " ")
		{
alert("Invalid Email ID");
			  form1.secEmail.focus();

		    return (false);
		  }
		 
		  
	   if (form1.secEmail.value.indexOf('@')==-1)
		{
alert("Invalid Email ID");
			  form1.secEmail.focus();

			return (false);
		}


	   if (form1.secEmail.value.indexOf('.')==-1)
		{
			alert("Invalid Email ID");
			  form1.secEmail.focus();

			return (false);
		}
		txt="";
		txt1=" ";
		 txt=form1.secEmail.value;
		 for(i1=0;i1<txt.length;i1++)
		  {
		   if(txt1==txt.charAt(i1))
			{
			 alert("Invalid Email ID");
			  form1.secEmail.focus();
			  return (false);
			}
		  }
		  		   
		if((parseInt(form1.secEmail.value.indexOf('.'))-parseInt(form1.secEmail.value.indexOf('@'))==1)||(parseInt(form1.secEmail.value.length)-parseInt(form1.secEmail.value.indexOf('.'))<3))
		{
			  alert("Invalid Email ID");
			  form1.secEmail.focus();
			  return (false);
		}
	}
//---------------------------------------------------------------secondary email validation	
   
	/*
	
		if (form1.CareerLevel.value == "")
		{
		   alert("Please select your Career level ");
		   form1.CareerLevel.focus();
		   return (false);
		   }
		

   if (form1.ExperienceLevel.value == "")
		{
		   alert("Please select your Experience level ");
		   form1.ExperienceLevel.focus();
		   return (false);
		   }
   
		   
      if (form1.DegreeLevel.value == "")
      		{
       alert("Please select your Degree level ");
		   form1.DegreeLevel.focus();
		   return (false);
		   }

		   if (form1.JobTitle.value == "")
		{
		   alert("Please Write Job Title ");
		   form1.JobTitle.focus();
		   return (false);
		   }
   if (form1.Gender.value == "")
		{
		   alert("Please select one option for Gender ");
		   form1.Gender.focus();
		   return (false);
		   }

	    if (form1.dc.value == "")
		{
		   alert("Please select or write your date of birth ");
		   form1.dc.focus();
		   return (false);
		   }
	    if (chkdate(form1.dc.value) == "F")
	      {
	       return (false);
	      }
*/ 
}
 
 
 function setwin(page)
    {
     features ='toolbar=no,location=no,directories=no,status=no,menubar=no,' + 'scrollbars=yes,resizable=no,width=800,height=600';
     self.window.open(page,"Dialog",features);
   }
   
   
   /// validation for feedback
   
   function validatefeedback()
 {
   		if (form1.sName.value == "")
		  {
			alert("Please type your name");
		    form1.sName.focus();
		    return (false);
		   }
		  
			   
	 if (form1.Email.value == "")
		{
           alert("please specify your email id");
           form1.Email.focus();
      	   return (false);
		   }
		  
		

	 if (form1.Email.value.charAt(0) == " ")
		{
            alert("Invalid Email id");
 		    form1.Email.focus();
		    return (false);
		  }
	
		  
	   if (form1.Email.value.indexOf('@')==-1)
		{
	        alert("Invalid Email id");
	    	form1.Email.focus();
			return (false);
		}
		

	   if (form1.Email.value.indexOf('.')==-1)
		{
		    alert("Invalid Email id");
		    form1.Email.focus();
     		return (false);
		}

		txt="";
		txt1=" ";
		 txt=form1.Email.value;
		 for(i1=0;i1<txt.length;i1++)
		  {
		   if(txt1==txt.charAt(i1))
			{
			 alert("Invalid Email ID");
			  form1.Email.focus();
			  return (false);
			}
		  }
		  		   
		if((parseInt(form1.Email.value.indexOf('.'))-parseInt(form1.Email.value.indexOf('@'))==1)||(parseInt(form1.Email.value.length)-parseInt(form1.Email.value.indexOf('.'))<3))
		{
			  alert("Invalid Email ID");
			  form1.Email.focus();
			  return (false);
		}

  	if (form1.feedback.value == "")
		  {
          alert("Please enter some Text");
		   form1.feedback.focus();

		    return (false);
		   }
 }

