	function Popup(Link,WinName,Height,Width,X,Y)
	{// Written By : Mohammad Kaiser Anwar
		Win = window.open(Link,WinName,"height="+Height+",width="+Width+",top="+Y+",left="+X+",location=no,menubar=0,statusbar=0,locationbar=0,scrollbars=1,resizable=0");
		Win.resizeTo(Width,Height);
		return(Win);
	}
	function IsEmpty(Text)
	{
		Text = Text.split(" ");
		Text = Text.join("");
		return(Text == "");
	}
	function IsBlank(Text)
	{// Written By : Mohammad Kaiser Anwar
		var Count = 0;
		for (var i = 0; i < Text.length; i++)
		{
			if (Text.charAt(i) == " ")
				Count++;
		}
		if (Count == Text.length)
			return(false);
		else
			return(true);
	}
	function IsText(Text,ValidChars)
	{
		for (var i = 0; i < Text.length; i++)
		{
			if (ValidChars.indexOf(Text.substring(i,i+1)) == -1)
				return (false);
		}
		return (true);
	}
	function IsPhone(Text,Empty)
	{// Written By : Mohammad Kaiser Anwar
		if (IsEmpty(Text) == true)
			return(Empty);
		else if (Text.length > 1 && Text.length < 4)
			return(false);
		else
			return(IsText(Text,"- 0123456789"));
	}
	function IsEmail(Text,Empty)
	{// Written By : Mohammad Kaiser Anwar
		if (IsEmpty(Text) == true)
		{
			return(Empty);
		}
		if (Text.indexOf('@') < 1)
		{// '@' cannot be in first position
			return(false);
		}
		if (Text.indexOf('@') != Text.lastIndexOf('@'))
		{// '@' only allowed once
			return(false);
		}
		if (Text.lastIndexOf('.') <= Text.indexOf('@') + 1)
		{// Must be atleast one valid char btwn '@' and '.'
			return(false);
		}
		if (Text.lastIndexOf('.') == Text.length - 1)
		{// Must be atleast one valid char after '.'
			return(false);
		}
		if (Text.indexOf('.') == 0)
		{// No Dot on first position permitted
			return(false);
		}
		if (Text.indexOf('.') + 1 == Text.indexOf('@'))
		{// No Dot on first position permitted
			return(false);
		}
		var ValidChar = " ;<>";
		for (var i = 0; i < Text.length; i++)
		{
			if (ValidChar.indexOf(Text.substring(i,i+1)) >= 0)
			{
				return(false);
			}
		}
		return(true);
	}
	function ManufVerify()
	{
		if (Document.Form.txtSearch1.value == "")
		{
			alert("Please Enter Manufacturer Name !");
			Document.Form.txtSearch1.focus();
			return false;
		}
		if(Document.Form.txtSearch1.value.length < 3)
		{
			alert("Please Search Atleast 3 Characters !");
			Document.Form.txtSearch1.focus();
			return false;
		}
		Document.Form.action = "manufacturersearch.php?ManufName="+Document.Form.txtSearch1.value;
	}
	function BrandVerify()
	{
		if (Document.Form.txtSearch2.value == "")
		{
			alert("Please Enter Brand Name !");
			Document.Form.txtSearch2.focus();
			return false;
		}
		if(Document.Form.txtSearch2.value.length < 3)
		{
			alert("Please Search Atleast 3 Characters !");
			Document.Form.txtSearch2.focus();
			return false;
		}
		Document.Form.action = "brandsearch.php?BrandName="+Document.Form.txtSearch2.value;
	}
	function PharmacyVerify()
	{
		if (Document.Form.txtSearch3.value == "")
		{
			alert("Please Enter Pharmacy Name !");
			Document.Form.txtSearch3.focus();
			return false;
		}
		if(Document.Form.txtSearch3.value.length < 3)
		{
			alert("Please Search Atleast 3 Characters !");
			Document.Form.txtSearch3.focus();
			return false;
		}
		Document.Form.action = "pharmacysearch.php?PharmacyName="+Document.Form.txtSearch3.value;
	}
