// 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] = '/activities/classlearning.jpg'
Pic[1] = '/activities/lab.jpg'
Pic[2] = '/activities/library.jpg'
Pic[3] = '/activities/students.jpg'
Pic[4] = '/activities/entry.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 validatefrm(t,secverify)
{

	if(t.name.value=="")
	{
		alert("Please specify your Name....");
		t.name.focus();
		return 0;
	}
	var emailID=t.email
	if (echeck(emailID.value)==false)
	{
		emailID.value=""
		emailID.focus()
		return false
	}
	Item = t.deptname.selectedIndex; 
	Result1 = t.deptname.options[Item].text; 

    if (Result1 == "---- Select ----") 
	{
		alert("Please specify desired Department you wish to write query to....");
		t.deptname.focus();
		return false;
	}

	if(secverify==0)
	{
	Item = t.querytype.selectedIndex; 
	Result1 = t.querytype.options[Item].text; 

    if (Result1 == "--- Select ---") 
	{
		alert("Please specify your query type - Use OTHER if category not available....");
		t.querytype.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 setpinnacle(t)
{
	Item = t.participatingevent.selectedIndex; 
	Result1 = t.participatingevent.options[Item].text; 
	eventname=Result1;
	
	if(eventname=="Paper-Presentation")
	{
		if(t.name2.value!="")
			t.payamount.value=100;
		else	
			t.payamount.value=200;		
	}
	
	if(eventname!="Paper-Presentation")
	{
		t.papertitle.disabled = true;
		t.paperabstract.disabled = true;
	}
	else
	{
		t.papertitle.disabled = false;
		t.paperabstract.disabled = false;
	}
	
	if(eventname=="Software-Exhibition")
		t.payamount.value=200;

	if(eventname=="Personality-Contest")
		t.payamount.value=100;

	if(eventname=="IT-Quiz")
		t.payamount.value=100;

	return true;
}
function pinnacle(t)
{

	if(t.name1.value=="")
	{
		alert("Please specify registrant#1 name....");
		t.name1.focus();
		return 0;
	}
	testASP(t.name1.value);
	testASP(t.name2.value);
	Item = t.participatingevent.selectedIndex; 
	Result1 = t.participatingevent.options[Item].text; 
	eventname = Result1;
	
    if (Result1 == "----- select -----") 
	{
		alert("Please specify event name you wish to participate in...Use one submission per event.");
		t.participatingevent.focus();
		return false;
	}
	setpinnacle(t);
	
	if(t.collname.value=="")
	{
		alert("Please specify your institute/ college name....");
		t.collname.focus();
		return 0;
	}
	testASP(t.collname.value);
	if(t.postaladdress.value=="")
	{
		alert("Please specify your correspondence/ permanent address....");
		t.postaladdress.focus();
		return 0;
	}
	testASP(t.postaladdress.value);

	var emailID=t.email
	if (echeck(emailID.value)==false)
	{
		emailID.value=""
		emailID.focus()
		return false
	}
	testASP(t.email.value);

	if(t.phones.value=="")
	{
		alert("Please specify your contact mobile/ landline phone numbers....");
		t.phones.focus();
		return 0;
	}
	testASP(t.phones.value);

	if(eventname=="Paper-Presentation")
	{
		if(t.papertitle.value=="")
		{
			alert("Please specify your Paper Title....");
			t.papertitle.focus();
			return 0;
		}
		testASP(t.papertitle.value);
		strr=t.paperabstract.value;
		ln=strr.length;
		s1=strr.substring(ln-4,ln);
		if(strr=="")
		{
			alert("Please Upload your Paper Abstract in DOC/ PDF format....");
			t.paperabstract.focus();
			return 0;
		}
		testASP(t.paperabstract.value);

		if(ln>0)
		{
			if(s1!=".doc" && s1!=".DOC" && s1!=".pdf" && s1!=".PDF")
			{
				alert("Supported file extension is DOC - Microsoft Word Document or PDF - Adobe Acrobat Software");
				t.paperabstract.focus();
				return false;	
			}
		}
	}
	Item = t.paymode.selectedIndex; 
	Result1 = t.paymode.options[Item].text; 
    if (Result1 == "----- select -----") 
	{
		alert("Please specify payment mode...");
		t.paymode.focus();
		return false;
	}
	if(t.paydetails.value=="")
	{
		alert("Please specify payment details...");
		t.paydetails.focus();
		return false;
	}
	testASP(t.paydetails.value);
	if(Result1=="Cash")
		alert("Please make sure this Cash Payment reaches us before deadline as mentioned above...");
	if(Result1=="Demand Draft")
		alert("Please draw demand draft favoring G. H. Raisoni Institute of Information Technology payable at Jalgaon...");
	if(Result1=="At Par Cheque")
		alert("Please make sure that this cheque is payable at Par and your bank has branch in JALGAON...");

	t.submit();		
	return true;
}

function valalumni(t)
{
  if(t.name.value=="")
  {
  alert("Please Specify your full name...");
  t.name.focus();
  return false;
  }
  Item = t.dd.selectedIndex; 
	Result = t.dd.options[Item].text; 

	if (Result=="DD")
	{
		alert("Please select Birth date...");
		t.dd.focus();
		return false;
	}

	Item = t.mm.selectedIndex; 
	Result = t.mm.options[Item].text; 

	if (Result=="MM")
	{
		alert("Please select Month...");
		t.mm.focus();
		return false;
	}
	Item = t.yy.selectedIndex; 
	Result = t.yy.options[Item].text; 

	if (Result=="YYYY")
	{
		alert("Please select year ...");
		t.yy.focus();
		return false;
	}
        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 = t.email.value.match(emailpat);
        if (matcharray == null)
          { 
             k=1;
              alert("Invalid E-mail Id");
			t.email.focus();
               return false;
          }

/*
  if(t.login.value=="")
  {
  alert("Please Specify your login name...");
  t.login.focus();
  return false;
  }
  if(t.password.value=="")
  {
  alert("Please specify your password...");
  t.password.focus();
  return false;
  }
  if(t.conpass.value=="")
  {
  alert("Please repeat your password for confirmation...");
  t.conpass.focus();
  return false;
  }
  if((t.password.value)!=(t.conpass.value))
  {
  alert("Password doesnot match..Please Specify the correct password...");
  t.conpass.focus();
  return false;
  }
*/
  if(t.address.value=="")
  {
  alert("Please Enter your address...");
  t.address.focus();
  return false;
  }
  if(t.telephone.value=="")
  {
  alert("Please specify your working telephone no...");
  t.telephone.focus();
  return false;
  }
  if(t.hobbies.value=="")
  {
  alert("Please specify your hobbies...");
  t.hobbies.focus();
  return false;
  }
 
  if(t.qualification.value=="")
  {
  alert("Please Specify your Educational Qualification...");
  t.qualification.focus();
  return false;
  }
  Item = t.course.selectedIndex; 
  Result = t.course.options[Item].text; 
	
	if(Result=="-- Select --")
	{
		alert("Please select Branch...");
		t.course.focus();
		return false;
	}
  if(t.qualification.value=="")
  {
  alert("Please specify your qualification...");
  t.qualification.focus();
  return false;
  }
  if(t.passyear.value=="")
  {
  alert("Please specify passout year from college...");
  t.passyear.focus();
  return false;
  }
  if(t.collegemoments.value=="")
  {
  alert("Please specify college moments...");
  t.collegemoments.focus();
  return false;
  }
  if(t.suggestions.value=="")
  {
  alert("Please write your suggestions...");
  t.suggestions.focus();
  return false;
  }
  t.action="registersave.asp";
  t.submit();
  return true;
}

function totyear(t,getyear)
{
sem="t.sem";
outsem="t.outsem";
sem1=sem+(getyear*2)+".value";
sem2=sem+(getyear*2-1)+".value";
outsem1=outsem+(getyear*2)+".value";
outsem2=outsem+(getyear*2-1)+".value";
texp="tyear=eval("+sem1+")+eval("+sem2+");";
toexp="toyear=eval("+outsem1+")+eval("+outsem2+");";
eval(texp);
eval(toexp);
tyr="t.tmark"+getyear+".value="+tyear;
tyr2="t.outyear"+getyear+".value="+toyear;
tyr3="t.percent"+getyear+".value="+eval(tyear/(toyear/100));
eval(tyr);
eval(tyr2);
eval(tyr3);
return 1;
}
function validresume(t)
{
  if(t.name.value=="")
  {
  alert("Please enter your full name...");
  t.name.focus();
  return false;
  }
/*
  if(t.login.value=="")
  {
  alert("Please Specify your login name...");
  t.login.focus();
  return false;
  }
  if(t.password.value=="")
  {
  alert("Please specify your password...");
  t.password.focus();
  return false;
  }
  if(t.conpass.value=="")
  {
  alert("Please repeat your password for confirmation...");
  t.conpass.focus();
  return false;
  }
  if(t.conpass.value!=t.password.value)
  {
  alert("Confirmation Password does not match Original Password...");
  t.conpass.focus();
  return false;
  }
*/
  	Item = t.dd.selectedIndex; 
	Result = t.dd.options[Item].text; 

	if (Result=="DD")
	{
		alert("Please select Birth date...");
		t.dd.focus();
		return false;
	}

	Item = t.mm.selectedIndex; 
	Result = t.mm.options[Item].text; 

	if (Result=="MM")
	{
		alert("Please select Month...");
		t.mm.focus();
		return false;
	}
	Item = t.yy.selectedIndex; 
	Result = t.yy.options[Item].text; 

	if (Result=="YYYY")
	{
		alert("Please select year ...");
		t.yy.focus();
		return false;
	}

  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 = t.email.value.match(emailpat);
  if (matcharray == null)
	{ 
		k=1;
		alert("Invalid E-mail Id");
		t.email.focus();
		return false;
	}

  if(t.address.value=="")
  {
  alert("Please Enter your address...");
  t.address.focus();
  return false;
  }

  if(t.languages.value=="")
  {
  alert("Please specify known languages ...");
  t.languages.focus();
  return false;
  }
  if(t.hobbies.value=="")
  {
  alert("Please specify your hobbies...");
  t.hobbies.focus();
  return false;
  }
  if(t.skills.value=="")
  {
  alert("Please specify your personal skills...");
  t.skills.focus();
  return false;
  }
  Item = t.curyear.selectedIndex; 
  curyear = t.curyear.options[Item].text; 
	
	if(curyear=="--Select--")
	{
		alert("Please select Degree...");
		t.curyear.focus();
		return false;
	}

  Item = t.course.selectedIndex; 
  Result = t.course.options[Item].text; 
	
	if(Result=="--Select--")
	{
		alert("Please select course...");
		t.course.focus();
		return false;
	}
	/* Year Values */
	for(jjj=1;jjj<=3;jjj++)
	{
		kkk=jjj*2;
		exp1="year"+jjj+"=t.year"+jjj+".value";
		exp2="sem"+kkk+"=t.sem"+kkk+".value";
		exp3="outsem"+kkk+"=t.outsem"+kkk+".value";
		exp4="sem"+(kkk-1)+"=t.sem"+(kkk-1)+".value";
		exp5="outsem"+(kkk-1)+"=t.outsem"+(kkk-1)+".value";
		exp6="tmark"+jjj+"=t.tmark"+jjj+".value";
		exp7="outyear"+jjj+"=t.outyear"+jjj+".value";
		exp8="percent"+jjj+"=t.percent"+jjj+".value";
		eval(exp1);
		eval(exp2);
		eval(exp3);
		eval(exp4);
		eval(exp5);
		eval(exp6);
		eval(exp7);
		eval(exp8); 
	}

  Item2 = t.course.selectedIndex; 
  Result2 = t.course.options[Item2].value; 

		if(Result2=="M.C.A.")
		{
		if((curyear=="PASSED" || curyear=="MCA Third") && (year3==0 || sem5<=0 || outsem5 <=0 || sem6<=0 || outsem6<=0 || tmark3<=0 || outyear3<=0 || percent3<=0))
		{
			alert("Please specify your Third Year Semester-5 and Semster-6 Marks with Total and Percentage...");
			t.year3.focus();
			return 0;
		}
		if((curyear=="PASSED" || curyear=="MCA Third" || curyear=="MCA Second") && (year2==0 || sem3<=0 || outsem3 <=0 || sem4<=0 || outsem4<=0 || tmark2<=0 || outyear2<=0 || percent2<=0))
		{
			alert("Please specify your Second Year Semester-3 and Semster-4 Marks with Total and Percentage...");
			t.year2.focus();
			return 0;
		}
		if((curyear=="PASSED" || curyear=="MCA Third" || curyear=="MCA Second" || curyear=="MCA First") && (year1==0 || sem1<=0 || outsem1 <=0 || sem2<=0 || outsem2<=0 || tmark1<=0 || outyear1<=0 || percent1<=0))
		{
			alert("Please specify your First Year Semester-1 and Semster-2 Marks with Total and Percentage...");
			t.year1.focus();
			return 0;
		}
		}
	if(curyear=="MCA First")
		lll=1
	if(curyear=="MCA Second")
		lll=2
	if(curyear=="MCA Third")
		lll=3
	if(curyear=="PASSED")
		lll=5

	for(jjj=3;jjj>=lll;jjj--)
	{
		kkk=jjj*2;
		exp1="t.year"+jjj+".value=''";
		exp2="t.sem"+kkk+".value=''";
		exp3="t.outsem"+kkk+".value=''";
		exp4="t.sem"+(kkk-1)+".value=''";
		exp5="t.outsem"+(kkk-1)+".value=''";
		exp6="t.tmark"+jjj+".value=''";
		exp7="t.outyear"+jjj+".value=''";
		exp8="t.percent"+jjj+".value=''";
		eval(exp1);
		eval(exp2);
		eval(exp3);
		eval(exp4);
		eval(exp5);
		eval(exp6);
		eval(exp7);
		eval(exp8); 
	}

  if(t.objective.value=="")
  {
  alert("Please specify your objective...");
  t.objective.focus();
  return false;
  }
  if(t.areaofspecial.value=="")
  {
  alert("Please specify your areas of specialisations...");
  t.areaofspecial.focus();
  return false;
  }
  if(t.resume.value=="")
  {
  alert("Please paste your resume here...");
  t.resume.focus();
  return false;
  }
  t.action="registersave.asp";
  t.submit();
  return true;
}

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 getimg(ipath)
{
	window.open("display.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 chkfiletype(frm)
{
		strr=frm.url1.value;
		ln=strr.length;
		s1=strr.substring(ln-4,ln);
		if(strr=="")
		{
			alert("Please specify upload file name....");
			frm.url1.focus();
			return 0;
		}
		if(ln>0)
		{
			if(s1==".exe" || s1==".com" || s1==".bat"  || s1==".dll" || s1==".EXE" || s1==".COM" || s1==".BAT" || s1==".DLL")
			{
				alert("Executable/ Command/ Batch/ DLL files are not allowed for document upload...");
				frm.url1.focus();
				return false;	
			}
		}
	frm.action="adminfo.asp";
	frm.submit();
	return 1;	
}

function pinnacledelete(frm,delid,delname)
{
	pp=confirm("Are you sure to delete " + delid + " - " + delname + "?\nRegistration once deleted cannot be recovered...");
	if(pp==1)
	{
		frm.delid.value=delid;
		frm.action="pinnacledelete.asp";
		frm.submit();
	}
	return 1;
}

function confirmdelete(frm,filenm)
{
	pp=confirm("Are you sure to delete " + filenm + "?\nFile once deleted cannot be recovered...");
	if(pp==1)
	{
		frm.filevalue.value=filenm;
		frm.submit();
	}
	return 1;
}