// JavaScript Document

///////////////////////////////////////////////////////////	
////////validation for 'select form dropdown' 'start'////////////////////
///////////////////////////////////////////////////////////

function check_form3()
{
	 with(window.document.form3)
  		{		
   		 if(occasions.selectedIndex=="0")
		 	{
			 alert("Select Occasion!");
			 occasions.focus();
			 return false;
			 }
		 if(feelings.selectedIndex=="0")
		 	{
			 alert("Select Feeling!");
			 feelings.focus();
			 return false;
			 }	 
		}
	}

///////////////////////////////////////////////////////////	
////////validation for 'select form dropdown' 'end'////////////////////
///////////////////////////////////////////////////////////
	
///////////////////////////////////////////////////////////	
////////validation for feedback 'start'////////////////////
///////////////////////////////////////////////////////////

function check_feedfrm()
{
  //alert("fsdf");
with(window.document.feedfrm)
  		{	
		// alert("fsdf");
   		 if(name.value=="")
		 	{
			 alert("Enter Your Name!");
			 name.focus();
			 return false;
			 }
		if(email.value=="")
		 	{
			 alert("Enter Your Email!");
			 email.focus();
			 return false;
			 }	
			  // test if valid email address, must have @ and .	
	var checkEmail = "@.";
	var checkStr = email.value;
	var EmailValid = false;0000000000
	var EmailAt = false;
	var EmailPeriod = false;
		for (i = 0;  i < checkStr.length;  i++)
		{
			ch = checkStr.charAt(i);
				for (j = 0;  j < checkEmail.length;  j++)
				{
					if (ch == checkEmail.charAt(j) && ch == "@")
						EmailAt = true;
					if (ch == checkEmail.charAt(j) && ch == ".")
						EmailPeriod = true;
		  			if (EmailAt && EmailPeriod)
				break;
      	  		if (j == checkEmail.length)
				break;
			}
 
				// if both the @ and . were in the string
				if (EmailAt && EmailPeriod)
				{
					EmailValid = true
					break;
				}
		}
			
			if (!EmailValid)
				{
					alert("Invalid Email Id ! Please Enter Your valid Email Id.");
					email.value="";
				email.focus();
					return(false);
				} 	

			 
		    if(contact.value=="")
		 	{
			 alert("Enter Your Phone No!");
			 contact.focus();
			 return false;
			 }		
			 if(comments.value=="")
		 	{
			 alert("Enter Your Comments!");
			 comments.focus();
			 return false;
			 }	
		}
	}
	
///////////////////////////////////////////////////////////	
////////validation for feedback 'end'////////////////////
///////////////////////////////////////////////////////////


///////////////////////////////////////////////////////////	
////////validation for Contactus 'start'////////////////////
///////////////////////////////////////////////////////////

function check_contactfrm()
{
  //alert("fsdf");
with(window.document.contactfrm)
  		{	
		// alert("fsdf");
   		 if(name.value=="")
		 	{
			 alert("Enter Your Name!");
			 name.focus();
			 return false;
			 }
		if(email.value=="")
		 	{
			 alert("Enter Your Email!");
			 email.focus();
			 return false;
			 }	
			  // test if valid email address, must have @ and .	
	var checkEmail = "@.";
	var checkStr = email.value;
	var EmailValid = false;0000000000
	var EmailAt = false;
	var EmailPeriod = false;
		for (i = 0;  i < checkStr.length;  i++)
		{
			ch = checkStr.charAt(i);
				for (j = 0;  j < checkEmail.length;  j++)
				{
					if (ch == checkEmail.charAt(j) && ch == "@")
						EmailAt = true;
					if (ch == checkEmail.charAt(j) && ch == ".")
						EmailPeriod = true;
		  			if (EmailAt && EmailPeriod)
				break;
      	  		if (j == checkEmail.length)
				break;
			}
 
				// if both the @ and . were in the string
				if (EmailAt && EmailPeriod)
				{
					EmailValid = true
					break;
				}
		}
			
			if (!EmailValid)
				{
					alert("Invalid Email Id ! Please Enter Your valid Email Id.");
					email.value="";
				email.focus();
					return(false);
				} 	

			 
		    if(contact.value=="")
		 	{
			 alert("Enter Your Phone No!");
			 contact.focus();
			 return false;
			 }		
			 if(comments.value=="")
		 	{
			 alert("Enter Your Comments!");
			 comments.focus();
			 return false;
			 }	
		}
	}
	
///////////////////////////////////////////////////////////	
////////validation for Contactus 'end'////////////////////
///////////////////////////////////////////////////////////



///////////////////////////////////////////////////////////	
////////validation for invite a friend 'start'////////////////////
///////////////////////////////////////////////////////////
function check_invitefrm()
{
  //alert("fsdf");
with(window.document.invitefrm)
  		{	
		// alert("fsdf");
   		if(remail.value=="")
		 	{
			 alert("Enter Your Reciepent Email!");
			 remail.focus();
			 return false;
			 }	
			 			 
	     if(Yname.value=="")
		 	{
			 alert("Enter Your Name!");
			 Yname.focus();
			 return false;
			 }		
			 if(yemail.value=="")
		 	{
			 alert("Enter Your Email!");
			 yemail.focus();
			 return false;
			 }	
			 			  // test if valid email address, must have @ and .	
	var checkEmail = "@.";
	var checkStr = yemail.value;
	var EmailValid = false;0000000000
	var EmailAt = false;
	var EmailPeriod = false;
		for (i = 1;  i < checkStr.length;  i++)
		{
			ch = checkStr.charAt(i);
				for (j = 0;  j < checkEmail.length;  j++)
				{
					if (ch == checkEmail.charAt(j) && ch == "@")
						EmailAt = true;
					if (ch == checkEmail.charAt(j) && ch == ".")
						EmailPeriod = true;
		  			if (EmailAt && EmailPeriod)
				    break;
      	  		    if (j == checkEmail.length)
				    break;
			}
 
				// if both the @ and . were in the string
				if (EmailAt && EmailPeriod)
				{
					EmailValid = true
					break;
				}
		}
			
			if (!EmailValid)
				{
					alert("Invalid Email Id ! Please Enter Your valid Email Id.");
					yemail.value="";
				   yemail.focus();
					return(false);
				} 	

			 
		 if(msg.value=="")
		 	{
			 alert("Enter Message!");
			 msg.focus();
			 return false;
			 }	
			 
	}
	}	
	
	///////////////////////////////////////////////////////////	
////////validation for invite a friend 'end'////////////////////
///////////////////////////////////////////////////////////
/*START OVER VALIDATIO */
function start_over(){
window.location="index.php";
}

/*START OVER VALIDATIO */
/*no validation*/
window.defaultStatus = document.title;
		
		function submitForm(strAction)
		{
			if (strAction == 'ok') {
				if(formValidate()) {
					document.formOrder.buttonOK.disabled=true;
					document.formOrder.Action.value=strAction;
					document.formOrder.submit();
				}
			}
			else if (strAction == 'cancel') {
				window.close();
			}
		}
		
		var listObjReqProp = '';
		var listAutoProperties = '';
		
		function isInteger(s)
{
      var i;
	s = s.toString();
      for (i = 0; i < s.length; i++)
      {
         var c = s.charAt(i);
         if (isNaN(c)) 
	   {
		alert("Invalid Contact No !");
		return false;
	   }
      }
      return true;
     }
	function isInteger1(s)
    {
      var i;
	  s = s.toString();
      for (i = 0; i < s.length; i++)
      {
         var c = s.charAt(i);
         if (isNaN(c)) 
	   {
		alert("Invalid Zipcode !");
		return false;
	   }
      }
      return true;
      }
///////////VALIDATION FOR ADD FLOWER START ///////////////////////
 
function check_flower()
{
	 with(window.document.add_flower_frm)
  		{		
   		 if(occasion.selectedIndex=="0")
		 	{
			 alert("Select Occasion!");
			 occasion.focus();
			 return false;
			 }
		 if(feeling.selectedIndex=="0")
		 	{
			 alert("Select Feeling!");
			 feeling.focus();
			 return false;
			 }
		if(flower_name.value=="")
		 	{
			 alert("Select Flower Name!");
			 flower_name.focus();
			 return false;
			 }
		if(flower.value=="")
		 	{
			 alert("Upload Flower Image!");
			 flower.focus();
			 return false;
			 }	 
		}
	}
///////////VALIDATION FOR ADD FLOWER START ///////////////////////