<html>

<head>
<script language="javascript">
function Validate(frm)
{
 
 if(Trim(frm.ur_name.value).length < 1)
 {
  alert("The Value For the Field \"Your Name\" is invalid , Please Enter Valid Value");
  frm.ur_name.focus();
  return false;
 }
 
 if(Trim(frm.frnd_name.value).length < 1)
 {
  alert("The Value For the Field \"Frined Name\" is invalid , Please Enter Valid Value");
  frm.frnd_name.focus();
  return false;
 }
 
 if(Trim(frm.frnd_email.value).length < 1)
 {
  alert("The Value For the Field \"Friend Email Address\" is invalid , Please Enter Valid Value");
  frm.frnd_email.focus();
  return false;
 }
else
 {
	 var str=frm.frnd_email.value;
	 var filter=/^.+@.+\..{2,3}$/ ;
	 if (filter.test(str))
		 {
		  
		 }
	  else
		 {       
		 alert("Please Enter a Valid Value of \"Email Address\" Field.");
		 frm.frnd_email.focus();
		 return false;
		 }  	 	
	//return testresults;
 } 
 return true;
}
function submitForm(){
		var frm  =document.emailToFrnd;
		if(Validate(frm)){
		//frm.act.value="register";
			frm.submit();
		}else{
			return false;
		}
	}
function Trim(s) 
   {
   	// Remove leading spaces and carriage returns
   	while ((s.substring(0,1) == ' ') || (s.substring(0,1) == '\n') || (s.substring(0,1) == '\r'))
   	 { s = s.substring(1,s.length); }
     
   	// Remove trailing spaces and carriage returns
 while ((s.substring(s.length-1,s.length) == ' ') || (s.substring(s.length-1,s.length) == '\n') || (s.substring(s.length-1,s.length) == '\r'))
   	 { s = s.substring(0,s.length-1); }
     
   	return s;
   }
</script>

</head>

<body>

<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF" class="brd">
<tr>
<td class="font"><b>Email To Friend </b></td>
</tr>

<tr>
<td class="font"><?php echo $msg;?>&nbsp;</td>
</tr>
<tr>
	<td valign="top" class="headingfonts">
	<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
	  <form name="emailToFrnd" action="emailexp" method="post" onSubmit="return Validate(this)">
	<input type="hidden" name="id" value="<?php echo $id?>">
	<input type="hidden" name="URL" value="http://www.zalawadivisha.org/site/expdetails?exp_id=<?php echo $explist->id?>">
	
	  <tr>
	  <td width="25%" bgcolor="#F0F0F0" class="font"><b>Your Name:</b></td>
	  <td width="75%" bgcolor="#F0F0F0"><input type="text" class="input2" name="ur_name"></td>
	  </tr>
	  <tr>
	    <td bgcolor="#F0F0F0" class="font"><b>Friends Name:</b></td>
	    <td bgcolor="#F0F0F0"><input type="text" class="input2" name="frnd_name"></td>
	  </tr>
	  <tr>
	    <td bgcolor="#F0F0F0" class="font"><b>Friends Email:</b></td>
	    <td bgcolor="#F0F0F0"><input type="text" class="input2" name="frnd_email"></td>
	  </tr>
	  <tr>
	    <td valign="top" bgcolor="#F0F0F0" class="font"><b>Your Message:</b></td>
	    <td bgcolor="#F0F0F0"><textarea name="notes" style="width:350px; height:100px"></textarea></td>
	  </tr>
	  <tr>
	    <td bgcolor="#F0F0F0" class="font" align="right"><a href="javascript:;" onClick="submitForm();" class="btn-more">Send Link</a></td>
	    <td bgcolor="#F0F0F0">
		  <a href="javascript:;" onClick="javascript: window.close();" class="btn-more1">Close Window</a>
		  </td>
	  </tr></form>
    </table>
    </td>
</tr>
<tr>
  <td>&nbsp;</td>
</tr>
</table>

</body>

</html>