function searchOccasions()
{
	var t = document.x.occasion.value;
     if(t == "S")
		return false;
	else
	{
		window.location = "/Pakistan-Gifts-Display.php?giftcategoryID=60&giftsubcategoryID=" + t;
	}
}

function searchCountry()
{
	var t = document.selectCountry.country.value;
     if(t == "S")
		return false;
	else if (t=="1") {
     window.location = "/gifts-to-pakistan.php?countryGiftID=" + t;
        }
 else
	{
		window.location = "/international-flower-delivery.php?countryGiftID=" + t;
	}
}

function priceRange()
{
	var t = document.price.pricerange.value;
     if(t == "S") {
		return false;
   }
 else
	{
		window.location = "/search.php?priceOption=" + t;
	}
}

function changeCurrency()
{
	var t = document.c.currency.value;

    var url = document.c.url.value;

     if(t == "S") {
		return false;
    }

 else
	{
  var completeURL =url+"currencyID="+t;
  window.location = completeURL;
	}
}

function searchs()
{
	var t = document.y.city.value;

	if(t == "S")
		return false;
	else
	{
		window.location = "/search.php?cityID=" + t;
	}
}
function searchSite()
{
	var temp = document.z.search.value;
	if(temp == '')
	{
		alert('Enter a search keyword to continue ...');
		return false;
	}
	document.z.submit();
}

function verifyemail()
{
	var temp=document.form3.emailaddress.value;
	var ch;

	if(temp.indexOf("@")<0 || temp.indexOf(".")<0)
	{
		alert('Email format is Invalid,  Example: someone@domain.com');
		return false;
	}
	else if(temp.indexOf("@") > temp.indexOf("."))
	{
		if(temp.indexOf(".",temp.indexOf(".")+1) < 0)
		{
			alert('Email format is Invalid,  Example: someone@domain.com');
			return false;
		}
	}


	for(var i=0; i<temp.length; i++)
	{
		ch = temp.charAt(i);
		if(ch=='~' ||ch=='!' ||ch=='#' ||ch=='$' ||ch=='%' ||ch=='^' ||ch=='&' ||ch=='*' ||ch=='(' ||ch==')' ||ch=='+' ||ch=='-' ||ch=='/' ||ch=='=' ||ch=='`')
		{
			alert('Illegal Character '+ch+ ' found in email String !');
			return false;
		}
	}

	document.form3.submit();
}

