function DisableEnter()
		{
			if(window.event.keyCode == 13)
			{
				var activeControlId = document.activeElement.id;
				if(activeControlId == "Header1_txtSearchText")
				{
					document.forms[0].Header1_btnSearch.focus();
				}
				else if(document.forms[0].ProductDescription_btnAddToCart != null)
				{	
					if(document.forms[0].ProductDescription_btnAddToCart.Active == true)
					{
						document.forms[0].ProductDescription_btnAddToCart.focus();
					}
				}
			}
		}
		
function clickButton(e, buttonid)
{ 
	var bt = document.getElementById(buttonid); 
    if (typeof bt == 'object')
    { 
		if(navigator.appName.indexOf("Netscape")>(-1))
		{ 
			if (e.keyCode == 13)
			{ 
				
				if(document.activeElement != null)
				{
					var activeControlId = document.activeElement.id;
					if(activeControlId == "Header1_txtSearchText")
					{
						document.forms[0].Header1_btnSearch.click();
					}
					else if(bt != null)
					{	
						
							bt.click();
						
					}
				}
				else if(bt != null)
				{	
					
						bt.click();
					
				}
				
               
               return false; 
            } 
        } 
        if (navigator.appName.indexOf("Microsoft Internet Explorer")>(-1))
        { 
			if (event.keyCode == 13)
			{ 
				var activeControlId = document.activeElement.id;
				if(activeControlId == "Header1_txtSearchText")
				{
					document.forms[0].Header1_btnSearch.click();
				}
				else if(bt != null)
				{	
					
						bt.click();
					
				}
                return false; 
            } 
         } 
    } 
}

//Product description
var hdnClicked;
			var hdnSelProd;
			var hdnErrMsg;
			var lblErr;			
			var err_Qty;
			var err_Number;
			var hdnPostBack;
			var hdnTempProductId;
			function SelectAllClicked( selectAll )
			{
				var frm = document.forms[0];
				for(i=0;i< frm.elements.length;i++)
				{
					var e = frm.elements[i];
					if(e.type=='checkbox' && e.name.indexOf('chkSelectEach') != -1)
						e.checked = selectAll;
				}	
			}
			function AddToFavoritesClicked(  )
			{
				HideError();
				var k = CollectProducts();
				//alert(k);
				if (k == "")
				{
					return false;
				}
				else
				{
					hdnClicked.value = "AddToFavourites";	
					__doPostBack('btnAddToFavourites', '');
					return true;
				}
			}
			function AddToCartClicked()
			{
				
				HideError();
				var k = CollectProducts();
				alert(k);
				if (k == "")
				{
				 	return false;
				}
				else if (hdnClicked.value != "Ok")					
				{
					//alert(hdnClicked.value);
					//alert(err_Qty);
					ShowError(err_Qty);  //"Please enter a valid Quantity.";
					//return false;
					hdnClicked.value = "AddToCart";	
					__doPostBack('btnAddToCart', '');
					return true;
				}
				else
				{
					hdnClicked.value = "AddToCart";	
					__doPostBack('btnAddToCart', '');
					return true;
				}
			}
			
			function CollectProducts()
			{
				var frm = document.forms[0];
				var qty; var proID;				
				hdnSelProd.value = "";
				hdnClicked.value = "0";
				for(i=0;i< frm.elements.length;i++)
				{
					var e = frm.elements[i];
					if (e.name.indexOf('txtQuantity') != -1)	
					{
						//proID = e.productID;
						proID = hdnTempProductId.value;
						
						qty = e.value;
						hdnSelProd.value += "" + proID + "~" + qty + "|";
						if (qty != "" && qty != 0 )
							hdnClicked.value = "Ok";
					}
				}
				//alert(hdnSelProd.value);
				return hdnSelProd.value;
			}
			
			function FindHiddenControls()
			{
				if (hdnClicked == null || hdnSelProd == null || lblErr == null || hdnPostBack == null || hdnTempProductId == null)
				{
					var frm = document.forms[0];
					for(i=0;i< frm.elements.length;i++)
					{
						var e = frm.elements[i];
						if (e.name.indexOf('hdnButtonClicked') != -1)	
						{
							hdnClicked = e;
						}
						else if (e.name.indexOf('hdnSelectedProducts') != -1)	
						{
							hdnSelProd = e;
						}			
						else if (e.name.indexOf('hdnErrorMessages') != -1)	
						{
							hdnErrMsg = e;
						}	
						else if (e.name.indexOf('hdnAfterPostBack') != -1)	
						{
							hdnPostBack = e;
						}	
						else if (e.name.indexOf('hdnProductID') != -1)	
						{
							hdnTempProductId = e;
						}
						else if (e.name.indexOf('lblError') != -1)	
						{
							lblErr = e;
							if (lblErr.value == "")
							HideError();
						}			
					}
				}
				//if (lblErr.value == "")
				// HideError();
				GetErrorMessages();
			}
			function GetErrorMessages()
			{
				if (hdnErrMsg != null)
				{
					var k;
					k =	hdnErrMsg.value.split('|')[0];
					if (k.indexOf('0~') != -1 )
					{
						err_Qty = k.substring(2,k.length);
					}
					k =	hdnErrMsg.value.split('|')[1];
					if (k.indexOf('1~') != -1 )
					{
						err_Number = k.substring(2,k.length);
					}
				}
			}
			function validateQuantity(ctrl)
			{
				var enteredValue = ctrl.value;
				FindHiddenControls();
				//HideError();
				if ( (enteredValue != "") && (isNaN( enteredValue) == true) )
				{
					ShowError(err_Number);	//"Please enter a valid Number.";
					ctrl.value="";
					//ctrl.focus();
				}
				else if ( eval(enteredValue ) < 0 || enteredValue.indexOf('.') != -1)
				{
					ShowError(err_Qty);  //"Please enter a valid Quantity.";
					ctrl.value="";
					//ctrl.focus();					
				}
			}
			function showPopup( imageName )
			{
				//window.open("../../OrderManagement/ImagePopup.aspx?ImagePath=" + imageName);
				//window.open("/laspki/OrderManagement/ImagePopup.aspx?ImagePath=" + imageName,'',"height=300, width=300, left=100, top=100,location=no, menubar=no, resizable=no,scrollbars=no, titlebar=no, toolbar=no", true);
				//window.open("../../OrderManagement/ImagePopup.aspx?ImagePath=" + imageName,'',"height=300, width=300, left=100, top=100,location=no, menubar=no, resizable=no,scrollbars=no, titlebar=no, toolbar=no", true);
				window.open("ImagePopUp.htm?ImagePath=" + imageName,'',"height=300, width=300, left=100, top=100,location=no, menubar=no, resizable=yes,scrollbars=yes, titlebar=no, toolbar=no", true);
			}
			
			function showImagePopup( imageName, alttext )
			{
				if(navigator.appName == "Netscape")
				{
					window.open("../Templates/EnlargeImgPopUp.aspx?ImagePath=" + imageName + "&AltText=" + alttext ,'',"height=300, width=300, left=100, top=100,location=no, menubar=no, resizable=yes,scrollbars=yes, titlebar=no, toolbar=no", true);			
				}
				else
				{
					if(hdnPostBack.value == 1)
					{
						window.open("ImagePopUp.htm?ImagePath=" + imageName + "&AltText=" + alttext ,'',"height=300, width=300, left=100, top=100,location=no, menubar=no, resizable=yes,scrollbars=yes, titlebar=no, toolbar=no", true);
					}
					else
					{
						window.open("../Templates/EnlargeImgPopUp.aspx?ImagePath=" + imageName + "&AltText=" + alttext ,'',"height=300, width=300, left=100, top=100,location=no, menubar=no, resizable=yes,scrollbars=yes, titlebar=no, toolbar=no", true);
					}
				
				}
				
			}
			
			function showstatus(status)
			{
				window.status = status;
			}
			
			function HideError()
			{	
				var frm = document.forms[0];
				for(i=0;i< frm.elements.length;i++)
				{
					var e = frm.elements[i];
					//alert(e.name);
					if (e.name.indexOf('lblError') != -1)	
					{			
						e.value = "";
						e.style.visibility = "hidden";
						e.style.display = "none";
					}
				}
			}
			function ShowError(ErrMsg)		
			{
			//alert(ErrMsg);
			var frm = document.forms[0];
			//alert(frm.elements.length);
				for(i=0;i< frm.elements.length;i++)
				{
					var e = frm.elements[i];
					//alert(e.name);
					if (e.name.indexOf('lblError') != -1)	
					{			
						//e.value = "";
						//e.style.visibility = "hidden";
						alert(ErrMsg);
						e.style.display = "";
						e.classname = "errorfulloutline";
						e.style.visibility = "visible";
						e.value = ErrMsg;
					}
				}
				//lblError.style.display = "";
				//lblError.className = "errorfulloutline";
				//lblError.style.visibility = "visible";
				//lblError.value = ErrMsg;
			}
			/*function SetThumbnailSize(imgId)
			{	
				var img = document.getElementById(imgId);
				if (img != null)
				{
					img.height = (50 < img.height)? 50 : img.height;
					img.width = (50 < img.width)? 50 : img.width;
				}
				if(img != null && img.src == "")
				{alert("in");
					img.style.visibility = "hidden";
				}
				alert();
			}*/
			function SetThumbnailSize()
			{	
				var img = document.getElementById("SmallImg");
				if (img != null)
				{
					img.height = (50 < img.height)? 50 : img.height;
					img.width = (50 < img.width)? 50 : img.width;
				}
				
			}
			
			function ShowTop()
			{
				//window.moveTo(50,50);
				//window.navigate("#top");
				window.location.hash='top';
			}
			
			function ShowBottom()
			{
				window.location.hash = 'rel_items_anchor';
				//window.navigate("#rel_items");			
			}
			function clickButton(e, buttonid)
		{ 
			var bt = document.getElementById(buttonid); 
			if (typeof bt == 'object')
			{ 
				if(navigator.appName.indexOf("Netscape")>(-1))
				{ 
					if (e.keyCode == 13)
					{ 
						
							bt.click();
							return false; 
						            
		              
					} 
				} 
				if (navigator.appName.indexOf("Microsoft Internet Explorer")>(-1))
				{ 
					if (event.keyCode == 13)
					{ 
						
							bt.click();
							return false; 
						
					} 
				} 
			}			 
		}
		function fnLockAlpha()
		{	   
		if(window.event.keyCode >=48 && window.event.keyCode <=57)
		{}
		else
		window.event.keyCode = 27;
		}
		
		function showImagePopupMarket( imageName, alttext )
		{
		
			if(navigator.appName == "Netscape")
			{				
				window.open("../Templates/EnlargeImgPopUp.aspx?ImagePath=" + imageName + "&AltText=" + alttext ,'',"height=300, width=300, left=100, top=100,location=no, menubar=no, resizable=yes,scrollbars=yes, titlebar=no, toolbar=no", true);			
			}
			else
			{
				window.open("ImagePopUp.htm?ImagePath=" + imageName + "&AltText=" + alttext ,'',"height=300, width=300, left=100, top=100,location=no, menubar=no, resizable=yes,scrollbars=yes, titlebar=no, toolbar=no", true);
								
			}
			
		}
