// IMR JS File
// Author - Umesh B. Sethia, Team SANTRONIX
// Date started: 28th January 2009

// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 5000;
// Duration of crossfade (seconds)
var crossFadeDuration = 3;
// Specify the image files
var Pic = new Array();
// to add more images, just continue
// the pattern, adding to the array below

Pic[0] = '/college/photo1.jpg'
Pic[1] = '/college/photo2.jpg'
Pic[2] = '/college/photo3.jpg'
Pic[3] = '/college/photo4.jpg'
Pic[4] = '/college/photo9.jpg'

// do not edit anything below this line
var t;
var j = 0;
var p = Pic.length;
var preLoad = new Array();
for (i = 0; i < p; i++) {
preLoad[i] = new Image();
preLoad[i].src = Pic[i];
}
function runSlideShow() {
if (document.all) {
document.images.SlideShow.style.filter="blendTrans(duration=2)";
document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)";
document.images.SlideShow.filters.blendTrans.Apply();
}
document.images.SlideShow.src = preLoad[j].src;
if (document.all) {
document.images.SlideShow.filters.blendTrans.Play();
}
j = j + 1;
if (j > (p - 1)) j = 0;
t = setTimeout('runSlideShow()', slideShowSpeed);
}
//  End -->

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i>a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i>d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function vallogin(t)
{
	if(t.uname.value=="")
	{
		alert("Please specify your Member ID....");
		t.uname.focus();
		return 0;
	}
	if(t.upwd.value=="")
	{
		alert("Please specify your Login Password....");
		t.upwd.focus();
		return 0;
	}
	t.submit();
	return 1;
}
/*function validatefrm(t)
{

	if(t.name.value=="")
	{
		alert("Please specify your Name....");
		t.name.focus();
		return 0;
	}
	var emailID=t.email
	if(emailID.value=="" && t.phones.value=="")
	{
		alert("Please specify either Contact Mobile Number or E-mail address...");
		t.phones.focus();
		return false;
	}
	if (emailID.value!="" && echeck(emailID.value)==false)
	{
		emailID.value=""
		emailID.focus()
		return false
	}

	if(t.comments.value=="")
	{
		alert("Please specify your Comments/ Suggestions....");
		t.comments.focus();
		return 0;
	}
	if(t.strCAPTCHA.value=="")
	{
		alert("Please specify capture code shown in image above - Used for controlling automated harvesting....");
		t.strCAPTCHA.focus();
		return 0;
	}
	  
	t.submit();
	return 1;
}
*/

function CheckNumber(input)
{
	var str = input.value;
	for (var i = 0; i < str.length; i++) 
	{
        	var ch = str.substring(i, i + 1)
	        if ((ch < "0" || "9" < ch) && ch != '.'  && ch!=",") 
			{
			input.value=""
        	      	alert("Please Enter Numeric Value...");
			input.focus();
		        return false;
	    	}
	}
	return true;
}

function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail ID")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail ID")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

 		 return true					
	}

function testASP(checkvalue)
{
	var ASPCodePat = /<%(.|\n)*%>|<script(.|\n)*script>|<style(.|\n)*style>|<meta[\s]/gi;
	var testForASP = checkvalue.match(ASPCodePat);

	if (testForASP !== null)
	{
		alert("Sorry could not post your contents - submission contains harmful contents...");
		return false;
	}
	return true;
}

function checknumber1(input)
{
	var str = input.value;
	for (var i = 0; i < str.length; i++) 
	{
        	var ch = str.substring(i, i + 1)
	        if ((ch < "0" || "9" < ch) ) 
			{
				input.value=""
				alert("Please Enter Numeric Value...");
				input.focus();
				return false;
	    	}
	}
	return true;
}


//validation for phone/mobile
function phnocheck(input)
{
	var str = input.value;
	if (str!="")
	{
		for (var i = 0; i < str.length; i++) 
		{
        	var ch = str.substring(i, i + 1)
	        if (ch < "0" || "9" < ch) 
			{
			input.value=""
        	alert("Invalid Phone number...");
			input.focus();
		    return false;
	    	}
		}
	}
	return true;
}

function mobcheck(input)
{
	var str = input.value;
	if (str.length!=10)
	{
		alert("Invalid Phone number...");
		input.focus();
	    return false;
	}
	if (str.substring(1,0)!="9")
	{
		alert("Invalid Phone number...");
		input.focus();
	    return false;
	}
	for (var i = 0; i < str.length; i++) 
	{
        	var ch = str.substring(i, i + 1)
	        if (ch < "0" || "9" < ch) 
			{
			input.value=""
        	alert("Invalid Phone number...");
			input.focus();
		    return false;
	    	}
	}
	return true;
}

function monthdays(mon1,yr)
{
	switch (mon1){	
	case "2":
		if (yr==0)
			mdays=29;
		else
		{
			lp1=yr % 400;
			if (lp1==0)
				mdays=29;
			else
			{
				lp2=yr % 4;
				lp3=yr % 100;
				if ((lp2==0) && (lp3>0))
					mdays=29;
				else
					mdays=28;
			}
		}
		break;
	case "4":	
	case "6":
	case "9":	
	case "11":
		mdays=30;
		break;
	default:
		mdays=31;
		break;
	}
	return mdays;
}	


function chkseldate(dy,mth,yrs,msg)
{
	td=dy.selectedIndex;
	td=dy.options[td].value;
	if (td==0)
	{
		alert("Please specify date!");
		dy.focus();
		return 0;
	}
	tm=mth.selectedIndex;
	tm=mth.options[tm].value;
	if (tm==0)
	{
		alert("Please specify Month!");
		mth.focus();
		return 0;
	}
	ty=yrs.selectedIndex;
	ty=yrs.options[ty].value;
	if (ty==0)
	{
		alert("Please specify Year!");
		yrs.focus();
		return 0;
	}
	md=monthdays(tm,ty);
	if (td>md)
	{
		alert(msg);
		dy.focus();	
		return 0;
	}
	else
	
		return 1;
}

function valdateform(frm)
{
	
	if (chkseldate(frm.fromdd,frm.frommm,frm.fromyy,"Invalid from date!")==0)
		return 0;
	if (chkseldate(frm.todd,frm.tomm,frm.toyy,"Invalid to date!")==0)
		return 0;
	
	dd=frm.fromdd.selectedIndex;
	dd=frm.fromdd.options[dd].text;
	mm=frm.frommm.selectedIndex;
	mm=frm.frommm.options[mm].value;
	yy=frm.fromyy.selectedIndex;
	yy=frm.fromyy.options[yy].text;
	
	dd1=frm.todd.selectedIndex;
	dd1=frm.todd.options[dd1].text;
	mm1=frm.tomm.selectedIndex;
	mm1=frm.tomm.options[mm1].value;
	yy1=frm.toyy.selectedIndex;
	yy1=frm.toyy.options[yy1].text;

	dd=eval(dd);
	mm=eval(mm);
	yy=eval(yy);
	dd1=eval(dd1);
	mm1=eval(mm1);
	yy1=eval(yy1);
	if (yy>yy1)
	{
		alert("Start Date is larger than end date");
		frm.fromdd.focus();
		return 0;
	}
	else
	{
		if ((yy==yy1) && (mm>mm1))	
		{
			alert("Start Date is larger than end date");
			frm.fromdd.focus();
			return 0;
		}
		else
		{
			if (((yy==yy1) && (mm==mm1)) && (dd>dd1))	
			{
				alert("Start Date is larger than end date");
				frm.fromdd.focus();
				return 0;
			}
		}
	}
	frm.submit();
	return 1;
}

//Blank textfield validation
function chkblank(t,msg)
{
	if (t.value=="")
	{
		alert(msg);
		t.focus();
		return 0;
	}
	return true;
}

//validation for selection list
function chkselect(t,msg)
{
	selno = t.selectedIndex; 
	
	selvalue = t.options[selno].value; 
	if (selvalue==0)
	{
		alert(msg);
		t.focus();
		return 0;
	}
	return true;
}

function chkradio(r,msg)
{
myOption = -1;
	
	for (i=r.length-1; i > -1; i--) {
	if (r[i].checked) {
		myOption = i; i = -1;
	}
	}
	if (myOption == -1) {
	alert(msg);
	return 0;
	}
}

function validreg(f,ftype)
{
	if (ftype==1)
	{
		f.action="/myaccount/register.asp";
		if (chkblank(f.name,"Please specify full name!")==0)
			return 0;
		if (chkblank(f.fname,"Please specify father/husband name!")==0)
			return 0;
	}
	if (chkradio(f.gender,"Please specify your gender!")==0)
		return 0;
	if (chkseldate(f.bdd,f.bmm,f.byy,"Invalid birthdate!")==0)
		return 0;

	if (chkblank(f.address,"Please key in the proper address!")==0)
		return 0;
	if (chkblank(f.city,"Please specify your city name!")==0)
		return 0;
	if (chkselect(f.state,"Select state!")==0)
		return 0;
	if (chkblank(f.pin,"Zip/Postal code not specified!")==0)
		return 0;
	else
	{
		if (checknumber1(f.pin)==0)
			return 0;
		else
		{
			l=f.pin.value;
			llen=l.length;
			if (llen!=6)
			{
				alert("Invalid Zip/Postal Code!");
				f.pin.focus();
				return 0;
			}
		}
	}
	resi1=f.llineno.value;
	off1=f.llinestd.value;
	mob1=f.mobile.value;
	if (resi1=="" && mob1=="")
	{
		alert("Please specify atleast one contact number!");
		f.llinestd.focus();
		return 0;
	}
	
	if (resi1!="")
		if (phnocheck(f.llineno)==0)
			return 0;
	if  ((resi1!="" && off1=="") || (off1!="" && resi1==""))
		{
			alert("Please specify std code with phone number!")
			f.llinestd.focus();
			return 0;
		}
	if (mob1!="")
		if (mobcheck(f.mobile)==0)
			return 0;
	
	if (f.email.value!="")
	{
		if (echeck(f.email.value)==false)
		{
			f.email.value="";
			f.email.focus();
			return 0;
		}
	}
	if (chkblank(f.nname,"Nominee not specified!")==0)
		return 0;
	if (chkseldate(f.ndd,f.nmm,f.nyy,"Invalid birthdate!")==0)
		return 0;
	if (chkselect(f.relation,"Please specify your relation with the nominee")==0)
		return 0;
	if(ftype==1)
	{
		if (chkselect(f.gift,"Select your free gift")==0)
			return 0;
		if (chkblank(f.spid,"Please specify your Sponsorer Identification No.")==0)
			return 0;
		if (f.ver.value==0)
		{
			alert("Please verify the Identification Code of your sponsorer!")
			f.bver.focus();
			return 0;
		}
		if (f.ver.value==-1)
		{
			alert("Sorry! The sponsored Id is invalid! Please check it properly!")
			f.spid.focus();
			return 0;
		}	
		if (chkblank(f.ddno,"Improper payment details!!Please specify Demand Draft No.")==0)
			return 0;
		if (chkblank(f.ddbank,"Improper payment details!!!Please specify Bnak name.")==0)
			return 0;
		if (chkblank(f.ddamt,"Improper payment details!!!Amount not specified.")==0)
			return 0;
		if (chkseldate(f.dddd,f.ddmm,f.ddyy,"Invalid Demand Draft date!!!")==0)
			return 0;
		if (chkblank(f.strCaptcha,"Please type the code as shown in the image!")==0)
			return 0;
	}

	f.target="_parent";
	f.submit();
	return 1;
}

function versp(f,fname)
{
	if (chkblank(f.spid,"Please specify a valid Sponsorer Id!.")==0)
			return 0;
			sid=f.spid.value;
			window.open("/myaccount/verifyspid.asp?fname="+fname + "&sid="+sid ,"Geneology","resizable=yes,toolbar=0,location=0,menubar=0,status=0,height=110,width=820,,scrollbars=1,left=250,top=200");

	
}

function changep(f)
{
	if (chkblank(f.opwd,"Please specify your old password!")==0)
		return 0;
	if (chkblank(f.npwd,"Please specify new password!")==0)
		return 0;
	if (chkblank(f.cpwd,"Please confirm your password by retyping it!")==0)
		return 0;
	if (f.npwd.value!=f.cpwd.value)
		{
			alert("Your new password does not match with the confirm password. Make sure they are same!!!")
			f.npwd.focus();
			return 0;
		}
		f.submit();
		return 1;	
}

function newsignup(f)
{
	f.action="/user/registeration.asp";
	f.submit();
	return 1;
}


function showimgupload()
{
window.open('/mgr/uploadimage.asp',"TransactionHistory","resizable=no,toolbar=0,location=0,menubar=0,status=0,height=150,width=900,top=50,left=400,scrollbars=1,titlebar=0");
	return 1;
}

function valimgfile(t)
{
	if(t.imgfile.value=="")
	{
		alert("Please specify Image file to Upload...");
		t.imgfile.focus();
		return 0;
	}
	strr=t.imgfile.value;
	ln=strr.length;
	s1=strr.substring(ln-4,ln);
	
	if(s1!=".jpg" && s1!=".JPG" && s1!=".gif" && s1!=".GIF" )
	{
		alert("Please specify image files Only - .GIF/.JPG");
		t.imgfile.focus();
		return false;	
	}
	//t.target="_blank";
	//t.action="valxls.asp";
	t.submit();
	return 1;
}



function expand(i,id1)
{
x="freg.x" + i + ".value";

x=eval(x);

if (x==0)
{	
	isrc="document.img" + i + ".src='/images/expand.jpg'"
	eval(isrc);
	eval("freg.x" + i + ".value=1")
	document.getElementById(id1).style.display='none';
}
else
{
	eval("document.img"+ i +".src='/images/contract.jpg';");
	eval("freg.x" + i + ".value=0");
	document.getElementById(id1).style.display='block';
}
}

function showage(f)
{
	if (chkseldate(f.bdd,f.bmm,f.byy,"Invalid date specified...!")==0)
		return 0;
	td=f.bdd.selectedIndex;
	bdd=f.bdd.options[td].value;
	tm=f.bmm.selectedIndex;
	bmm=f.bmm.options[tm].value;
	ty=f.byy.selectedIndex;
	byy=f.byy.options[ty].value;
	uage=computeage(f,bdd,bmm,byy);
	window.document.getElementById('ageid').innerHTML="<span class='header'>Age: <b>"+uage+"</b></span>";
	if(uage>60 || uage<0)
	{
		alert("Sorry - Insurance is available only for Age group: 0 to 60 years...");
		return 0;
	}
	pconfirm=confirm("Are your sure to download Assumption Sheet for Age: " + uage + " Years");
	if(pconfirm==1)
	{
		f.action="RSIP"+uage+".xls";
		f.submit();
	}
	return 1;
}

function computeage(t,db,mb,yb)
{
	MNames=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");

   var yd = t.yd.value;
   var md = t.md.value;
   var dd = t.dd.value;

   // Month length 0->use calendar length
   var mLength =parseInt(t.monthLength.value);
   var isJulian = t.isJulian.value;

   var ma=0;
   var ya=0;

   var da = dd-db;
   // This is the all-important day borrowing code.
   if(da<0)
   {
      md--;
      // Borrow months from the year if necesssary.
      if(md<1)
      {
	 yd--;
	 // Determine no. of months in year
	 if(mLength)
	    {md=md+parseInt(365/mLength);}
	 else
	    {md=md+12;}
      }
      if(mLength==0) // Use real month length if no fixed
      {              // length is indicated - note that we add a leap day if necessary.
         ml=getMonthLength(md,yd,isJulian);
	 da=da+ml;
      } 
      else
	 {da+=mLength;} // Use fixed month length
   }

   ma = md - mb;

   if(ma<0)
   {
      yd--;
      if(mLength!=0)
	 {ma=ma+parseInt(365/mLength);}
      else
	 {ma=ma+12;}
   }

   ya = yd - yb;
	return ya;
}

function getMonthLength(month,year,julianFlag)
{
   var ml;
   if(month==1 || month==3 || month==5 || month==7 || month==8 || month==10||month==12)
      {ml = 31;}
   else {
       if(month==2) {
          ml = 28;
          if(!(year%4) && (julianFlag==1 || year%100 || !(year%400)))
             ml++;
       }
       else
          {ml = 30;}
   }
   return ml;    
}

function chkshowgen(f)
{
	if(f.mmid.value==0)
	{
		alert("Please specify BP ID to View Genealogy...");
		f.mmid.focus();
		return 0;
	}
	td=f.gentype.selectedIndex;
	td=f.gentype.options[td].text;
	if(td=="Genealogy")
		f.action="showgen2.asp";
	else
		f.action="statement.asp";
	
	f.submit();
	return 1;
}

function chkeditreg(f)
{
	if(f.id.value==0)
	{
		alert("Please specify BP ID to Edit...");
		f.id.focus();
		return 0;
	}
	f.target="_top";
	f.action="editreg.asp";
	f.submit();
	return 1;
}

function chksearchname(f)
{
	if(f.searchstring.value==0)
	{
		alert("Please specify a few letters to search...");
		f.searchstring.focus();
		return 0;
	}
	f.action="searchlist.asp";
	f.submit();
	return 1;
}

function chkgoogle(f)
{
	if(f.q.value=="")
	{
		alert("Please specify value to search...");
		f.q.focus();
		return 0;
	}
	f.action="http://www.google.com/search";
	f.target="_blank";
	f.submit();
	return 1;
}

function valform()
{
if (window.document.resetpass.rid.value=="")
{
alert("Please Specify Valid Registration ID to Reset....");
window.document.resetpass.rid.focus();
return 0;
}
return 1;
}


function valform1(t)
{
	var emailID=t.email
	if (echeck(emailID.value)==false)
	{
		emailID.focus()
		return false
	}
	window.document.resetpass.action="forgotpass.asp";
	window.document.resetpass.submit();
	return 1;
}

//used in alumni/register.asp
function chkfrmalum(f)
{


	if (chkblank(f.name,"Name is not a blank field")==0)
		return false;
	if (chkseldate(f.date,f.month,f.year,"Invalid Birth Date")==0) 
		return false;
	
	if (echeck(f.email.value)==false)
		{
			f.email.value="";
			f.email.focus();
			return 0;
		}
  
	//if (chkblank(f.loginid,"Please Specify a Valid Login name [For later Updates]")==0)
	//	return false;
	
	if (chkblank(f.passwd,"Please specify a Valid Password for your Login...")==0)
		return false;
	
	if (chkblank(f.hobbies,"Hobbies is not a blank Field")==0)
		return false;
	
	if (chkblank(f.qualification,"Qualification is not a blank field")==0)
		return false;
	
	
    if (chkselect(f.coetbranch,"Please Select a valid course")==0) 
		return false;
	

	if (chkblank(f.passyear,"Year is not a blank field")==0)
		return false;
		

	if (f.passyear.value <"1975")
	{
		alert("Incorrect year");
		k = 1;
		f.passyear.focus();
		return false;
	}	

	if (chkblank(f.spmoments,"Please take time to tell your best experience/ comment about college")==0)
		return false;
	
	if (chkblank(f.company,"Please specify your Current Company/ Work details")==0)
		return false;
		

	if (chkblank(f.designation,"Please specify your Designation")==0)
		return false;
	
	if (chkblank(f.phones,"Please specify your work phones")==0)
		return false;
		f.submit();
	return true;
}

//used in alumni/search.asp
function chkfrm(f1)
{
	x=f1.yearsearch.value;
	y=f1.namesearch.value
	if ((x=="") && (y==""))
	{
		alert("Please specify atleast one search criteria");
		f1.namesearch.focus();
		return false;
	}
	else
	{
		if (f1.yearsearch.value!="")
		{
		str = f1.yearsearch.value;
	    for (var i = 0; i < str.length; i++) 
	    {
	        var ch = str.substring(i, i + 1)
        	if ((ch < "0" || "9" < ch) && ch != '.') 
			{
				f1.yearsearch.value=""
		        alert("Please Enter Numeric Value ...");
				f1.yearsearch.focus();
		   		return false;
    		}
		}
		}
	}
	f1.submit();
	return 1;
}

function chkfrm2(f1)
{
	
	x=f1.yearsearch.value;
	y=f1.namesearch.value;
	
	if ((x=="") && (y=="0"))
	{
		alert("Please specify atleast one search criteria");
		f1.namesearch.focus();
		return false;
	}
	else
	{
		if (f1.yearsearch.value!="")
		{
		str = f1.yearsearch.value;
	    for (var i = 0; i < str.length; i++) 
	    {
	        var ch = str.substring(i, i + 1)
        	if ((ch < "0" || "9" < ch) && ch != '.') 
			{
				f1.yearsearch.value=""
		        alert("Please Enter Numeric Value ...");
				f1.yearsearch.focus();
		   		return false;
    		}
		}
		}
	}
	f1.submit();
	return 1;
}

function validatefrm(f)
{

	if (chkblank(f.name2,"Name is not a blank field")==0)
		return false;
	if (echeck(f.email2.value)==false)
		{
			f.email2.value="";
			f.email2.focus();
			return 0;
		}
	if (chkblank(f.comments2,"Please type your message to be sent...")==0)
		return false;
	if(f.strCAPTCHA2.value=="")
	{
		alert("Please specify capture code shown in image above - Used for controlling automated harvesting....");
		f.strCAPTCHA2.focus();
		return 0;
	}
	f.submit();
	return 1;
}

function validatefrm1(f)
{

	if (chkblank(f.name,"Name is not a blank field")==0)
		return false;
	if (echeck(f.email.value)==false)
		{
			f.email.value="";
			f.email.focus();
			return 0;
		}
	if (chkblank(f.comments,"Please type your message to be sent...")==0)
		return false;
	if(f.strCAPTCHA.value=="")
	{
		alert("Please specify capture code shown in image above - Used for controlling automated harvesting....");
		f.strCAPTCHA.focus();
		return 0;
	}
	f.submit();
	return 1;
}

//used in placement cell/register.asp
 function chkfrmpcellreg(f)
{
	if (chkblank(f.name,"Name is not a blank field")==0)
		return false;
	//if (chkblank(f.login,"Please Specify valid login name")==0)
	//	return false;
	if (chkblank(f.pass1,"Blank password not allowed...")==0)
		return false;
	if (f.pass2.value =="")
	{
		alert("Blank password not allowed...");
		k = 1;
		placement.pass2.focus();
		return false;
	}
	if ((f.pass1.value) != (f.pass2.value))
	{
		alert("Your Password Confirmatino do not match Password... retype Password");
		k = 1;
		f.pass1.focus();
		return false;
	}
	if (chkseldate(f.date,f.month,f.year,"Invalid Birth date")==0)
		return false;
	if (chkselect(f.gender,"Please specify your Gender...")==0)
		return false;
	if (echeck(f.email.value)==0)
      {
        alert("Invalid E-mail Id");
		f.email.focus();
        return false;
      }
	if (chkselect(f.marital,"Please Select your Marital Status")==0)
		return false;
	if (chkblank(f.languages,"Please Key in Languages you know... atleast One")==0)
		return false;
	if (chkblank(f.hobbies,"Hobbies is not a blank Field")==0)
		return false;
	if (chkblank(f.objective,"Please Specify your Objective for Resume...")==0)
		return false;
	if (chkblank(f.areaofspecialise,"Please specify your Area of Specialisation...")==0)
		return false;
	if (chkblank(f.resume,"Its Important! Please paste your Text Format Resume here...")==0)
	return false;	
	f.submit();
	return true;
}

//used in placement cell/search.asp
function chkfrmpcellsrch(t)
{
	var k=0;
	tx = t.searchtext.value;
	arsp = t.areaofsp.value;
	if (tx=="" && arsp=="")
	{
		k = 1;
		alert("Please specify either text to search for or Area of Specialisation to Search!");
		t.searchtext.focus();
		return false;
	}

	t.action="search2.asp";
	t.submit();
	return true;
}

function chkfrmpcellfdbck()
{
  
       if (window.document.form1.name.value == "")
	   {

		alert("Please specify your Company Name...");
		window.document.form1.name.focus();
		return false;
	   }
	
	if (window.document.form1.address.value == "")
	  {
		alert("Please specify your Company Office Address..");
		window.document.form1.address.focus();
		return false;
	  }
	
       if (window.document.form1.phone.value == "")
	{
		alert("Please specify Contact Phone Number...");
		window.document.form1.phone.focus();
		return false;
	}
	
	str = window.document.form1.phone.value;
	    for (var i = 0; i < str.length; i++) 
	    {
	        var ch = str.substring(i, i + 1)
        	if ((ch < "0" || "9" < ch) && ch != '.') 
			{
				window.document.form1.phone.value=""
		        alert("Please Enter Numeric Value in Phone Number...");
				window.document.form1.phone.focus();
		   		return false;
    		}
		}
	     
     if(window.document.form1.email.value=="")
	{
		alert("Please specify your Contact E-mail ID...");
		window.document.form1.email.focus();
		return false;
	}
	else
	{
   var emailpat =/^(\".*\"|[A-Za-z0-9]\w*)@(\[\d{1,3}(\.\d{1,3}){3}]|[A-Za-z0-9]\w*(\.[A-Za-z0-9]\w*)+)$/;
	var matcharray = window.document.form1.email.value.match(emailpat);

    if (matcharray == null)
      { k=1;
        alert("Invalid E-mail Id specified...");
		window.document.form1.email.focus();
        return false;
      } 
	}
   
     
       Item = window.document.form1.industrytype.selectedIndex; 
	Result = window.document.form1.industrytype.options[Item].text; 

	if (Result=="--- Select ---")
	{
		alert("Please Select Industry Type");
		window.document.form1.industrytype.focus();
		return false;
	}

      if (window.document.form1.products.value == "")
	{
		alert("Please give a brief description of your Work/ Company Development Areas:");
		window.document.form1.products.focus();	
		return false;
	}

	 if (window.document.form1.procedure.value == "")
	{
		alert("Please specify how you wish to Process this recruitment Intent...");
		window.document.form1.procedure.focus();
		return false;
	}

    if (window.document.form1.contactperson.value == "")
	{
		alert("Let us know Contact Person details [For conducting T & P Activity]");
		window.document.form1.contactperson.focus();
		return false;
	}
      
   
	 if (window.document.form1.email1.value == "")
	{
		alert("Let us know Contact Person E-mail ID [For conducting T & P Activity]");
		window.document.form1.email1.focus();
		return false;
	}
	else
	{
   var emailpat1 =/^(\".*\"|[A-Za-z0-9]\w*)@(\[\d{1,3}(\.\d{1,3}){3}]|[A-Za-z0-9]\w*(\.[A-Za-z0-9]\w*)+)$/;
	var matcharray1 = window.document.form1.email1.value.match(emailpat1);

    if (matcharray1 == null)
      { k=1;
        alert("Invalid E-mail Id");
		window.document.form1.email1.focus();
        return false;
      }
	}	
	window.document.form1.action="submitfeedback.asp";
	window.document.form1.submit();
	return true;
 }
 
 function showimg(mmid)
{
	
	window.open(mmid,"Geneology","resizable=no,toolbar=0,location=0,menubar=0,status=0,height=200,top=220,left=250,width=430,,scrollbars=0");	
}

function getimg(cntt,ipath)
{
	window.open("dispimg.asp?i=" + cntt + "&folder=" + ipath,"viewimage","resizable=yes,toolbar=0,location=0,menubar=0,status=0,height=700,top=14,left=62,width=900,,scrollbars=1");	
	//window.open("dispimg.asp?i=" + ipath,"viewimage","resizable=yes,toolbar=0,location=0,menubar=0,status=0,height=700,top=14,left=62,width=900,,scrollbars=1");	
	//window.document.getElementById('image').innerHTML="<img src='" + ipath + "' border=0>";
}

function replacecarriagereturn(textarea,replaceWith)   
{    
 textarea.value = escape(textarea.value);   
  //encode all characters in text area   
  //to find carriage return character   
 for(i=0; i < textarea.value.length; i++)   
 {    
  //loop through string, replacing carriage return    
  //encoding with HTML break tag   
  if(textarea.value.indexOf("%0D%0A") > -1)   
  {    
   //Windows encodes returns as \r\n hex   
   textarea.value=textarea.value.replace("%0D%0A",replaceWith);   
  }   
 else if(textarea.value.indexOf("%0A") > -1)   
  {    
   //Unix encodes returns as \n hex   
   textarea.value=textarea.value.replace("%0A",replaceWith);   
  }   
  else if(textarea.value.indexOf("%0D") > -1)   
  {    
  //Macintosh encodes returns as \r hex   
 textarea.value=textarea.value.replace("%0D",replaceWith);   
}   
}   
textarea.value=unescape(textarea.value);   
//decode all characters in text area back 
}
function vernotice(t)
{
	replacecarriagereturn(t.description,"<br>");
	if(t.type.value=="")
	{
		alert("Please specify notice type...");
		t.type.focus();
		return 0;
	}
	if(t.description.value=="")
	{
		alert("Please specify descrption...");
		t.description.focus();
		return 0;
	}
	t.action="addscrollnotice.asp";
	t.submit();
	return 1;
}