var rndn=Math.floor(Math.random()*10001);
document.write('<style>.frm_brd {border: 1px solid #333333;background-color:#FBFBFB;');
document.write('font: 12px Verdana, Arial, Helvetica, sans-serif;text-align:left;}');
document.write('.frm_hd {font: 17px Verdana, Arial, Helvetica, sans-serif;color:#0057AE;text-align:center;');
document.write('font-weight:bold;padding:3px;}.frm_code{background-image:url(http://www.eworldtourism.com/images/banner.gif);');
document.write('background-repeat:no-repeat;background-position:center;height:30px;font-size:18px;font-size:bold;color:#7f7f7f;}</style>');
document.write('<form method="post" id="form1" action="http://www.worldclasslearning.com/mail.php" onSubmit="return validate()">');
document.write('<table width="550" border="0" cellpadding="0" cellspacing="8" class="frm_brd"> <tr>');
document.write('<td height="26" colspan="4" class="frm_hd">Feedback Form </td></tr><tr>');
document.write('<td height="26" colspan="4" class="txt"><b>Questions and Anwsers, Comments, Useful Websites,Subscribe to Tutorials of your interest </b></td></tr><tr>');
document.write('<td width="106">Name : </td><td width="144"><input name="name" type="text" class="txt" id="name" /></td>');
document.write('<td width="107">Email : </td><td width="151"><input name="email" type="text" class="txt" id="email" /></td>');
document.write('</tr><tr><td colspan="4">Other Query / Feedback :');
document.write('<input type="hidden" name="pageurl" /></td></tr><tr>');
document.write('<td colspan="4"><div align="center"><textarea name="details"cols="45" rows="3" id="details"></textarea>');
document.write('</div></td></tr><tr>');
document.write('<td colspan="2" align="center">Enter Validation Code as shown below : </td>');
document.write('<td colspan="2" align="center"><input type="text" name="scrtcode"/></td>');
document.write('</tr><tr><td colspan="2" align="center">&nbsp;</td>');
document.write('<td colspan="2" align="center" class="frm_code">');
document.write(rndn);
document.write('</td></tr><tr><td colspan="4" align="center">&nbsp;</td></tr>');
document.write('<tr><td colspan="2" align="center"><input type="submit" name="b1" value="SUBMIT" />');
document.write('</td><td colspan="2" align="center"><input type="reset" name="b2" value="RESET" />');
document.write('</td></tr></table></form>');

var flag=true;
function validate()
{
var num1=form1.name;
var num2=form1.email;
var scrt=form1.scrtcode;

name=num1.value;
email=num2.value;
scrtcode=scrt.value;
if(name.length==0)
{
alert("plz enter the name");
num1.focus();
flag=false;
return false;
}
else
{
	flag=true;
}
if((name.substring(0,1)<"a" || name.substring(0,1)>"z")  && (name.substring(0,1)<"A" || name.substring(0,1)>"Z"))
{
alert("login should begin with alphabat");
num1.focus();
flag=false;
return false;
}
else
{
 flag=true;
}
if(email.length==0) 
{
alert("plz enter the email ");
num2.focus();
flag=false;
return false;
}
else
{
 flag=true;
}
	
if((email !="") && (email.indexOf("@")== -1) || (email.indexOf(".")== -1))
{
alert("plz enter the valid email ");
num2.focus();
flag=false;
return false;
}
else
{
 flag=true;
}


if(scrtcode.length==0) 
{
alert("plz enter validation code.");
scrt.focus();
flag=false;
return false;
}
else
{
 flag=true;
}
if(scrtcode != rndn) 
{
alert("Validation code is incorrect.");
scrt.focus();
flag=false;
return false;
}
else
{
 flag=true;
}
if (flag==true)
{
 var newWin;
 newWin =window.open("","mail",'resizable=no,scrollbars=no,width=350,height=300,toolbar=no,left=200,top=200')
 form1.target="mail"
 form1.submit();
 form1.reset();
 return false;	
}
}
