// script for view search option
function viewoption_validate()
{
	var Typeview=document.viewsearch_continuefrm.Typeview.length;

             var i=0;
            if(Typeview > 1){
                for(GenIndex = 0; GenIndex < Typeview; GenIndex++ ){
                    if(document.viewsearch_continuefrm.Typeview[GenIndex].checked == false){
                        i=i+1;
                    }
                }
            }
            if(i==Typeview)
            {
               alert("Please select the option Homes or Videos");
                return false;
            }

}


// script for register option
function regoption_validate()
{
	
	var varType=document.register_continuefrm.varType.length;

             var i=0;
            if(varType > 1){
                for(GenIndex = 0; GenIndex < varType; GenIndex++ ){
                    if(document.register_continuefrm.varType[GenIndex].checked == false){
                        i=i+1;
                    }
                }
            }
            if(i==varType)
            {
               alert("Please select the option Displayer or Voter");
                return false;
            }

}

//SCRIPT FOR Subscriber

function subscriber_validation()

{

		 if (document.CustomersForm.varName.value== "" )

		 { 

			 alert ("Please Enter your Name");

			 document.CustomersForm.varName.focus();

			 return false;

		 }

		 if (document.CustomersForm.varEmail.value== "" )

		 { 

			 alert ("Please Enter Your E-mail Address");

			 document.CustomersForm.varEmail.focus();

			 return false;

		 }

		  if (!validateEmail(document.CustomersForm.varEmail.value,1,1)) 

		 {

		 document.CustomersForm.varEmail.focus();

		 return false;

		 }

varReceiveletter=document.CustomersForm.varReceiveletter.length;

             var i=0;
            if(varReceiveletter > 1){
                for(GenIndex = 0; GenIndex < varReceiveletter; GenIndex++ ){
                    if(document.CustomersForm.varReceiveletter[GenIndex].checked == false){
                        i=i+1;
                    }
                }
            }
            if(i==varReceiveletter)
            {
           alert("Please click the Receive Newsletter option");
                return false;
            }
		

}


// Contact Us validation
function contactus_validate()
{
var varFirstname=document.contactfrm.varFirstname.value;
if(varFirstname=="")
{
alert("Please enter the First name");
document.contactfrm.varFirstname.focus();
return false;
}

var varSurname=document.contactfrm.varSurname.value;
if(varSurname=="")
{
alert("Please enter the Last name");
document.contactfrm.varSurname.focus();
return false;
}

var varEmail=document.contactfrm.varEmail.value;
if(varSurname=="")
{
alert("Please enter the email");
document.contactfrm.varEmail.focus();
return false;
}

 if (!validateEmail(document.contactfrm.varEmail.value,1,1)) 

	 {

	 document.contactfrm.varEmail.focus();

	 return false;

	 }

var varComments=document.contactfrm.varComments.value;
if(varComments=="")
{
alert("Please enter Your Comments");
document.contactfrm.varComments.focus();
return false;
}

}
//Voting Form Validation


function voting_validate()
{
	
	
	txtshownamelength = document.voting_frm.voting.length;
             var i=0;
            if(txtshownamelength > 1){
                for(GenIndex = 0; GenIndex < txtshownamelength; GenIndex++ ){
                    if(document.voting_frm.voting[GenIndex].checked == false){
                        i=i+1;
                    }
                }
            }
            if(i==txtshownamelength)
            {
                alert("Please select the Voting rate");
                return false;
            }
			
	var f_captcha=document.voting_frm.f_captcha.value;

if(f_captcha=="")

{

alert("Please enter the captcha code");

document.voting_frm.f_captcha.focus();

return false;

}
}

//Edit Home

function edithome()
{
	var varHomename=document.homefrm.varHomename.value;

if(varHomename=="")

{

alert("Please enter the home");

document.homefrm.varHomename.focus();

return false;

}

var varstreet=document.homefrm.varstreet.value;

if(varstreet=="")

{

alert("Please enter the street");

document.homefrm.varstreet.focus();

return false;

}


var varTown=document.homefrm.varTown.value;

if(varTown=="")

{

alert("Please enter the Town");

document.homefrm.varTown.focus();

return false;

}

var varState=document.homefrm.varState.value;

if(varState=="")

{

alert("Please select the state");

document.homefrm.varState.focus();

return false;

}

var varPostcode=document.homefrm.varPostcode.value;

if(varPostcode=="")

{

alert("Please enter the postcode");

document.homefrm.varPostcode.focus();

return false;

}




}

//Add Home

function addhome()
{
	var varHomename=document.homefrm.varHomename.value;

if(varHomename=="")

{

alert("Please enter the home");

document.homefrm.varHomename.focus();

return false;

}

var varstreet=document.homefrm.varstreet.value;

if(varstreet=="")

{

alert("Please enter the Street");

document.homefrm.varstreet.focus();

return false;

}


var varTown=document.homefrm.varTown.value;

if(varTown=="")

{

alert("Please enter the Town");

document.homefrm.varTown.focus();

return false;

}

var varState=document.homefrm.varState.value;

if(varState=="")

{

alert("Please select the state");

document.homefrm.varState.focus();

return false;

}

var varPostcode=document.homefrm.varPostcode.value;

if(varPostcode=="")

{

alert("Please enter the postcode");

document.homefrm.varPostcode.focus();

return false;

}

var varHomeimg=document.homefrm.varHomeimg.value;

if(varHomeimg=="")

{

alert("Please upload the thumb image");

document.homefrm.varHomeimg.focus();

return false;

}

var varEnlargeimg=document.homefrm.varEnlargeimg.value;

if(varEnlargeimg=="")

{

alert("Please upload the Large image");

document.homefrm.varEnlargeimg.focus();

return false;

}

}

//popup

function imagepopup(val)

{



var url=val;

	width=screen.width;

	height=screen.height;

	center=width/2;

	center1=height/2;

	//leftpos=center-122;

	//toppos=center1-95;

	newwindow=window.open(url,'imagedisplay','height=450,width=700,resizable=yes,scrollbars=yes,align=center');

	if (window.focus) {newwindow.focus()}

}




//SCRIPT FOR PROFILE RATING

function rating_validate()

{

var intProfilerate=document.ratingfrm.intProfilerate.value;

if(intProfilerate=="")

{

alert("Please select the Profile rate");

document.ratingfrm.intProfilerate.focus();

return false;

}

var varComments=document.ratingfrm.varComments.value;

if(varComments=="")

{

alert("Please enter the comment");

document.ratingfrm.varComments.focus();

return false;

}

}



//delete function

function calldel(m)

{

  if(!confirm(m))

  {

    return false;

  }

  else

  return true;

}



//popup

function imagepopup(val)

{



var url=val;

	width=screen.width;

	height=screen.height;

	center=width/2;

	center1=height/2;

	//leftpos=center-122;

	//toppos=center1-95;

	newwindow=window.open(url,'imagedisplay','height=450,width=700,resizable=yes,scrollbars=yes,align=center');

	if (window.focus) {newwindow.focus()}

}





// EDIT PICTURE FORM VALI8DATION

function picture_validate1()

{

	var varPicturename=document.picturefrm.varPicturename.value;

if(varPicturename=="")

{

alert("Please enter the picture name");

document.picturefrm.varPicturename.focus();

return false;

}



}

//ADD PICTURE FORM VALIDATION

function picture_validate()

{

	var varPicturename=document.picturefrm.varPicturename.value;

if(varPicturename=="")

{

alert("Please enter the picture name");

document.picturefrm.varPicturename.focus();

return false;

}



var varThumbimg=document.picturefrm.varThumbimg.value;

if(varThumbimg=="")

{

alert("Please upload the picture");

document.picturefrm.varThumbimg.focus();

return false;

}

}





// ADD VIDEO FORM VALIDATION



function video_validate()

{

var varvideoname=document.videofrm.varvideoname.value;

if(varvideoname=="")

{

alert("Please enter the video name");

document.videofrm.varvideoname.focus();

return false;

}



var varThumbimg=document.videofrm.varThumbimg.value;

if(varThumbimg=="")

{

alert("Please upload the picture");

document.videofrm.varThumbimg.focus();

return false;

}



var varVideofile=document.videofrm.varVideofile.value;

if(varVideofile=="")

{

alert("Please upload the Video File");

document.videofrm.varVideofile.focus();

return false;

}



}



// EDIT VIDEO FORM VALIDATION



function video_validate1()

{

var varvideoname=document.videofrm.varvideoname.value;

if(varvideoname=="")

{

alert("Please enter the video name");

document.videofrm.varvideoname.focus();

return false;

}

}

//CHANGE PASSWORD FORM VALIDATION

function changepwd()

{



var txtPassword=document.changepassword.Password1.value;

if(txtPassword=="")

{

alert("Please enter the Password");

document.changepassword.Password1.focus();

return false;

}

var txtNewpassword=document.changepassword.txtNewpassword.value;

if(txtNewpassword=="")

{

alert("Please enter the New Password");

document.changepassword.txtNewpassword.focus();

return false;

}

var txtConfirm=document.changepassword.txtConfirm.value;

if(txtConfirm=="")

{

alert("Please enter the Confirm Password");

document.changepassword.txtConfirm.focus();

return false;

}



if(txtConfirm!=txtNewpassword)

{

alert("Confirm password must be same with new password");

document.changepassword.txtConfirm.focus();

return false;

}

}





// FORGOT PASSWORD FORM VALIDATION 

function forgotpwd()

{

	

		if (document.forgotpwd_frm.Username.value=="" )

		 { 

			 alert ("Please enter the username");

			 document.forgotpwd_frm.Username.focus();

			 return false;

		 }

		 

		 

}

function calldel(m)

{

  if(!confirm(m))

  {

    return false;

  }

  else

  return true;

}


function login_validate1()
{
var txtUsername1=document.loginfrms.varUsername1.value;

if(document.loginfrms.varUsername1.value=="")

{

alert("Please enter the Username");

document.loginfrms.varUsername1.focus();

return false;

}



var varPassword1=document.loginfrms.varPassword1.value;

if(varPassword1=="")

{

alert("Please enter the password");

document.loginfrms.varPassword1.focus();

return false;

}
}



//script for login form



function login_validate()

{



var txtUsername=document.loginfrm.varUsername.value;

if(txtUsername=="")

{

alert("Please enter the Username");

document.loginfrm.varUsername.focus();

return false;

}



var varPassword=document.loginfrm.varPassword.value;

if(varPassword=="")

{

alert("Please enter the password");

document.loginfrm.varPassword.focus();

return false;

}


txtshownamelength = document.loginfrm.chk.length;
             var i=0;
            if(txtshownamelength > 1){
                for(GenIndex = 0; GenIndex < txtshownamelength; GenIndex++ ){
                    if(document.loginfrm.chk[GenIndex].checked == false){
                        i=i+1;
                    }
                }
            }
            if(i==txtshownamelength)
            {
                alert("Please select the Type");
                return false;
            }


	/* if(!((document.loginfrm.chk1.checked) || (document.loginfrm.chk2.checked)))
	{
		alert("Please select atleast one checkbox");

document.loginfrm.chk1.focus();

return false;

	}*/
}


//This is for Register form





function membervalidate(bad,badcount)

{

/*var varType=document.studentfrm.varType.value;

if(varType=="")

{

alert("Please select the Type");

document.studentfrm.varType.focus();

return false;

}*/

var varFirstname=document.studentfrm.varFirstname.value;

if(varFirstname=="")

{

alert("Please enter the First Name");

document.studentfrm.varFirstname.focus();

return false;

}



  var  addr= document.studentfrm.varFirstname.value;
  var bad= bad;
var badcount=badcount;

var splitbad=bad.split("-");
for(s=1;s<=badcount;s++) {
   var invalidChars = splitbad[s];
   db=1;
	for (i=0; i<invalidChars.length; i++) {
	   if (addr.indexOf(invalidChars) > -1) {
		  if (db) alert('First name contains invalid characters');
		  return false;
	   }
	}
}

var varLastname=document.studentfrm.varSurname.value;

if(varLastname=="")

{

alert("Please enter the Surname");

document.studentfrm.varSurname.focus();

return false;

}

  var  addr= document.studentfrm.varSurname.value;
  var bad= bad;
var badcount=badcount;

var splitbad=bad.split("-");
for(s=1;s<=badcount;s++) {
   var invalidChars = splitbad[s];
   db=1;
	for (i=0; i<invalidChars.length; i++) {
	   if (addr.indexOf(invalidChars) > -1) {
		  if (db) alert('Sur name contains invalid characters');
		  return false;
	   }
	}
}


if(document.studentfrm.varPreferred.value=="")

{

alert("Please enter the Preferred Name");

document.studentfrm.varPreferred.focus();

return false;

}

 var  addr= document.studentfrm.varPreferred.value;
  var bad= bad;
var badcount=badcount;

var splitbad=bad.split("-");
for(s=1;s<=badcount;s++) {
   var invalidChars = splitbad[s];
   db=1;
	for (i=0; i<invalidChars.length; i++) {
	   if (addr.indexOf(invalidChars) > -1) {
		  if (db) alert(' Preferred Name contains invalid characters');
		  return false;
	   }
	}
}

var varEmail=document.studentfrm.varEmail.value;

if(varEmail=="")

{

alert("Please enter the Email");

document.studentfrm.varEmail.focus();

return false;

}



 if (!validateEmail(document.studentfrm.varEmail.value,1,1)) 

	 {

	 document.studentfrm.varEmail.focus();

	 return false;

	 }

	

	var varAddress=document.studentfrm.varAddress.value;

if(varAddress=="")

{

alert("Please enter the Address");

document.studentfrm.varAddress.focus();

return false;

}

  var  addr= document.studentfrm.varAddress.value;
  var bad= bad;
var badcount=badcount;

var splitbad=bad.split("-");
for(s=1;s<=badcount;s++) {
   var invalidChars = splitbad[s];
   db=1;
	for (i=0; i<invalidChars.length; i++) {
	   if (addr.indexOf(invalidChars) > -1) {
		  if (db) alert('Address contains invalid characters');
		  return false;
	   }
	}
}

var town=document.studentfrm.varTown.value;
if(document.studentfrm.varTown.value=="")
{
alert("Please enter the Town");
document.studentfrm.varTown.focus();
return false;
}

 var  addr= document.studentfrm.varTown.value;
  var bad= bad;
var badcount=badcount;

var splitbad=bad.split("-");
for(s=1;s<=badcount;s++) {
   var invalidChars = splitbad[s];
   db=1;
	for (i=0; i<invalidChars.length; i++) {
	   if (addr.indexOf(invalidChars) > -1) {
		  if (db) alert('Town contains invalid characters');
		  return false;
	   }
	}
}


if(document.studentfrm.varState.value=="")
{
alert("Please select the state");
document.studentfrm.varState.focus();
return false;
}

if(document.studentfrm.varPostcode.value=="")
{
alert("Please enter the Post Code");
document.studentfrm.varPostcode.focus();
return false;
}
if (isNaN(document.studentfrm.varPostcode.value))

	 { 

	 alert ("Post Code must be numeric");

	 document.studentfrm.varPostcode.focus();

	 return false;

	 }

var intAge=document.studentfrm.intAge.value;

if(intAge=="")

{

alert("Please select the Age");

document.studentfrm.intAge.focus();

return false;

}

 intGender=document.studentfrm.intGender.length;

             var i=0;
            if(intGender > 1){
                for(GenIndex = 0; GenIndex < intGender; GenIndex++ ){
                    if(document.studentfrm.intGender[GenIndex].checked == false){
                        i=i+1;
                    }
                }
            }
            if(i==intGender)
            {
               alert("Please select the Gender");
                return false;
            }

var varPhone=document.studentfrm.varPhone.value;

if(varPhone=="")

{

alert("Please enter the Phone");

document.studentfrm.varPhone.focus();

return false;

}
if (isNaN(document.studentfrm.varPhone.value))

	 { 

	 alert ("Phone number must be numeric");

	 document.studentfrm.varPhone.focus();

	 return false;

	 }

if(document.studentfrm.varMobile.value=="")

{

alert("Please enter the Mobile Number");

document.studentfrm.varMobile.focus();

return false;
}
if (isNaN(document.studentfrm.varMobile.value))

	 { 

	 alert ("Mobile Number  must be numeric");

	 document.studentfrm.varMobile.focus();

	 return false;

	 }

 varReceiveletter=document.studentfrm.varReceiveletter.length;

             var i=0;
            if(varReceiveletter > 1){
                for(GenIndex = 0; GenIndex < varReceiveletter; GenIndex++ ){
                    if(document.studentfrm.varReceiveletter[GenIndex].checked == false){
                        i=i+1;
                    }
                }
            }
            if(i==varReceiveletter)
            {
           alert("Please click the Receive Newsletter option");
                return false;
            }
			
			
			if(document.studentfrm.varTellusabout.value!="") {
			 var  addr= document.studentfrm.varTellusabout.value;
  var bad= bad;
var badcount=badcount;

var splitbad=bad.split("-");
for(s=1;s<=badcount;s++) {
   var invalidChars = splitbad[s];
   db=1;
	for (i=0; i<invalidChars.length; i++) {
	   if (addr.indexOf(invalidChars) > -1) {
		  if (db) alert('Tellus about contains invalid characters');
		  return false;
	   }
	}
} 
			}

			var varPhoto=document.studentfrm.varPhoto.value;

if(varPhoto=="")

{

alert("Please upload your house");

document.studentfrm.varPhoto.focus();

return false;

}


var varUsername=document.studentfrm.varUsername1.value;

if(varUsername=="")

{

alert("Please enter the Username");

document.studentfrm.varUsername1.focus();

return false;

}

var txtPassword=document.studentfrm.varPassword1.value;

if(txtPassword=="")

{

alert("Please enter the Password");

document.studentfrm.varPassword1.focus();

return false;

}

var varConfirm=document.studentfrm.varConfirm.value;

if(varConfirm=="")

{

alert("Please enter the Confirm Password");

document.studentfrm.varConfirm.focus();

return false;

}

if(varConfirm!=txtPassword)

{

alert("Confirm password must be same with password Field");

document.studentfrm.varConfirm.focus();	

return false;

}


if(!(document.studentfrm.varAgree.checked))

{

alert("You must agree the terms and conditions by click the checkbox");

document.studentfrm.varAgree.focus();

return false;

}


}

//This is for myprofile 



// this is for edit voter

function membervalidate1(bad,badcount)

{


var varFirstname=document.studentfrm1.varFirstname.value;

if(varFirstname=="")

{

alert("Please enter the First Name");

document.studentfrm1.varFirstname.focus();

return false;

}

var  addr= document.studentfrm1.varFirstname.value;
  var bad= bad;
var badcount=badcount;
var splitbad=bad.split("-");
for(s=1;s<=badcount;s++) {
   var invalidChars = splitbad[s];
   db=1;
	for (i=0; i<invalidChars.length; i++) {
	   if (addr.indexOf(invalidChars) > -1) {
		  if (db) alert('First name contains invalid characters');
		  return false;
	   }
	}
}

var varLastname=document.studentfrm1.varSurname.value;

if(varLastname=="")

{

alert("Please enter the Surname");

document.studentfrm1.varSurname.focus();

return false;

}
var  addr= document.studentfrm1.varSurname.value;
  var bad= bad;
var badcount=badcount;

var splitbad=bad.split("-");
for(s=1;s<=badcount;s++) {
   var invalidChars = splitbad[s];
   db=1;
	for (i=0; i<invalidChars.length; i++) {
	   if (addr.indexOf(invalidChars) > -1) {
		  if (db) alert('Sur name contains invalid characters');
		  return false;
	   }
	}
}

if(document.studentfrm1.varPreferred.value=="")

{

alert("Please enter the Preferred Name");

document.studentfrm1.varPreferred.focus();

return false;

}
var  addr= document.studentfrm1.varPreferred.value;
  var bad= bad;
var badcount=badcount;

var splitbad=bad.split("-");
for(s=1;s<=badcount;s++) {
   var invalidChars = splitbad[s];
   db=1;
	for (i=0; i<invalidChars.length; i++) {
	   if (addr.indexOf(invalidChars) > -1) {
		  if (db) alert('Preferred name contains invalid characters');
		  return false;
	   }
	}
}

var varEmail=document.studentfrm1.varEmail.value;

if(varEmail=="")

{

alert("Please enter the Email");

document.studentfrm1.varEmail.focus();

return false;

}



 if (!validateEmail(document.studentfrm1.varEmail.value,1,1)) 

	 {

	 document.studentfrm1.varEmail.focus();

	 return false;

	 }
var varAddress=document.studentfrm1.varAddress.value;

if(varAddress!="")

{
	var  addr= document.studentfrm1.varAddress.value;
  var bad= bad;
var badcount=badcount;

var splitbad=bad.split("-");
for(s=1;s<=badcount;s++) {
   var invalidChars = splitbad[s];
   db=1;
	for (i=0; i<invalidChars.length; i++) {
	   if (addr.indexOf(invalidChars) > -1) {
		  if (db) alert('Address contains invalid characters');
		  return false;
	   }
	}
}
}

var varTown=document.studentfrm1.varTown.value;

if(varTown!="")

{
	var  addr= document.studentfrm1.varTown.value;
  var bad= bad;
var badcount=badcount;

var splitbad=bad.split("-");
for(s=1;s<=badcount;s++) {
   var invalidChars = splitbad[s];
   db=1;
	for (i=0; i<invalidChars.length; i++) {
	   if (addr.indexOf(invalidChars) > -1) {
		  if (db) alert('Town contains invalid characters');
		  return false;
	   }
	}
}
}
	/*var varAddress=document.studentfrm.varAddress.value;

if(varAddress=="")

{

alert("Please enter the Address");

document.studentfrm.varAddress.focus();

return false;

}*/


/*var town=document.studentfrm1.varTown.value;
if(document.studentfrm1.varTown.value=="")
{
alert("Please enter the Town");
document.studentfrm1.varTown.focus();
return false;
}*/

/*if(document.studentfrm1.varState.value=="")
{
alert("Please select the state");
document.studentfrm1.varState.focus();
return false;
}*/

if(document.studentfrm1.varPostcode.value=="")
{
alert("Please enter the Post Code");
document.studentfrm1.varPostcode.focus();
return false;
}


if (isNaN(document.studentfrm1.varPostcode.value))

	 { 

	 alert ("Post Code must be numeric");

	 document.studentfrm1.varPostcode.focus();

	 return false;

	 }
var varPhone=document.studentfrm.varPhone.value;

if(varPhone!="")

{

if (isNaN(document.studentfrm1.varPhone.value))

	 { 

	 alert ("Phone Number must be numeric");

	 document.studentfrm1.varPhone.focus();

	 return false;

	 }

}

if(document.studentfrm1.varMobile.value!="")

{

if (isNaN(document.studentfrm1.varMobile.value))

	 { 

	 alert ("Mobile Number must be numeric");

	 document.studentfrm1.varMobile.focus();

	 return false;

	 }
}

/*var intAge=document.studentfrm1.intAge.value;

if(intAge=="")

{

alert("Please select the Age");

document.studentfrm1.intAge.focus();

return false;

}
*/
/* intGender=document.studentfrm.intGender.length;

             var i=0;
            if(intGender > 1){
                for(GenIndex = 0; GenIndex < intGender; GenIndex++ ){
                    if(document.studentfrm.intGender[GenIndex].checked == false){
                        i=i+1;
                    }
                }
            }
            if(i==intGender)
            {
               alert("Please select the Gender");
                return false;
            }*/

/*var varPhone=document.studentfrm.varPhone.value;

if(varPhone=="")

{

alert("Please enter the Phone");

document.studentfrm.varPhone.focus();

return false;

}

if(document.studentfrm.varMobile.value=="")

{

alert("Please enter the Mobile Number");

document.studentfrm.varMobile.focus();

return false;
}


 varReceiveletter=document.studentfrm.varReceiveletter.length;

             var i=0;
            if(varReceiveletter > 1){
                for(GenIndex = 0; GenIndex < varReceiveletter; GenIndex++ ){
                    if(document.studentfrm.varReceiveletter[GenIndex].checked == false){
                        i=i+1;
                    }
                }
            }
            if(i==varReceiveletter)
            {
           alert("Please click the Receive letter option");
                return false;
            }
*/
	if(document.studentfrm1.varTellusabout.value!="") {
			 var  addr= document.studentfrm1.varTellusabout.value;
  var bad= bad;
var badcount=badcount;

var splitbad=bad.split("-");
for(s=1;s<=badcount;s++) {
   var invalidChars = splitbad[s];
   db=1;
	for (i=0; i<invalidChars.length; i++) {
	   if (addr.indexOf(invalidChars) > -1) {
		  if (db) alert('Tellus about contains invalid characters');
		  return false;
	   }
	}
} 
			}
var varUsername=document.studentfrm1.varUsername1.value;

if(varUsername=="")

{

alert("Please enter the Username");

document.studentfrm1.varUsername1.focus();

return false;

}

var txtPassword=document.studentfrm1.varPassword1.value;

if(txtPassword=="")

{

alert("Please enter the Password");

document.studentfrm1.varPassword1.focus();

return false;

}

var varConfirm=document.studentfrm1.varConfirm.value;

if(varConfirm=="")

{

alert("Please enter the Confirm Password");

document.studentfrm1.varConfirm.focus();

return false;

}

if(varConfirm!=txtPassword)

{

alert("Confirm password must be same with password Field");

document.studentfrm1.varConfirm.focus();	

return false;

}


if(!(document.studentfrm1.varAgree.checked))

{

alert("You must agree the terms and conditions by click the checkbox");

document.studentfrm1.varAgree.focus();

return false;

}


}






// Valid Email  Script

function validateEmail(addr,man,db) {

	if (addr == '' && man) {

	   if (db) alert('Email address is mandatory');

	   return false;

	}

	var invalidChars = '\/\'\\ ";:?!()[]\{\}^|';

	for (i=0; i<invalidChars.length; i++) {

	   if (addr.indexOf(invalidChars.charAt(i),0) > -1) {

		  if (db) alert('Email address contains invalid characters');

		  return false;

	   }

	}

	for (i=0; i<addr.length; i++) {

	   if (addr.charCodeAt(i)>127) {

		  if (db) alert("Email address contains non ascii characters.");

		  return false;

	   }

	}

	var atPos = addr.indexOf('@',0);

	if (atPos == -1) {

	   if (db) alert('Email address must contain an @');

	   return false;

	}

	if (atPos == 0) {

	   if (db) alert('Email address must not start with @');

	   return false;

	}

	if (addr.indexOf('@', atPos + 1) > - 1) {

	   if (db) alert('Email address must contain only one @');

	   return false;

	}

	if (addr.indexOf('.', atPos) == -1) {

	   if (db) alert('Email address must contain a period in the domain name');

	   return false;

	}

	if (addr.indexOf('@.',0) != -1) {

	   if (db) alert('period must not immediately follow @ in email address');

	   return false;

	}

	if (addr.indexOf('.@',0) != -1){

	   if (db) alert('period must not immediately precede @ in email address');

	   return false;

	}

	if (addr.indexOf('..',0) != -1) {

	   if (db) alert('two periods must not be adjacent in email address');

	   return false;

	}

	var suffix = addr.substring(addr.lastIndexOf('.')+1);

	if (suffix.length != 2 && suffix != 'com' && suffix != 'net' && suffix != 'org' && suffix != 'edu' && suffix != 'int' && suffix != 'mil' && suffix != 'gov' & suffix != 'arpa' && suffix != 'biz' && suffix != 'aero' && suffix != 'name' && suffix != 'coop' && suffix != 'info' && suffix != 'pro' && suffix != 'museum') {

	   if (db) alert('invalid primary domain in email address');

	   return false;

	}

return true;

}


// add more image for Add Home page

function insertMoreUploadcoms() 
{ 
	
	
	var nUploads = parseInt(document.getElementById('NumberOfUploadcoms').value)+1;		 
	var tbody    = document.getElementById("tabUploadcoms").getElementsByTagName("tbody")[1]; 
	var row      = document.createElement("TR"); 

	
	//insert second <td>
	var cell2 = document.createElement("TD");
	cell2.setAttribute("valign","top");
	cell2.setAttribute("align","left");
	cell2.setAttribute("width","56%");
	//File
	var eInput = document.createElement("INPUT"); 
	eInput.setAttribute("type","file");
	eInput.setAttribute("size","25");
	eInput.setAttribute("name","downloadfilcom" + nUploads);
	eInput.setAttribute("id","downloadfilcom" + nUploads);
	eInput.setAttribute("class","txt1");
	cell2.appendChild(eInput);
	
	
	row.appendChild(cell2); 
	
	
	tbody.appendChild(row);
	document.homefrm.NumberOfUploadcoms.value = nUploads;
	return false;
}







