<!--
	//<![CDATA[
    <!-- 
    var m_origImgSrc;
    var m_origImgLargeSrc;
    var m_zoomImagName;
    var m_zoomURL;
    var m_maxZoomLevel = 3;
    var m_imgFileName = new Array();
    var m_zoomLevel = new Array();
    var m_imgAspectX = new Array();
    var m_imgAspectY = new Array();

    var clickX = 0;
    var clickY = 0;
    var clickZoomDir = 0;

    var loaded=0;
    var lastDiv=0;
    var zooming=0;
    
    function init()
    {
        if (loaded==0) 
        {
            if (GetElementById('mainprodimagewrap')) 
            {
		        panarrowsDiv=GetElementById('panarrows').style;
				if(imageViewerDiv1 != null)
				{
                    imageViewerDiv1Div=GetElementById('imageViewerDiv1').style;
				}
				if(imageViewerDiv2 != null)
				{
                       	imageViewerDiv2Div=GetElementById('imageViewerDiv2').style;
				}
            }
            loaded = 1
        }  
    } 

    //function to show and hide categories
    function showLayer(mystring,hide){
    	if(loaded){
    		if(hide==1){
				eval(mystring).visibility="hidden"
                imageViewerDiv1Div.visibility="hidden"
                imageViewerDiv2Div.visibility="hidden"
                zooming = 0
    		}
    		if(hide==null || hide == 2){
				eval(mystring).visibility="visible"
                imageViewerDiv1Div.visibility="visible"
                imageViewerDiv2Div.visibility="visible"
                zooming = 1
    		}
    	}
    }
    
    function setpanarrowsDiv()
    {
        if(loaded)
        {
            var imgHeight = document.images["imgProduct"].height;
            panarrowsDiv.top = imgHeight - 40;
        }
    }
  
   //launch product page popup  
   function pop(strURL,type) 
   {
  
    if (type == "largerView")
    {

      var feature = window.open(strURL,'type','toolbar=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=640,height=675');
    }
    if (type == "swatchDisplay")
    {
      window.name = "swatchDisplay";
      var feature = window.open(strURL,'type','toolbar=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=640,height=640');
    }
    if (type == "sizeAndFitInfo")
    {
      window.name = "sizeAndFitInfo";
      var feature = window.open(strURL,'type','toolbar=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=656,height=640');
    }
   }

   function popMain(strURL) 
   {
    if (zooming)
    {
      setImage('imgProduct', clickZoomDir);
    }
    else
    {
      pop(strURL,"largerView");    
    }
   }

  
 //swaps out swatch and color view data in swatch viewer  
   function swatchSwap(imgSwatchData, imgColorData ,isRGB , imgWidth, imgHeight, numColors, swatchIndex, swatchCount) 
   {
      var htmlText="";    
     
      
      if( document.images )
      {        
        if( "" == imgColorData )
        {
          if( null != document.images.imgColorView )
            document.images.imgColorView.Alt = "No Image to show.";
        }
        else
        {
          if( null != document.images.imgColorView )
            document.images.imgColorView.src = imgColorData;
        }
      }
      
      if(0 >= numColors)
        numColors = 1;
      
      if( "0" == isRGB ) // if it is a swatch image
      {              
          // set the large swatch source
          // generate a table with the specified color
          htmlText = "<table cellpadding=\"0\" cellspacing=\"0\"><tr><td>";              
          htmlText = htmlText + "<img src=\""+ imgSwatchData +"\" width=\"" + imgWidth + "px\" height=\"" + imgHeight + "px\" />";             
          htmlText = htmlText + "</td></tr></table>";  
      }
      else // if it is an RGB 
      {   
          var swatches = imgSwatchData.split(":");
          var colorCount = 0;
          if( null != swatches )
          {
            // generate a table with the specified color
            htmlText = "<table cellpadding=\"0\" cellspacing=\"0\"><tr>";              
            for( colorCount=0 ; colorCount < numColors ; colorCount++ )
            {              
              htmlText = htmlText + "<td id=\"row" + colorCount + "\" height=\"" + imgHeight + "px\" width=\"" + (imgWidth/numColors) + "px\" bgcolor=\"#" + swatches[colorCount] + "\" >";
              htmlText = htmlText + "</td>";
            }          
            htmlText = htmlText + "</tr></table>";
          }               
      }// end - else RGB
      
    // write out the generated HTML to the DIV tag
    
    GetElementById("imgSwatchView").innerHTML = htmlText;       
 
    highlightSwatch(swatchIndex, swatchCount);

  }


/*
 * To highlight the selected Swatch
 */
function highlightSwatch(swatchIndex, swatchCount)
{    
    var swatchNum =1;
     
    // first 'de-select' all the swatches
    for(swatchNum = 1; swatchNum <= swatchCount; swatchNum++ )
    {
      if( 0 == (swatchNum %2))
      { 
        if(null != GetElementById("swatchTd" + (swatchNum-1)) )
          GetElementById("swatchTd" + (swatchNum-1)).className = "swatchCollectionDisplay3";   
      }
      else if( 1 == (swatchNum %2) )
      {
         if(null != GetElementById("swatchTd" + (swatchNum-1)) )
           GetElementById("swatchTd" + (swatchNum-1)).className = "swatchCollectionDisplay3";   
      } 
    }
    
    // highlight the selected swatch            
    if(null != GetElementById("swatchTd" + swatchIndex) )
    {          
      GetElementById("swatchTd" + swatchIndex).className = "swatchCollectionDisplay9";
    }    
}

  
  //swaps out main image on product page  & other dependent data
	function imageSwap(index,count,imgURL,imgLargeURL, zoomImageName,zoomURL,swatchIndex,swatchCount,largerViewURL, altZoomAvailable, zoomInPicUrl, displayViewLargerLink, viewLargerPicUrl)
	{	  
	   if( altZoomAvailable == 0 )
	  {	      	     
       //remove the 'href' attribute so that no link appears in place of the 'Zoom In' image
       GetElementById("ImageViewerZoomHrefId").removeAttribute("href");
       // hide the span
		GetElementById("zoomInLink").style.display="none";
	  }  
	  else
	  {
	    // display the span
		GetElementById("zoomInLink").style.display="";
	    // add the path to the 'Zoom In' image URL
	  	document.images.ImageViewerZoomId.src =zoomInPicUrl;
	  	// add or set the href attribute of the 'Zoom In' link
	  	GetElementById("ImageViewerZoomHrefId").setAttribute("href","javascript:zoomIn('imgProduct');javascript:showLayer('panarrowsDiv');"); 
	  }

	  resetZoom('imgProduct');
		showLayer('panarrowsDiv',1);
		initZoomVars('imgProduct',imgURL,imgLargeURL,zoomImageName, zoomURL);	
	
		if (document.images) 
		{
			document.images.imgProduct.src = imgURL;
		}
		
		// if this flag is not set, then disable the href of the main image
		// and also remove the 'View Larger' link
		if( displayViewLargerLink == 0)
		{
		  // hide the span
		  GetElementById("viewLargerLink").style.display="none";
		  // remove the href of the main Image
		  if( GetElementById("mainProdImageHref") )
		    GetElementById("mainProdImageHref").removeAttribute("href");
		  // remove the 'View Larger' link
		  if( GetElementById("viewLargerImgId") )
		    GetElementById("viewLargerImgId").removeAttribute("href");		  
		}
		else
		{
		  // show the span
		  GetElementById("viewLargerLink").style.display="";		 
		  // enable the 'View Larger' pic
		  document.images.viewLargerImgId.src = viewLargerPicUrl;
		  // add or change the Href of the Main image 
		  if( null != GetElementById("mainProdImageHref"))
		  {
		    GetElementById("mainProdImageHref").setAttribute("href","javascript:popMain('" + largerViewURL + "');" );
		  }		
		
	    // add or change the Href of the 'View Larger' link
		  if( null != GetElementById("viewLargerImageHref"))
		  {
		    GetElementById("viewLargerImageHref").setAttribute("href","javascript:pop('" + largerViewURL + "','largerView');" );
		  }		  
		}
    
    highlightImage(index,count);
    
    highlightSwatch(swatchIndex, swatchCount);
	}
	
	//sets hightlight on correct alt image
	function highlightImage(index,count)
	{
	  /*
	   * 'De-select' all the images
	   */
		for (i = 0; i <= count; i++)
		{
		  if( null != GetElementById("MiniSelected_"+i))
		  {
			  GetElementById("MiniSelected_"+i).className="imageViewer1";
			}
		}
			
		/*
		 * Highlight the chosen Image
		 */
		if( null != GetElementById("MiniSelected_"+index))
		{
		  GetElementById("MiniSelected_"+index).className="imageViewer4";			
		}		
	}
	
//zoom functions follow
function initZoomVars(imgName, imgURL, imgLargeURL, imgFileName, zoomURL) 
{
	m_zoomLevel[imgName] = 0;
	m_imgAspectX[imgName] = 0;
	m_imgAspectY[imgName] = 0;
	if ( imgFileName ) {
		m_imgFileName[imgName] = imgFileName;
    m_origImgSrc = imgURL;
    m_origImgLargeSrc = imgLargeURL;
    m_zoomImageName = imgFileName;
    m_zoomURL = zoomURL;

	}
}

function setCoords(evt, imgName) {
	if ( window.navigator.appName == "Microsoft Internet Explorer" ) {
		clickX = evt.offsetX;
		clickY = evt.offsetY;
		if ( evt.altKey ) {
			clickZoomDir = -1;
		} else {
			clickZoomDir = 1;
		}
	} else {
		clickX = evt.x - document.images[imgName].x;
		clickY = evt.y - document.images[imgName].y;
		if ( evt.modifiers & Event.ALT_MASK > 0 ) {
			clickZoomDir = -1;
		} else {
			clickZoomDir = 1;
		}
	}
}

function getMagnifyLevel(zLev) {
	var magLevel = 0;
	switch(zLev) {
		case 1:
			magLevel = 2;
			break;
		case 2:
			magLevel = 4;
			break;
		case 3:
			magLevel = 8;
			break;
		case 4:
			magLevel = 16;
			break;
		default:
			magLevel = 1;
			break;
	}
	return magLevel;
}

function resetZoom(imgName) {
	initZoomVars(imgName);
	document.images[imgName].src = m_origImgSrc;
}

function zoomIn(imgName) {
	centerClick(imgName);
	setImage(imgName, 1);
}

function zoomOut(imgName) {
	centerClick(imgName);
	setImage(imgName, -1);
}

function centerClick(imgName) {
	clickX = document.images[imgName].width / 2;
	clickY = document.images[imgName].height / 2;
}

function panImage(imgName, xDir, yDir) {
	var img = document.images[imgName];
	if ( xDir == 1 ) {
		clickX = img.width * .75;
	} else {
		if ( xDir == -1 ) {
			clickX = img.width * .25;
		} else {
			clickX = img.width * .5;
		}
	}
	if ( yDir == 1 ) {
		clickY = img.height * .75;
	} else {
		if ( yDir == -1 ) {
			clickY = img.height * .25;
		} else {
			clickY = img.height * .5;
		}
	}
	setImage(imgName, 0);
}

function setImage(imgName, zoomDir) {

	if ( zoomDir == 1 ) {
		if ( m_zoomLevel[imgName] == m_maxZoomLevel ) {
			alert("You have zoomed in as far as possible.");
			return;
		}
		m_zoomLevel[imgName]++;
	} else {
		if ( zoomDir == -1 ) {
			if ( m_zoomLevel[imgName] == 0 ) {
				alert("You have zoomed out as far as possible.");				
				return;
			}
			m_zoomLevel[imgName]--;
		}
	}
	
	if ( m_zoomLevel[imgName] == 0 ) {
		resetZoom(imgName);
		// since the image comes to its default view, the pan arrows should not be visible
		showLayer('panarrowsDiv',1);
		return;
	}
	
	var pixelWidth = document.images[imgName].width;
	var pixelHeight = document.images[imgName].height;
	var aspect = pixelWidth / pixelHeight;
	var aspectWidth = aspect;
	var aspectHeight = aspect * pixelHeight / pixelWidth;

	var pixelOffsetX = (m_imgAspectX[imgName] / aspectWidth) * pixelWidth;
	var pixelOffsetY = (m_imgAspectY[imgName] / aspectHeight) * pixelHeight;

	var adjustedClickX = pixelOffsetX + clickX / getMagnifyLevel(m_zoomLevel[imgName] - zoomDir);
	var adjustedClickY = pixelOffsetY + clickY / getMagnifyLevel(m_zoomLevel[imgName] - zoomDir);

	var magLevel = getMagnifyLevel(m_zoomLevel[imgName]);

	var imgAspectWidthCenter1 = adjustedClickX / pixelWidth * aspectWidth;
	var imgAspectHeightCenter1 = adjustedClickY / pixelHeight * aspectHeight;
	
	m_imgAspectX[imgName] = imgAspectWidthCenter1 - (aspectWidth / (magLevel * 2));

	if (m_imgAspectX[imgName] < 0 ) {
		m_imgAspectX[imgName] = 0;
	}
	
	m_imgAspectY[imgName] = imgAspectHeightCenter1 - (aspectHeight / (magLevel * 2));
	if (m_imgAspectY[imgName] < 0 ) {
		m_imgAspectY[imgName] = 0;
	}

	var imgWidth = aspectWidth / magLevel;
	var imgHeight = aspectHeight / magLevel;
	
	if ( (m_imgAspectX[imgName] + imgWidth) > aspectWidth ) {
		m_imgAspectX[imgName] = aspectWidth - imgWidth;
	}
	if ( (m_imgAspectY[imgName] + imgHeight) > aspectHeight ) {
		m_imgAspectY[imgName] = aspectHeight - imgHeight;
	}

	var newSrc = m_zoomURL + m_imgFileName[imgName]
		+ '?wid=' + document.images[imgName].width + '&qlt=70' 
		+ '&rgn=' + m_imgAspectX[imgName] + ',' + m_imgAspectY[imgName] + ','
			+ imgWidth + ',' + imgHeight
		+ '&cvt=jpeg';
		
	document.images[imgName].src = newSrc;
}    
    //]]>
// --><!-- ph=1 -->
<!-- nhm:from_kauri -->
