// JavaScript Document
/* FOR CONTACT US VALIDATION */
function RestChar()
{		
	var Length;
	
	Length=(document.form1.txtdetails.value).length;
	remField = document.getElementById("MyLength");
	if(Length>600)
	{
		alert("String length should be smaller than the limit");
		document.form1.txtdetails.value="";
		(document.form1.txtdetails.value).length=600;
		RestChar();
	}
	else
		remField.innerHTML =600-Length;
	return true;
}
function ValidLength()
{
	if((document.form1.txtdetails.value).length>600)
	{
		alert("Cannot write more");
		document.form1.txtdetails.focus();
		return false;
	}
}

function ValidEntryContactUs()
{
	if(document.form1.txtsubject.value=="")
	{
		alert("Please Enter your subject before you send !!");
		document.form1.txtsubject.focus();
		return false;
	}
	else if(document.form1.txtdetails.value=="")
	{
		alert("Enter Details before you send !!");
		document.form1.txtdetails.focus();
		return false;
	}
    else if(document.form1.txtEmail.value=="")
	{
		alert("Enter your email address before you send !!");
		document.form1.txtEmail.focus();
		return false;
	}
	else if(!document.form1.txtEmail.value.match(/^.+\@.+\..+$/))
	{
		alert("Invalid email address !!");
		document.form1.txtEmail.focus();
		return false;
	}
	
	return true;
}



/* END CONTACT US VALIDATION */





/*function validEentry()
{
		
	if(document.frmCreate.txtFname.value=="")
	{
		alert("Enter Your First Name before you submit!!");
		document.frmCreate.txtFname.focus();
		return false;
	}	
	else if(document.frmCreate.txtLname.value=="")
	{
		alert("Enter Last Name before you submit !!");
		document.frmCreate.txtLname.focus();
		return false;
	}
	else if(document.frmCreate.country.value=="")
	{
		alert("Select Your Country Name before you submit !!");
		document.frmCreate.country.focus();
		return false;
	}
	
	
	
	else if(document.frmCreate.state.value=="")
	{
		alert("Select Your Country Name before you submit !!");
		document.frmCreate.state.focus();
		return false;
	}else if(document.frmCreate.school.value=="")
	{
		alert("Select Your School Name before you submit !!");
		document.frmCreate.school.focus();
		return false;
	}
	else if(document.frmCreate.day.value=="0")
	{
		alert("Select Date before you submit !!");
		document.frmCreate.day.focus();
		return false;
	}
	else if(document.frmCreate.month.value=="0")
	{
		alert("Select Month before you submit !!");
		document.frmCreate.month.focus();
		return false;
	}
	else if(document.frmCreate.year.value=="0")
	{
		alert("Select Year before you submit !!");
		document.frmCreate.year.focus();
		return false;
	}
	else if(document.frmCreate.txtEmail.value=="")
	{
		alert("Enter Your Email Address before you submit !!");
		document.frmCreate.txtEmail.focus();
		return false;
	}
	
	else if(!document.frmCreate.txtEmail.value.match(/^.+\@.+\..+$/))
	{
		alert("This is an invalid email address !!");
		document.frmCreate.txtEmail.focus();
		return false;
	}
	
	else if(document.frmCreate.txtPass.value=="")
	{
		alert("Enter Your Password before you submit !!");
		document.frmCreate.txtPass.focus();
		return false;
	}
	else if(document.frmCreate.txtCpass.value=="")
	{
		alert("Enter Your Confirm Password before you submit !!");
		document.frmCreate.txtCpass.focus();
		return false;
	}
	else if(document.frmCreate.txtCpass.value!=document.frmCreate.txtPass.value)
	{
		alert("Confirm password does not match !!");
		document.frmCreate.txtCpass.focus();
		return false;
	}
	
	else if(!(document.frmCreate.chkAgree.checked))
	{
		alert("Please Agree with us for terms and condition before you submit !!");
		document.frmCreate.chkAgree.focus();
		return false;
	}
	return true;
}*/
/* FOR CONTACT US VALIDATION 
function RestChar()
{		
	var Length;
	
	Length=(document.form1.txtdetails.value).length;
	remField = document.getElementById("MyLength");
	if(Length>600)
	{
		alert("String length should be smaller than the limit");
		document.form1.txtdetails.value="";
		(document.form1.txtdetails.value).length=600;
		RestChar();
	}
	else
		remField.innerHTML =600-Length;
	return true;
}
function ValidLength()
{
	if((document.form1.txtdetails.value).length>600)
	{
		alert("Cannot write more");
		document.form1.txtdetails.focus();
		return false;
	}
}

function ValidEntry()
{
	if(document.form1.supportcategories.value=="-1")
	{
		alert("Please Select Category before you send !!");
		document.form1.supportcategories.focus();
		return false;
	}
	else if(document.form1.txtdetails.value=="")
	{
		alert("Enter Details before you send !!");
		document.form1.txtdetails.focus();
		return false;
	}
    else if(document.form1.txtEmail.value=="")
	{
		alert("Enter your email address before you send !!");
		document.form1.txtEmail.focus();
		return false;
	}
	else if(!document.form1.txtEmail.value.match(/^.+\@.+\..+$/))
	{
		alert("Enter your email address before you send !!");
		document.form1.txtEmail.focus();
		return false;
	}
	
	return true;
}

*/

/* END CONTACT US VALIDATION */
/* VALIDATION  FOR TELL A FRIENDS
function ValidRef()
{
	formName=document.frmRef;
	
	if(formName.txtFriendName.value=="")
	{
		alert("Please enter your friend name before you send !!");
		formName.txtFriendName.focus();
		return false;
	}
	else if(formName.txtFriendEmail.value=="")
	{
		alert("Please enter your friend Email before you send !!");
		formName.txtFriendEmail.focus();
		return false;
	}
	else if(!formName.txtFriendEmail.value.match(/^.+\@.+\..+$/))
	{
		alert("Invalid Email address !!");
		formName.txtFriendEmail.focus();
		return false;
	}
	else if(formName.txtYourName.value=="")
	{
		alert("Please enter your name before you send !!");
		formName.txtYourName.focus();
		return false;
	}
	else if(formName.txtYourEmail.value=="")
	{
		alert("Please enter your Email before you send !!");
		formName.txtYourEmail.focus();
		return false;
	}
	else if(!formName.txtYourEmail.value.match(/^.+\@.+\..+$/))
	{
		alert("Invalid Email address !!");
		formName.txtYourEmail.focus();
		return false;
	}
	return true;
}*/
/* END VALIDATION  FOR TELL A FRIENDS*/
/* ADDD ITEM FOR FRIEND LIST " TELL A FRIENDS"
function AddItem()
  	{
		//alert('fgfg');
  		var cntrows=document.getElementById("tblFileUploader").rows.length;
		//alert(cntrows);  
  		var getTblContent=document.getElementById('tblFileUploader')
		//alert(getTblContent);
  		var x=document.getElementById('tblFileUploader').insertRow(cntrows)
		//alert(x);
  		var y=x.insertCell(0)
  		y.align="center"
		//y.innerHTML="<input type='file' name='carimage["+(cntrows)+"]' size='25'>"
		//y.innerHTML="<input type='file' name='sub_photo["+(cntrows)+"]' size='25'>"
		y.innerHTML='<tr><td width="26%">Friend\'s Name</td><td width="3%">:</td><td width="71%"><input type="text" name="txtFriendName"/></td></tr><tr><td>&nbsp;</td><td colspan="2">&nbsp;</td></tr><tr> <td>Friend\'s Email</td><td>:</td><td><input type="text" name="txtFriendEmail"/></td></tr>'
		}*/
/* END ITEM FOR FRIEND LIST " TELL A FRIENDS"*/
/* ADDD COMMENTS FOR PROFESSOR
function validRating()
{
	//alert('dfd');
	formName=document.form1;
	
	if(formName.easiness.checked==false && formName.easiness2.checked==false && formName.easiness3.checked==false && formName.easiness4.checked==false  && formName.easiness5.checked==false)
	{
		alert("Please put your rate for esiness before you send !!");
		formName.easiness.focus();
		return false;
	}
	else if(formName.helpfullness.checked==false && formName.helpfullness2.checked==false && formName.helpfullness3.checked==false && formName.helpfullness4.checked==false  && formName.helpfullness5.checked==false)
	{
		alert("Please put your rate for helpfulness before you send !!");
		formName.helpfullness.focus();
		return false;
	}
	else if(formName.clarity.checked==false && formName.clarity2.checked==false && formName.clarity3.checked==false && formName.clarity4.checked==false  && formName.clarity5.checked==false)
	{
		alert("Please put your rate for clarity before you send !!");
		formName.clarity.focus();
		return false;
	}
	else if(formName.interest.checked==false && formName.interest2.checked==false && formName.interest3.checked==false && formName.interest4.checked==false  && formName.interest5.checked==false)
	{
		alert("Please put your rate for interest before you send !!");
		formName.interest.focus();
		return false;
	}
	else if(formName.textbook.checked==false && formName.textbook2.checked==false && formName.textbook3.checked==false && formName.textbook4.checked==false  && formName.textbook5.checked==false)
	{
		alert("Please put your rate for textbook before you send !!");
		formName.textbook.focus();
		return false;
	}


return true;
	
}*/


/* END COMMENTS FOR PROFESSOR*/


