<html>

<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">

<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">
<tr>
<td class="font"><h3>Email To Friend </h3></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" class="table table-bordered">
	  <form name="emailToFrnd" action="emailevent" method="post" onSubmit="return Validate(this)">
	<input type="hidden" name="id" value="<?php echo $id?>">
	<input type="hidden" name="URL" value="http://jpc.arihantseo.com/eventdetails?event_id=<?php echo $eventdetail->id?>">
	
	  <tr>
	  <td width="25%"><b>Your Name:</b></td>
	  <td width="75%"><input type="text" class="form-control" name="ur_name"></td>
	  </tr>
	  <tr>
	    <td><b>Friends Name:</b></td>
	    <td><input type="text" class="form-control" name="frnd_name"></td>
	  </tr>
	  <tr>
	    <td><b>Friends Email:</b></td>
	    <td><input type="text" class="form-control" name="frnd_email"></td>
	  </tr>
	  <tr>
	    <td valign="top"><b>Your Message:</b></td>
	    <td><textarea name="notes" style="width:350px; height:100px"></textarea></td>
	  </tr>
	  <tr>
	    <td align="right"><a href="javascript:;" onClick="submitForm();" class="btn btn-blue">Send Link</a></td>
	    <td>
		  <a href="javascript:;" onClick="javascript: window.close();" class="btn btn-blue">Close</a>
		  </td>
	  </tr></form>
    </table>
    </td>
</tr>
<tr>
  <td>&nbsp;</td>
</tr>
</table>

</body>

</html>