function CheckCustomerInfo(frmName)
{
	 if(!validateBlank(frmName,'to_name',"Enter name of the person"))
	return false;
	 //-email
	 if(!Check(frmName,'to_name'))
	return false;
	
	RemoveBad(frmName,'to_name')

	if(!validateBlank(frmName,'to_email',"Enter Email Address"))
	return false;
			
	if(!validateEmail(frmName,'to_email',"Enter Valid Email Address"))
	return false;			
	
	if(!validateBlank(frmName,'from_name',"Enter your name"))
	return false;
	
    if(!Check(frmName,'from_name'))
	return false;
	
	RemoveBad(frmName,'from_name')

	
	if(!validateBlank(frmName,'your_email',"Enter your Email Address"))
	return false;
			
	if(!validateEmail(frmName,'your_email',"Enter Valid Email Address"))
	return false;
	
	if(document.frmGiftcard.txtMessage.value!="")
	{
		if(!Check(frmName,'txtMessage'))
		return false;
		
		RemoveBad(frmName,'txtMessage')
	
	}

	
	
	var spath = document.frmHidden.ServerPath.value;
	var hta = document.frmHidden.htaccess.value
	if(hta == 'No')
	{
		document.frmGiftcard.action1.value = 'view';
		document.frmGiftcard.file.value = 'preview';
		document.frmGiftcard.submit();
	}
	else
	{
		var gid = document.frmGiftcard.giftcard_id.value;
		var doc = null;
		if (typeof window.ActiveXObject != 'undefined' ) 
		{ 
			doc = new ActiveXObject("Microsoft.XMLHTTP"); 
		} 
		else 
		{ 
			doc = new XMLHttpRequest(); 
		}			
		doc.open("GET", spath + "getgiftDname.php?giftcard_id="+gid,false);
		doc.send(null);		
		var Res = doc.responseText;
		url = spath + "preview/view/"+Res+".html";
		document.frmGiftcard.file.value = 'preview';
		document.frmGiftcard.action = url;
		document.frmGiftcard.submit();
	
	}
}
function CheckCustomerInfoS(frmName)
{
 
	 if(!validateBlank(frmName,'to_name',"Enter name of the person"))
	return false;
	
	 if(!Check(frmName,'to_name'))
	return false;
	
	RemoveBad(frmName,'to_name')
	 //-email
	if(!validateBlank(frmName,'to_email',"Enter Email Address"))
	return false;
			
	if(!validateEmail(frmName,'to_email',"Enter Valid Email Address"))
	return false;			
	
	if(!validateBlank(frmName,'from_name',"Enter your name"))
	return false;
   
    if(!Check(frmName,'from_name'))
	return false;
	
	RemoveBad(frmName,'from_name')
	
	if(!validateBlank(frmName,'your_email',"Enter your Email Address"))
	return false;
			
	if(!validateEmail(frmName,'your_email',"Enter Valid Email Address"))
	return false;
	
	if(document.frmGiftcard.txtMessage.value!="")
	{
		if(!Check(frmName,'txtMessage'))
		return false;
		
		RemoveBad(frmName,'txtMessage')
	
	}

	var spath = document.frmHidden.ServerPath.value;
	var hta = document.frmHidden.htaccess.value
	if(hta == 'No')
	{
		document.frmGiftcard.action1.value = 'send';
		document.frmGiftcard.file.value = 'preview';
		document.frmGiftcard.submit();
	}
	else
	{
		var gid = document.frmGiftcard.giftcard_id.value;
		var doc = null;
		if (typeof window.ActiveXObject != 'undefined' ) 
		{ 
			doc = new ActiveXObject("Microsoft.XMLHTTP"); 
		} 
		else 
		{ 
			doc = new XMLHttpRequest(); 
		}			
		doc.open("GET", spath + "getgiftDname.php?giftcard_id="+gid,false);
		doc.send(null);		
		var Res = doc.responseText;
		url = spath + "preview/send/"+Res+".html";
		document.frmGiftcard.file.value = 'preview';
		document.frmGiftcard.action = url;
		document.frmGiftcard.submit();
		return true;
	
	}
	
}

var xmlHttp = createXmlHttpRequestObject();
// retrieves the XMLHttpRequest object 
function createXmlHttpRequestObject() 
{ 
// will store the reference to the XMLHttpRequest object 
	var xmlHttp; 
// if running Internet Explorer 
			if(window.ActiveXObject) 
			{ 
					try 
					{ 
							xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); 
					} 
					catch (e) 
					{ 
							xmlHttp = false; 
					} 
			} 
			// if running Mozilla or other browsers 
			else 
			{ 
					try 
					{ 
							xmlHttp = new XMLHttpRequest(); 
							
					} 
					catch (e) 
					{ 
							xmlHttp = false; 
					} 
			} 	
			// return the created object or display an error message 
			if (!xmlHttp) 
					alert("Error creating the XMLHttpRequest object."); 
			else 
					return xmlHttp; 
} 

function process_product(category_id,serverpath) 
{ 
		//alert(category_id);
		//return false;

		if(category_id==-1)
		{
				alert("please select the category");
				return false;
		}
		if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0) 
		{ 
			
					
			var url=serverpath+"get_giftcard_ajx.php?category_id="+category_id;
			//alert(url);
			xmlHttp.open("GET",url,true)
										
					// define the method to handle server responses 
					xmlHttp.onreadystatechange = handleServerResponse; 
					// make the server request 
					xmlHttp.send(null); 
		} 
		
		
						// if the connection is busy, try again after one second 
} 
// executed automatically when a message is received from the server 
function handleServerResponse() 
{ 
			// move forward only if the transaction has completed 
			if (xmlHttp.readyState == 4) 
			{ 
			// status of 200 indicates the transaction completed successfully 
			
					if (xmlHttp.status == 200) 
					{
							// extract the XML retrieved from the server 
							
							xmlResponse = xmlHttp.responseText;
							//alert(xmlResponse);
							var info=document.getElementById("product_list");
							info.innerHTML=xmlResponse;
							
					} 
					// a HTTP status different than 200 signals an error 
					else 
					{ 
							alert("There was a problem accessing the server: " + xmlHttp.statusText); 
					} 
			} 
}
function CheckGiftInfo(frmName)
{
	if(!validateBlank(frmName,'gretting',"Enter Greeting"))
	return false;
	 //-email
	if(!Check(frmName,'gretting'))
	return false;
	
	RemoveBad(frmName,'gretting')
	
	if(!validateBlank(frmName,'txtMessage',"Enter Personal Message"))
	return false;
	 //-email
	if(!Check(frmName,'txtMessage'))
	return false;
	
	RemoveBad(frmName,'txtMessage')
	
	if(!validateBlank(frmName,'closing',"Enter Closing"))
	return false;
	 //-email
	if(!Check(frmName,'closing'))
	return false;
	
	RemoveBad(frmName,'closing')
	
	if(!validateBlank(frmName,'gift',"Enter Gift"))
	return false;
	 //-email
	if(!Check(frmName,'gift'))
	return false;
	
	RemoveBad(frmName,'gift')

	if(!validateBlank(frmName,'to_email',"Enter Recipient Email Address"))
	return false;
			
	if(!validateEmail(frmName,'to_email',"Enter Valid Recipient Email Address"))
	return false;
	
	if(!validateBlank(frmName,'from_name',"Enter Your Name"))
	return false;
	 //-email
	if(!Check(frmName,'from_name'))
	return false;
	
	RemoveBad(frmName,'from_name')
	
	if(!validateBlank(frmName,'your_email',"Enter Your Email Address"))
	return false;
			
	if(!validateEmail(frmName,'your_email',"Enter Valid Your Email Address"))
	return false;
	
	if(!validateBlank(frmName,'send_date1',"Select Send Date"))
	return false;

}

