<!--


	
	
	/*---------------------------------------------------------------------
		SetUpEmailToAFriend:	Sets up the parameters to send to
								the email to a friend page.
	---------------------------------------------------------------------*/
	function SetUpEmailToAFriend()
	{
		var strUrl
		
		//alert("upc: " + document.getElementById("currentUPCID").value);
		//alert("upc in basket: " + document.basket.upc.value);
		
		strUrl = "email_friend_.asp?sku=" + document.getElementById("productSkuID").value			+
				 "&f="					  + document.getElementById("currentFamilyID").value		+
				 "&upc="				  + document.basket.upc.value								+
				 "&cf="					  + document.getElementById("UpcClickedFromFamilyID").value	+
				 "&cupc="				  + document.getElementById("UpcClickedFromID").value		

		window.open(strUrl,"win",'scrollbars=no,width=480,height=410');
	}
	
	
	/*---------------------------------------------------------------------
		SetCrossSellDisplay:	Turns the display of the cross sell 
								div tags on and off.
	---------------------------------------------------------------------*/
	function SetCrossSellDisplay(strUpcClickedFromFamily, strUpcClickedFrom)
	{	
		//  Set up the variable used for the send a email function for tracking purposes.
		var objCurrentFamily	= document.getElementById("currentFamilyID")
		var objCurrentUPC		= document.getElementById("currentUPCID")
		
		objCurrentUPC.value		= strUpcClickedFrom
		objCurrentFamily.value	= ""
		
		if ( strUpcClickedFromFamily.length == 0 )
		{
			strDiv		= "CrossSellDiv";
			iDisplay	= 0;
			
			setDivDisplay(strDiv, iDisplay);
		}
		else
		{
			var obj = document.getElementById("families")
			
			// Determine which divs to turn on and off.
			var familyArray = obj.value.split(" ");
			
			for (i = 0; i < familyArray.length; i++ )
			{
				strDiv		= familyArray[i];
				iDisplay	= 0;
				
				if ( familyArray[i] == strUpcClickedFromFamily )
				{
					iDisplay	= 1;
					strDiv		= "CrossSellDiv";
					setDivDisplay(strDiv, iDisplay);
					
					strDiv		= strUpcClickedFromFamily;
					
					objCurrentFamily.value	= strUpcClickedFromFamily;
					
					// Loop through each href tag adding the product upc that this family is
					// associated with.
					var	strUpcClickedFromFamilyUpc
					var iPosition
					var strAnchorTag
					var strImageFamilyUPC
					
					var iUpcCount			= document.getElementById(strUpcClickedFromFamily + "UPCCount").value
					var strUpcClickedFrom	= "&upcClickedFrom=" + strUpcClickedFrom
					
					for (j = 1; j <= iUpcCount; j++)
					{
						strUpcClickedFromFamilyUpc	= strUpcClickedFromFamily	+ "upc" + j;
						strImageFamilyUPC			= strUpcClickedFromFamilyUpc + "Image";
						
						var ImageTag	= document.getElementById(strImageFamilyUPC);
						strAnchorTag	= ImageTag.href;
						
						// Removing the the variable &upcClickedFrom first.  If this is not removed, 
						// we just keep adding upcClickedFrom variables. Since this tag is built everytime
						// the mouse activates a new swatch, we must remove the upcClickedFrom before
						// building another one.  The same family can be associated with different
						// variants, thus having different upcClickedFroms.
						
						iPosition	= strAnchorTag.indexOf("&upcClickedFrom=");
						
						if ( iPosition > 0 )
						{
							strAnchorTag = strAnchorTag.substr(0, iPosition);
						}
						
						strAnchorTag = strAnchorTag + strUpcClickedFrom;
						ImageTag.href = strAnchorTag;
						
						//var anchorTag	= document.getElementById(strUpcClickedFromFamilyUpc);
						//anchorTag.href = strAnchorTag;
					}
				}
				setDivDisplay(strDiv, iDisplay);
			}
		}
	}
	
	/*---------------------------------------------------------------------
		setDivDisplay:	Turns the display of the div tag on or off.
	---------------------------------------------------------------------*/
	function setDivDisplay(strDiv, iDisplay)
	{
		if(document.layers)	   //NN4+
		{
		document.layers[strDiv].display = iDisplay ? "inline" : "none";
		}
		else if(document.getElementById)	  //gecko(NN6) + IE 5+
		{
			var obj = document.getElementById(strDiv);
			obj.style.display = iDisplay ? "inline" : "none";
		}
		else if(document.all)	// IE 4
		{
			document.all[strDiv].style.display = iDisplay ? "inline" : "none";
		}
	}
	
	/*---------------------------------------------------------------------
		doSubmit:	Submit the form.
	---------------------------------------------------------------------*/
	function doSubmit()
	{
		document.basket.submit();
	}
	
	/*---------------------------------------------------------------------
		doImage:	This function is called when the consumer moves the
					mouse over the swatch pictures.  It changes the
					picture that is displayed and saves the new upc
					code.
	---------------------------------------------------------------------*/
	function doImage( strImageName, 
					  strLargerImage, 
					  strUPC, 
					  strImageDirectory,
					  strSwatchImage,
					  strSeries,
					  strSwatches,
					  mPrice,
					  bBackOrder,
					  bEmployee,
					  bCorporate,
					  strBackOrderMsg,
					  strBackOrderDisplayDate,
					  strBackOrderDate,
					  strBackOrderFlag,
					  bLSRP,
					  mMSRPPrice,
					  strMSRPPrice,
					  strVariantImage1,
					  strVariantImage2,
					  strVariantImage3,
					  strDisplayAltViews,
					  strAltViewImage1,
					  strAltViewImage2,
					  strAltViewImage3,
					  strAltViewImage4,
					  bLuggageTagMonogramming,
					  bMonogramming,
					  strVariantFamily,
					  bCrossSell,
					  bSpecialMessage,
					  bContainsSpecialMessage,
					  strSpecialMessage,
					  strVariantBullet1,
					  strVariantBullet2,
					  strVariantBullet3,
					  strHbxSwatchName)  //<---- Added 6/22/2007
	{
		var aSwatches;
		var i;
		var j;
		var strDisplayImage;
		var strDiv;
		var iDisplay;
		
		/********************************************************************************
		*  Set page name and product variables with new Swatch Description for HBX
		********************************************************************************/
		
		    hbx.pn=document.hbxProductVars.hbxItem.value + "+" + _hbxSwatchStrip(strHbxSwatchName);
		    hbx.pr=document.hbxProductVars.hbxItem.value + "+" + _hbxSwatchStrip(strHbxSwatchName);	
		    document.basket.hbxSwatchName.value =  _hbxSwatchStrip(strHbxSwatchName);
		    document.form_search.series.value = _hbxSwatchStrip(strHbxSwatchName);
		    _hbPageView(document.hbxProductVars.hbxItem.value + "+" + _hbxSwatchStrip(strHbxSwatchName), hbx.mlc);		   
    		_hbLink(document.hbxProductVars.hbxItem.value + "+" + _hbxSwatchStrip(strHbxSwatchName));
		/********************************************************************************
		*  Set page name and product variables with new Swatch Description for HBX
		********************************************************************************/
		
		/*-------------------------------------------------------------------------------
					This section turns the checkboxes on or off for special divs.
		-------------------------------------------------------------------------------*/
		// Special Message
		strDiv = "SpecialMessageDiv";
		iDisplay = 0;
	
		if ( bContainsSpecialMessage == "True") 
			iDisplay = 1;
			//document.basket.SpecialMessage.value = strSpecialMessage;
		
		if (bSpecialMessage == "True")
			document.basket.SpecialMessage.value = strSpecialMessage;
			
		setDivDisplay(strDiv, iDisplay);
		
		/*-------------------------------------------------------------------------------
					This section turns the checkboxes on or off for monogramming.
		-------------------------------------------------------------------------------*/
		// Monogramming checkbox
		strDiv = "MonogramDiv";
		iDisplay = 0;
		
		if ( bMonogramming  == "True") 
			iDisplay = 1;

		setDivDisplay(strDiv, iDisplay);			
		
		// Luggage Tag Monogramming checkbox
		strDiv = "LuggageTagDiv";
		iDisplay = 0;
		
		if ( bLuggageTagMonogramming  == "True") 
			iDisplay = 1;
			
		setDivDisplay(strDiv, iDisplay);			
		
		/*-------------------------------------------------------------------------------
					This section turns on/off the cross sell item section.
		-------------------------------------------------------------------------------*/
		// Cross Sell Display
		
		if ( bCrossSell == "True")
		{
			SetCrossSellDisplay(strVariantFamily, strUPC);
		}
		
		aSwatches = strSwatches.split(",")

		// Determine where the arrow needs to be pointing to.
		for (i = 0; i < aSwatches.length; i++)
		{
			for (j=0; j < document.images.length; j++)
			{
				if ( document.images[j].name == aSwatches[i] )
				{
					if (document.images[j].name == strSeries)
					{
						document.images[j].src = "images/common/trans1x1.gif"
					}
					else
					{
						document.images[j].src = "images/common/trans1x1.gif"
					}
					break;
				}
			}
		}

		//  Display the specified graphic
		document.basket.upc.value			= strUPC;
		document.basket.LargerImage.value	= strLargerImage;
		//document['ProductImage'].src		= strImageDirectory + strImageName;
		document.getElementById('featured').src		= "http://c0166872.cdn.cloudfiles.rackspacecloud.com/hartmann/" + strImageName.substring(0, strImageName.length - 5) + "3/medium.jpg";
		document.getElementById('popupimage').src		= "http://c0166872.cdn.cloudfiles.rackspacecloud.com/hartmann/" + strImageName.substring(0, strImageName.length - 5) + "3/popup.jpg";
		document.getElementById('magnify').href		= "http://c0166872.cdn.cloudfiles.rackspacecloud.com/hartmann/" + strImageName.substring(0, strImageName.length - 5) + "3/original.jpg";
		Widget.resetWidget();
		document.basket.SwatchImage.value	= strImageDirectory + strSwatchImage;
		var price = document.getElementById("Price");
		setText(price, mPrice);
		document.basket.Series.value	= strSeries;

		//  Determine if this variant has the displayAltViews flag set to "yes"
		//  Display the appropriate image based on this flag.
		strDisplayImage = "but_view_larger.gif";
		if (strDisplayAltViews == "Yes")
			strDisplayImage = "but_view_alt_images.gif";
			
		//document['ViewProduct'].src			  = strImageDirectory + strDisplayImage;
		
		//  Set the alt views image flag and the image names.  These will be passed
		//  to the page for display purposes if this upc supports alt views.
		document.basket.DisplayAltViews.value	= strDisplayAltViews
		
		document.basket.AltViewImage1.value		= strAltViewImage1
		document.basket.AltViewImage2.value		= strAltViewImage2
		document.basket.AltViewImage3.value		= strAltViewImage3
		document.basket.AltViewImage4.value		= strAltViewImage4
		
		// Set the Image name for the Variant bullets
		var variantImage;
		variantImage = document.getElementById("VariantImage1");
		variantImage.innerHtml = strVariantImage1;
		variantImage = document.getElementById("VariantImage2");
		variantImage.innerHtml = strVariantImage2;
		variantImage = document.getElementById("VariantImage3");
		variantImage.innerHtml = strVariantImage3;

		// Display the specific variant bullets
		var variantDiv;
		variantDiv = document.getElementById("VariantDiv");	
		if (strVariantBullet1.length > 0 || strVariantBullet2.length > 0 || strVariantBullet3.length > 0)
		{
			variantDiv.style.display = "inline";
		}
		else
		{
			variantDiv.style.display = "none";
		}
		document.basket.VariantBullet1.value = strVariantBullet1;
		document.basket.VariantBullet2.value = strVariantBullet2;
		document.basket.VariantBullet3.value = strVariantBullet3;

		// Update the backorder information if at least one of the
		// items were set to backorder
		if ( bBackOrder == "True" )
		{
			var boDiv = document.getElementById("backorderDiv");
			boDiv.style.display = "inline";
			
			document.basket.BackOrderMsg.value			= strBackOrderMsg;
			document.basket.DisplayBackOrderDate.value	= strBackOrderDisplayDate;
			
			if (strBackOrderMsg.length == 0 && strBackOrderDisplayDate.length == 0)
			{
				boDiv.style.display = "none";				
			}
		}
		
		document.basket.BackOrderDate.value = strBackOrderDate
		document.basket.BackOrderFlag.value = strBackOrderFlag
		
		// Update the backorder information if at least one of the
		// items have an lsrp
	
		if ( bLSRP == "True" )
		{
			var msrp=document.getElementById("MSRPPrice");
			var msrpLabel=document.getElementById("MSRP");
			var priceLabel=document.getElementById("SalePrice");
			
			if ( strMSRPPrice == 0 ) 
			{
				setText(msrp, "");
			}
			else
			{
				setText(msrp, mMSRPPrice);
			}
			
			if( mMSRPPrice != mPrice )
			{
				msrp.style.textDecoration = "line-through";
				msrpLabel.style.textDecoration = "line-through";
				setText(priceLabel, "Sale Price");
				price.style.visibility = "visible";
			}
			else
			{			
				msrp.style.textDecoration = "none";
				msrpLabel.style.textDecoration = "none";
				price.style.visibility = "hidden";
				setText(priceLabel, "");
			}
		}
			

			
		
		//  Update the msrp display if the employee flag is set to true
		//  Added - 02/15/2006.  Paula Blohm.
		if ((bEmployee == "True") || ( bCorporate == "True"))
		{
				var msrp=document.getElementById("MSRPPrice");
				setText(msrp, mMSRPPrice);
		}
		
	}

    /*---------------------------------------------------------------------
		    ZoomWindow:	This function pop ups a new window.
    ---------------------------------------------------------------------*/
    function ZoomWindow(sku, collection, product)
    {
	    mywin = window.open("zoomView.asp?sku=" + sku + "&collection=" + collection + "&product=" + product,"win",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=610,height=680');
    		
	    if(mywin.open) 
	    { 
		    window['mywin'].focus();
		    window['mywin'].focus(); 
	    }
    }


	/*---------------------------------------------------------------------
		ViewLargerImage:	This function builds the URL string for
							viewing the larger image.
	---------------------------------------------------------------------*/
	function ViewLargerImage( strImageDirectory )
	{
		var	sku;

        sku = document.basket.LargerImage.value.substring(0,document.basket.LargerImage.value.length - 4)

        _hbPageView("/z" + document.hbxProductVars.hbxItem.value + "+" + _hbxSwatchStrip(document.basket.hbxSwatchName.value), "/zoom");
        _hbLink("/z" + document.hbxProductVars.hbxItem.value + "+" + _hbxSwatchStrip(document.basket.hbxSwatchName.value));
//        _hbPageView("/z" + hbx.pn.substring(1), "/zoom");
//        _hbLink("/z" + hbx.pn.substring(1), "/zoom");
        ZoomWindow(sku, document.basket.Collection.value, document.basket.ProductName.value);
		
//		if ( document.basket.DisplayAltViews.value == "No")
//		{
//			strUrl = "ProductLarge.asp?image=" + strImageDirectory + document.basket.LargerImage.value;
//			
//			PopUpWindow(strUrl);
//		}
//		else
//		{
//			var		strArguments;
//			
//			strArguments = "?image1=" + document.basket.AltViewImage1.value;
//			strArguments = strArguments + "&image2=" + document.basket.AltViewImage2.value;
//			strArguments = strArguments + "&image3=" + document.basket.AltViewImage3.value;
//			strArguments = strArguments + "&image4=" + document.basket.AltViewImage4.value;
//			strArguments = strArguments + "&ProductName=" + document.basket.ProductName.value;
//			strArguments = strArguments + "&Collection=" + document.basket.Collection.value;
//			
//			strUrl = "product_alt_views_popup.asp" + strArguments
//			
//			PopUpWindowAlt(strUrl);
//		}
	}
	
	function getText(control) 
	{ 
		if (document.all) 
		{ 
			return control.innerText; 
		} 
		else 
		{ 
			return control.textContent; 
		} 
	} 
	
	function setText(control, value) 
	{ 
		if (document.all) 
		{ 
			control.innerText = value; 
		} 
		else 
		{ 
			control.textContent = value; 
		} 
	}

	
	-->