
function mailToFriend()
{
	var html='<form>';
	html+='<table width="390px" height=30px><tr><td valign="top" align="center">';
	html+='Email : <input type="text"  name="holiday_toEmail" style="WIDTH: 100px; HEIGHT: 17px"/>';
	html+='Your Name : <input type="text"  name="holiday_fromName" style="WIDTH: 100px; HEIGHT: 17px"/></td></tr>';
	html+='<tr><td width="5"></td></tr><tr><td valign="top" align="center">'+
			'Your Message : <input type="text"  name="holiday_toMsg"'+
			' style="WIDTH: 100px; HEIGHT: 17px"/></td></tr></table>';
	html+='</form>';
	//id="holiday_toEmail"id="holiday_fromName"id="holiday_toMsg"
	$.prompt(html,{ buttons: { Ok: true, Cancel: false },callback: sendRequestParams });
	
	function sendRequestParams(v,m,f){
		
							if (v != undefined) {

								var toemailId = f.holiday_toEmail;
								var fromName = f.holiday_fromName;
								var toMsg = f.holiday_toMsg;
								$("#topackmailid").val(toemailId);
								$("#fromopackmailid").val(fromName);
								$("#msgpackmail").val(toMsg);

							}

							if (v == true) {
								var emailRegx = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
								if (emailRegx.test(toemailId)
										&& toemailId != "") {

								} else {

									alert("....Wrong Email Id....");
									return false;
								}
								var emailPackInput = $("#packEmailInput")
										.serialize();
								var paxInfo=$("#paxForm").serialize();
								emailPackInput+="&"+paxInfo;
								
								var emailholidaydetail = cpath
										+ "emailHolidayDetails";
								//alert("data......" + emailPackInput);
								//console.log("Email Holiday Detail....."+ emailholidaydetail);
								$.get(emailholidaydetail, emailPackInput,
										function() {

										});

							}

						}
}


function sendRequest(screenId)
{
	
	var from="anonymous@xxx.com";
	var html='<table width="390px" height="60px"><tr><td colspan="2" align="center" bgcolor="#FBB03B"><font size="3px">Send Request</font></td></tr><tr><td height="3px" colspan="2"></td></tr><tr><td colspan="2"><font size="1px">Please fill in the details below and click ok.<font></td></tr><tr><td height="3px" colspan="2"></td></tr><tr><td colspan="2"><font size="1px">A Gitc Team member will contact you shortly.<font></td></tr><tr><td height="5px" colspan="2"><hr><font color="#FBB03B"></font></hr></td></tr><tr><td valign="top" align="left" colspan="2">';
	html+='Your Name : <input type="text" style="width:250px;" id="fromName" name="fromName" style="WIDTH: 100px; HEIGHT: 17px"/></td></tr><tr><td height="5px" colspan="2"></td></tr>';
	html+='<tr><td width="5px" colspan="2"></td></tr><tr><td valign="top" align="left" colspan="2">Your Email : <input type="text" id="fromEmail" name="fromEmail" style="WIDTH: 110px; HEIGHT: 17px"/>';
	html+='  Phone : <input type="text" id="fromContact" name="fromContact" style="WIDTH: 110px; HEIGHT: 17px"/></td></tr><tr><td height="5px" colspan="2"></td></tr>';
	html+='<tr><td valign="center" align="left" width="78px">Remarks&nbsp;&nbsp;&nbsp;&nbsp;:</td><td><textarea id="remarks" name="remarks" rows=3 cols=33/></td></tr></table>';		

	
		$.prompt(html,{ buttons: { Ok: true, Cancel: false },callback: sendRequestParams});

		function sendRequestParams(v,m,f){
			if(v != undefined){
				emailId=f.fromEmail;
				fromName=f.fromName;
				contactNumber=f.fromContact;
				remarks=f.remarks;
							
			}
			if(v==true){
				var contact="";
				var sendRequestAction=cpath+"sendPackageDetails";
				var paxInfo=$("#paxForm").serialize();				
				sendRequestAction+="?"+paxInfo+"&holiday_Screen="+screenId;
				if(screenId=="M")
					sendRequestAction+="&package_Price="+$("#total_price").html();
				var emailRegx = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
				if(!isNaN(contactNumber) && contactNumber.length>=10)
					contact=contactNumber;
				if(emailRegx.test(emailId) && emailId!="")
					from = emailId;
				if(emailId!="" || contact!="")
				{	
					sendRequestAction+="&From="+from+"&Name="+fromName+"&contactNumber="+contact+"&remarks="+remarks;
					$.get(sendRequestAction,function(status){
						if(status!=null)
						{
							var html='<table width="400px" height=30px><tr><td valign="top" align="center">';
								html+=status+'</td></tr></table>';
			    	   			$.prompt(html,{ buttons: { Ok: true } });
						}

						});			 
					
				}
				else
					$.prompt("Please fill-in the details...",{ buttons: { Ok: true } });
			}
		}
}
