function change_image(image,width,height,id)
{
	document.getElementById(id).src="images/"+image;
	document.getElementById(id).width=width;
	document.getElementById(id).height=height;
}
function swap_image(image,width,height,id)
{
	document.getElementById(id).src="../images/"+image;
	document.getElementById(id).width=width;
	document.getElementById(id).height=height;
}


function topband()
{
	document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%">');
	document.write('<tr><td width="100%"><embed width="779" height="70" src="../top.swf">');	
	document.write('</td></tr><tr><td width="100%">');
	document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%">');
	document.write('<tr><td width="133"><embed width="133" height="41" src="../logo.swf"></td>');
	document.write('<td width="649">');
	document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%">');
	document.write('<tr><td><a href="../index.php" onmouseover="swap_image(\'top-link_1a.jpg\',\'67\',\'41\',\'home\')" onmouseout="swap_image(\'top-link_1.jpg\',\'67\',\'41\',\'home\')"><img border="0" src="../images/top-link_1.jpg" width="67" height="41" id="home" alt="Home"></a></td>');
	document.write('<td><a href="../aboutus.php" onmouseover="swap_image(\'top-link_8a.jpg\',\'81\',\'41\',\'about\')" onmouseout="swap_image(\'top-link_8.jpg\',\'81\',\'41\',\'about\')"><img border="0" src="../images/top-link_8.jpg" width="81" height="41" id="about" alt="About Us"></td>');
	document.write('<td><a href="../form.php" onmouseover="swap_image(\'top-link_2a.jpg\',\'66\',\'41\',\'flight\')" onmouseout="swap_image(\'top-link_2.jpg\',\'66\',\'41\',\'flight\')"><img border="0" src="../images/top-link_2.jpg" width="66" height="41" id="flight" alt="Flight"></a></td>');
	document.write('<td><a href="../hotels.php" onmouseover="swap_image(\'top-link_3a.jpg\',\'66\',\'41\',\'hotel\')" onmouseout="swap_image(\'top-link_3.jpg\',\'66\',\'41\',\'hotel\')"><img border="0" src="../images/top-link_3.jpg" width="66" height="41" id="hotel" alt="Hotel"></a></td>');
	document.write('<td><a href="../cars.php" onmouseover="swap_image(\'top-link_4a.jpg\',\'66\',\'41\',\'car\')" onmouseout="swap_image(\'top-link_4.jpg\',\'66\',\'41\',\'car\')"><img border="0" src="../images/top-link_4.jpg" width="66" height="41" id="car" alt="Car"></a></td>');
	document.write('<td><a href="#" onmouseover="swap_image(\'top-link_9a.jpg\',\'64\',\'41\',\'rail\')" onmouseout="swap_image(\'top-link_9.jpg\',\'64\',\'41\',\'rail\')"><img border="0" src="../images/top-link_9.jpg" width="64" height="41" id="rail" alt="Rail"></a></td>');
	document.write('<td><a href="tours/" onmouseover="swap_image(\'top-link_5a.jpg\',\'66\',\'41\',\'tour\')" onmouseout="swap_image(\'top-link_5.jpg\',\'66\',\'41\',\'tour\')"><img border="0" src="../images/top-link_5.jpg" width="66" height="41" id="tour" alt="Tours"></td>');
	document.write('<td><a href="#" onmouseover="swap_image(\'top-link_6a.jpg\',\'89\',\'41\',\'list\')" onmouseout="swap_image(\'top-link_6.jpg\',\'89\',\'41\',\'list\')"><img border="0" src="../images/top-link_6.jpg" width="89" height="41" id="list" alt="Product List"></td>');
	document.write('<td><a href="../contactus.php" onmouseover="swap_image(\'top-link_7a.jpg\',\'81\',\'41\',\'contact\')" onmouseout="swap_image(\'top-link_7.jpg\',\'81\',\'41\',\'contact\')"><img border="0" src="../images/top-link_7.jpg" width="81" height="41" id="contact" alt="Contact Us"></td>');
	document.write('</tr></table></td></tr></table></td></tr></table>');
}





function forrail()
{
	document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%">');
	document.write('<tr><td width="100%"><embed width="779" height="70" src="../top.swf">');	
	document.write('</td></tr><tr><td width="100%">');
	document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%">');
	document.write('<tr><td width="133"><embed width="133" height="41" src="../logo.swf"></td>');
	document.write('<td width="649">');
	document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%">');
	document.write('<tr><td><a href="../index.php" onmouseover="swap_image(\'top-link_1a.jpg\',\'67\',\'41\',\'home\')" onmouseout="swap_image(\'top-link_1.jpg\',\'67\',\'41\',\'home\')"><img border="0" src="../images/top-link_1.jpg" width="67" height="41" id="home" alt="Home"></a></td>');
	document.write('<td><a href="../aboutus.php" onmouseover="swap_image(\'top-link_8a.jpg\',\'81\',\'41\',\'about\')" onmouseout="swap_image(\'top-link_8.jpg\',\'81\',\'41\',\'about\')"><img border="0" src="../images/top-link_8.jpg" width="81" height="41" id="about" alt="About Us"></td>');
	document.write('<td><a href="../form.php" onmouseover="swap_image(\'top-link_2a.jpg\',\'66\',\'41\',\'flight\')" onmouseout="swap_image(\'top-link_2.jpg\',\'66\',\'41\',\'flight\')"><img border="0" src="../images/top-link_2.jpg" width="66" height="41" id="flight" alt="Flight"></a></td>');
	document.write('<td><a href="../hotels.php" onmouseover="swap_image(\'top-link_3a.jpg\',\'66\',\'41\',\'hotel\')" onmouseout="swap_image(\'top-link_3.jpg\',\'66\',\'41\',\'hotel\')"><img border="0" src="../images/top-link_3.jpg" width="66" height="41" id="hotel" alt="Hotel"></a></td>');
	document.write('<td><a href="../cars.php" onmouseover="swap_image(\'top-link_4a.jpg\',\'66\',\'41\',\'car\')" onmouseout="swap_image(\'top-link_4.jpg\',\'66\',\'41\',\'car\')"><img border="0" src="../images/top-link_4.jpg" width="66" height="41" id="car" alt="Car"></a></td>');
	document.write('<td><a href="../rail.php" onmouseover="swap_image(\'top-link_9.jpg\',\'64\',\'41\',\'rail\')" onmouseout="swap_image(\'top-link_9a.jpg\',\'64\',\'41\',\'rail\')"><img border="0" src="../images/top-link_9a.jpg" width="64" height="41" id="rail" alt="Rail"></a></td>');
	document.write('<td><a href="../tours/" onmouseover="swap_image(\'top-link_5a.jpg\',\'66\',\'41\',\'tour\')" onmouseout="swap_image(\'top-link_5.jpg\',\'66\',\'41\',\'tour\')"><img border="0" src="../images/top-link_5.jpg" width="66" height="41" id="tour" alt="Tours"></td>');
	document.write('<td><a href="#" onmouseover="swap_image(\'top-link_6a.jpg\',\'89\',\'41\',\'list\')" onmouseout="swap_image(\'top-link_6.jpg\',\'89\',\'41\',\'list\')"><img border="0" src="../images/top-link_6.jpg" width="89" height="41" id="list" alt="Product List"></td>');
	document.write('<td><a href="../contactus.php" onmouseover="swap_image(\'top-link_7a.jpg\',\'81\',\'41\',\'contact\')" onmouseout="swap_image(\'top-link_7.jpg\',\'81\',\'41\',\'contact\')"><img border="0" src="../images/top-link_7.jpg" width="81" height="41" id="contact" alt="Contact Us"></td>');
	document.write('</tr></table></td></tr></table></td></tr></table>');
}
function left()
{
	document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%">');
	document.write('<tr><td width="100%"><img border="0" src="../images/top2.jpg" width="196" height="37"></td></tr>');
	document.write('<tr><td width="100%">');
	document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%">');
	document.write('<tr><td width="100%"><img border="0" src="../images/travel_agents.jpg" width="196" height="26"></td></tr>');
	document.write('<tr><td width="100%" background="../images/travel-bg.jpg" height="213" valign="top">');
	document.write('<table border="0" cellpadding="3" cellspacing="0" width="98%" align="center" class="list">');
	document.write('<tr><td width="30%"></td><td width="70%" height="15"></td></tr>');
	document.write('<form action="http://fsa.openfares.com/cgi-bin/webbooking/request.cgi" method="post" name="form1" id="form1" onsubmit="return checklogin()">');
	document.write('<form action="common/check_login.php" method="post" name="form1" id="form1" onsubmit="return checklogin()">');
	document.write('<input type=hidden name=vendercode value="GILL">');
	document.write('<input type=hidden name=pincode value="905272">');
	document.write('<input type=hidden name=provenance value=index>');
	document.write('<tr><td width="30%">Username</td>');
	document.write('<td width="70%"><input type="text" name="agency" size="20" class="textbox"></td></tr>');
	document.write('<tr><td width="30%">Password</td>');
	document.write('<td width="70%"><input type="password" name="password" size="20" class="textbox"></td></tr>');
	document.write('<tr><td width="30%"></td><td width="70%" align="right"><input type="image" src="../images/submit.gif">&nbsp;</td></tr>');
	document.write('<tr><td width="100%" colspan="2" class="emails" style="text-decoration:none;"><b><font color="#396ED4">Not registered yet ? </font.</b><a href="http://gill.openfares.com/application_form.php" class="emails" target="_blank"><font color="red">Click here.</font></a></td></tr>');
	document.write('<tr><td width="100%" colspan="2"><ul class="list"><li>Forgot your password<br></li>');
	document.write('<li>For information on How to enable.</font></ul></td></tr>');
	document.write('</form></table></td></tr></table></td></tr>');
	
	document.write('<tr><td width="100%">');
	document.write('<table border="0" cellpadding="0" cellspacing="0" width="196" align="center">');
	document.write('<tr><td width="100%" background="../images/hotdeals-bgimag.gif" height="235" valign="top">');
	document.write('<table border="0" cellpadding="2" cellspacing="0" width="85%" lign="center" class="hotdeal" align="center">');
	document.write('<tr><td width="100%" height="60"></td></tr>');
	document.write('<tr><td width="100%">Mumbai.................CAD-950</td></tr>');
	document.write('<tr><td width="100%">Banglore...............CAD-1,000</td></tr>');
	document.write('<tr><td width="100%">Delhi......................CAD-950</td></tr>');
	document.write('<tr><td width="100%">Hyderabad............CAD-950</td></tr>');
	document.write('<tr><td width="100%">Calcutta.................CAD-950</td></tr>');
	document.write('<tr><td width="100%">Islamabad.............CAD-950</td></tr>');
	document.write('<tr><td width="100%">Ahamedabad.........CAD-950</td></tr>');
	document.write('<tr><td width="100%">Barodra..................CAD-950</td></tr>');
	document.write('<tr><td width="100%">Chennai.................CAD-950</td></tr>');
	document.write('</table></td></tr>');
	document.write('<tr><td width="100%" background="../images/hotdeals-footerbg.jpg" height="21"></td></tr>');
	document.write('</table></td></tr>');
	document.write('<tr><td width="100%">');
	document.write('<table border="0" cellpadding="0" cellspacing="0" width="181" align=center>');
	document.write('<tr><td width="181" height="6"></td></tr>');
	document.write('<tr><td width="181" background="../images/tell-bg.jpg" height="152" valign="top">');
	document.write('<table border="0" cellpadding="2" cellspacing="0" width="90%" align="center" class="list">');
	document.write('<form action="tellafriend.php" method="post">');
	document.write('<tr><td width="40%" height="50"></td><td width="60%"></td></tr>');
	document.write('<tr><td width="40%">Your Id</td><td width="60%"><input type="text" name="fromemail" size="15"  class="textbox"></td></tr>');
	document.write('<tr><td width="40%">Friends Id</td><td width="60%"><input type="text" name="toemail" size="15" class="textbox"></td></tr>');
	document.write('<tr><td width="100%" colspan="2" align="right"><input type="image" src="../images/go-icon.jpg" onclick="checkfield()"></td></tr>');
	document.write('</form></table></td></tr></table></td></tr>');
	document.write('<tr><td width="100%" height="6"></td></tr>');
	document.write('<tr><td width="100%"><p align="center"><img border="0" src="../images/livechat-banner.jpg" width="181" height="54"></p></td></tr>');

	//document.write('<tr><td width="100%" height="6"></td></tr>');
	//document.write('<tr><td width="100%"><table align="center" width="181" height="159" cellpadding="0" cellspacing="0"><tr><td background="images/news.jpg" valign="top">');
	document.write('</td></tr></table>');	
}

function footer()
{
	document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%">');
	document.write('<tr><td width="100%" background="../images/footer-bg2.jpg" height="89">');
	document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%">');
	document.write('<tr><td width="100%" height="42"></td></tr>');
	document.write('<tr><td width="100%" align="center"><embed width="779" height="40" src="../partners.swf"></td>');
	document.write('</tr></table></td></tr>');
	document.write('<tr><td width="100%">');
	document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%">');
	document.write('<tr><td width="100%" bgcolor="#E2E9F1" height="40">');
	document.write('<table border="0" cellpadding="0" cellspacing="0" width="55%" align="center">');
	document.write('<tr><td width="100%" class="footer" align="center"><a href="../index.php" class="footer">Home</a>&nbsp; |&nbsp; <a href="../aboutus.php" class="footer">About Us</a>&nbsp; |&nbsp;');
	document.write('<a href="#" class="footer">Destination</a>&nbsp; |&nbsp; <a href="../hotels.php" class="footer">Hotel Booking</a>&nbsp; |&nbsp;');
	document.write('<a href="#" class="footer">Tours</a>&nbsp; |&nbsp;&nbsp;');
	document.write('<a href="#" class="footer">Product List</a>&nbsp; |&nbsp; <a href="../customer-care.php" class="footer">Customer Care</a>&nbsp; &nbsp; |&nbsp; <a href="#" class="footer">Insurance</a>&nbsp; |&nbsp; <a href="#" class="footer">Credit Card Authorization');
	document.write('Form</a>&nbsp; |&nbsp; <a href="../contactus.php" class="footer">Contact Us</a>&nbsp; |&nbsp; <a href="#" class="footer">Sitemap</a>&nbsp;|&nbsp; <a href="#" class="footer">Privacy Policy</a></td>');
	document.write('</tr></table></td></tr>');
	document.write('<tr><td width="100%" class="footer" align="center" bgcolor="#FFFFFF" height="3"></td></tr>');
	document.write('<tr><td width="100%" class="footer" align="center" bgcolor="#FFFFFF"><font color="#939393" size="1">© Copyright Gill International Travel&nbsp;&nbsp;');
	document.write('||&nbsp;&nbsp; Site Powered by <a href="http://www.ezeetravelsolutions.com" target="_blank" class="footer">Ezee Travel Solutions</a></font></td></tr></table></td></tr></table>');
}
function footerrail()
{
	document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%">');
	document.write('<tr><td width="100%" background="../images/footer-bg2.jpg" height="89">');
	document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%">');
	document.write('<tr><td width="100%" height="42"></td></tr>');
	document.write('<tr><td width="100%" align="center"><embed width="779" height="40" src="../partners.swf"></td>');
	document.write('</tr></table></td></tr>');
	document.write('<tr><td width="100%">');
	document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%">');
	document.write('<tr><td width="100%" bgcolor="#E2E9F1" height="40">');
	document.write('<table border="0" cellpadding="0" cellspacing="0" width="55%" align="center">');
	document.write('<tr><td width="100%" class="footer" align="center"><a href="../index.php" class="footer">Home</a>&nbsp; |&nbsp; <a href="../aboutus.php" class="footer">About Us</a>&nbsp; |&nbsp;');
	document.write('<a href="#" class="footer">Destination</a>&nbsp; |&nbsp; <a href="../hotels.php" class="footer">Hotel Booking</a>&nbsp; |&nbsp;');
	document.write('<a href="#" class="footer">Tours</a>&nbsp; |&nbsp;&nbsp;');
	document.write('<a href="#" class="footer">Product List</a>&nbsp; |&nbsp; <a href="../customer-care.php" class="footer">Customer Care</a>&nbsp; &nbsp; |&nbsp; <a href="#" class="footer">Insurance</a>&nbsp; |&nbsp; <a href="#" class="footer">Credit Card Authorization');
	document.write('Form</a>&nbsp; |&nbsp; <a href="../contactus.php" class="footer">Contact Us</a>&nbsp; |&nbsp; <a href="#" class="footer">Sitemap</a>&nbsp;|&nbsp; <a href="#" class="footer">Privacy Policy</a></td>');
	document.write('</tr></table></td></tr>');
	document.write('<tr><td width="100%" class="footer" align="center" bgcolor="#FFFFFF" height="3"></td></tr>');
	document.write('<tr><td width="100%" class="footer" align="center" bgcolor="#FFFFFF"><font color="#939393" size="1">© Copyright Gill International Travel&nbsp;&nbsp;');
	document.write('||&nbsp;&nbsp; Site Powered by <a href="http://www.ezeetravelsolutions.com" target="_blank" class="footer">Ezee Travel Solutions</a></font></td></tr></table></td></tr></table>');
}


function homeflash()
{
	document.write('<embed width="411" height="248" src="../main-flash.swf">');
}
function homeleft()
{
	document.write('<embed width="181" height="104" src="../renacar.swf">');
}
function homecentere()
{
	document.write('<embed width="148" height="156" src="../needful-flash.swf">');
}
function homeleftflash()
{
	document.write('<embed width="172" height="276" src="../airindia-banner.swf">');
}
function homerightflash()
{
	document.write('<embed width="172" height="117" src="../special-offers.swf">');
}
function hometopflash()
{
	document.write('<embed width="779" height="70" src="../top.swf">');
}
function homefooterflash()
{
	document.write('<embed width="779" height="40" src="../partners.swf">');
}
function disable()
{
	//alert("ji");
	if(document.frmf.trip[0].checked==true)
	{
		document.frmf.inbound_date.disabled=true;
		document.frmf.inbound_time.disabled=true;
	}
	else if(document.frmf.trip[1].checked==true)//(document.frm.trip[1].selected==true)
	{
		document.frmf.inbound_date.disabled=false;
		document.frmf.inbound_time.disabled=false;
	}
	
	

}
function show()
{
	if(!document.frm.check.checked)
	{
		document.getElementById('drop1').style.display="";
		document.getElementById('drop2').style.display="";
	}
	else
	{
		document.getElementById('drop1').style.display="none";
		document.getElementById('drop2').style.display="none";
		
	}
}

function change_form()
{
	URLvar=document.URL;
	values=URLvar.split('?');
	if(document.frm.type[0].checked)
	{
		window.location='form.php';
	}
	if(document.frm.type[1].checked)
	{
			window.location='cars.php';
	}
	if(document.frm.type[2].checked)
	{
		window.location='hotels.php';
		
	}	
}
function recomend_check()
{	
	if(document.frm.recomend[1].checked)
	{
		document.frm.friend_email.disabled=true;
		document.frm.friend_email.style.background="white";	
	}
	else
	{
		document.frm.friend_email.disabled=false;
	}
}
function sendemail(fromemail,toemail)
{	//alert(fromemail);
	var getstr ='fromemail='+encodeURI(fromemail)+'toemail='+encodeURI(toemail)+'&sid='+Math.random();
	//alert(getstr)	
	ajaxpack.getAjaxRequest("../madue/tellafriend.php", getstr, get_status, "txt", '')
}
function get_status()
{
	var myajax = ajaxpack.ajaxobj;
	var myfiletype = ajaxpack.filetype;
	var products_page = ajaxpack.callback_parameter;
	if (myajax.readyState == 4)
	{
		//if request of file completed
		if (myfiletype=="txt")
		{
			alert(myajax.responseText);
			document.getElementById('fromemail').value="";
			document.getElementById('toemail').value="";
			
		}
	}
}
function checkfield()
{		
	if(document.getElementById('fromemail').value=="")
	{
		alert("Please enter your email");
		document.getElementById('fromemail').focus();
		return false;
	}
	if(document.getElementById('toemail').value=="")
	{
		alert("please enter your freind's email");
		document.getElementById('toemail').focus();
		return false;
	}
	return validate_form2(document.getElementById('toemail').name);
}
function validate_form2(toemail)
{
	if (validate_email2(toemail,"Not a valid e-mail address!")==false)
  	{
		document.getElementById('toemail').focus();
		return false;
	}
	else
	{
		sendemail(document.getElementById('fromemail').value,document.getElementById('toemail').value);
	}
}
function validate_email2(field,alerttxt)
{
	apos=document.getElementById(field).value.indexOf("@");
	dotpos=document.getElementById(field).value.lastIndexOf(".");
	if (apos<1||dotpos-apos<2) 
	{
		alert(alerttxt);
		return false;
	}
	else 
	{
		return true;
	}	
}
function checkenquiry()
{
	docf=document.frm;
	if(docf.subject.value=="No")
	{
	alert("Plese Select your subject !")
	docf.subject.focus();
	return false;
	}

	if(docf.fname.value=="")
	{
	alert("Plese enter your First Name !")
	docf.fname.focus();
	return false;
	}

	if(docf.email.value=="")
	{
	alert("Please enter your email id !")
	docf.email.focus();
	return false;	
	}

	if(docf.resident.value=="No")
	{
	alert("Please select the country ! ")
	docf.resident.focus();
	return false;
	}

	if(docf.pnrnumber.value=="")
	{
	alert("Please enter your PNR No. ")
	docf.pnrnumber.focus();
	return false;
	}

return validate_form(docf);
}
function validate_email(field,alerttxt)
{
	with (field)
	{
		apos=value.indexOf("@")
		dotpos=value.lastIndexOf(".")
		if (apos<1||dotpos-apos<2) 
  		{
  			alert(alerttxt);
  			return false;
  		}
		else 
		{
			return true;
		}
	}
	
}
function validate_form(thisform)
{
	with (thisform)
	{
		if (validate_email(email,"Not a valid e-mail address!")==false)
  		{
  			email.focus();
  			return false;
  		}
	}	
}
function resident_check()
{
	if(!document.frm.resident.checked)
	{
		//document.frm.country.style.visibility="visible";
		document.frm.country.style.display="";
	}
	else
	{
		//document.frm.country.style.visibility="hidden";
		document.frm.country.style.display="none";
	}
}
function checklogin()
{
	if(document.form1.agency.value=="")
	{
		alert("Username can not be blank.");
		document.form1.agency.focus();
		return false;
	}
	if(document.form1.password.value=="")
	{
		alert("Password can not be blank.");
		document.form1.password.focus();
		return false;
	}
	
}

/************Initial caps exammple*****************/
function changeCase(frmObj) {
var index;
var tmpStr;
var tmpChar;
var preString;
var postString;
var strlen;
//tmpStr = frmObj.value.toLowerCase();
tmpStr = frmObj.toLowerCase();

strLen = tmpStr.length;
if (strLen > 0)  {
for (index = 0; index < strLen; index++)  {
if (index == 0)  {
tmpChar = tmpStr.substring(0,1).toUpperCase();
postString = tmpStr.substring(1,strLen);
tmpStr = tmpChar + postString;
}
else {
tmpChar = tmpStr.substring(index, index+1);
if (tmpChar == " " && index < (strLen-1))  {
tmpChar = tmpStr.substring(index+1, index+2).toUpperCase();
preString = tmpStr.substring(0, index+1);
postString = tmpStr.substring(index+2,strLen);
tmpStr = preString + tmpChar + postString;
         }
      }
   }
}
//frmObj.value = tmpStr;
return  tmpStr;
}

/***********Ends Here****************/

/*---------------E mail  validation script - by  Anand Singh---------------------*/
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					
	}
/*------------------------------------*/
/*------------trim function By:-Anand----------------*/
function trim(s)
{
	return rtrim(ltrim(s));
}

function ltrim(s)
{
	var l=0;
	while(l < s.length && s[l] == ' ')
	{	l++; }
	return s.substring(l, s.length);
}

function rtrim(s)
{
	var r=s.length -1;
	while(r > 0 && s[r] == ' ')
	{	r-=1;	}
	return s.substring(0, r+1);
}
/*------------------*/