<!--
var preloadFlag = false;

var g_bIsNav4 = false;
if (window.navigator.appName.toLowerCase().indexOf("netscape") > -1)
{
	g_bIsNav4 = true;
}

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeNavImages() {
	if (document.images) {
		for (var i=0; i<changeNavImages.arguments.length; i+=2) {
			document[changeNavImages.arguments[i]].src = changeNavImages.arguments[i+1];
		}
	}
}

function changeImages(imgName,imgSource) {
	if (document.images) {
		document.images[imgName].src = imgSource;
	}
}	

function preloadImages(root) {
	if (document.images && (preloadFlag == false)) {

		nava_prod_o = newImage(root + "/images/nava-prod-o.gif");
		nava_idea_o = newImage(root + "/images/nava-idea-o.gif");
		nava_srch_o = newImage(root + "/images/nava-srch-o.gif");
		nava_phot_o = newImage(root + "/images/nava-phot-o.gif");
		nava_illu_o = newImage(root + "/images/nava-illu-o.gif");
		nava_motn_o = newImage(root + "/images/nava-motn-o.gif");
		nava_merc_o = newImage(root + "/images/nava-mrch-o.gif");
		nava_type_o = newImage(root + "/images/nava-type-o.gif");
		nava_skin_o = newImage(root + "/images/nava-skin-o.gif");
		nava_cata_o = newImage(root + "/images/nava-cata-o.gif");
		nava_wall_o = newImage(root + "/images/nava-wall-o.gif");
		nava_bxng_o = newImage(root + "/images/nava-bxng-o.gif");
		nava_stud_o = newImage(root + "/images/nava-stud-o.gif");
		nav_acct_o = newImage(root + "/images/nav-acct-o.gif");
		nav_ltbx_o = newImage(root + "/images/nav-ltbx-o.gif");
		nav_cart_o = newImage(root + "/images/nav-cart-o.gif");
		nav_help_o = newImage(root + "/images/nav-help-o.gif");
		rollover_blank = newImage(root + "/images/spacer.gif");
		rollover_addct = newImage(root + "/images/rollover-addcart.gif");
		rollover_addlb = newImage(root + "/images/rollover-addlightbox.gif");
		rollover_rmvlb = newImage(root + "/images/rollover-removelightbox.gif");
		rollover_sdtls = newImage(root + "/images/rollover-seedetails.gif");
		overlay_blank = newImage(root + "/images/overlay1.gif");
		overlay_addlb = newImage(root + "/images/overlay2.gif");
		overlay_sdtls = newImage(root + "/images/overlay3.gif");
		overlay_addct = newImage(root + "/images/overlay4.gif");
		overlay_rf = newImage(root + "/images/overlay6.gif");
		overlay_rm = newImage(root + "/images/overlay7.gif");
		overlay_rmvlb = newImage(root + "/images/overlay8.gif");
		overlay_addcp = newImage(root + "/images/overlay9.gif");
		overlay_usage = newImage(root + "/images/overlay11.gif");
		searchnav_all_over = newImage(root + "/images/searchnav-all-o.gif");
		searchnav_phot_over = newImage(root + "/images/searchnav-phot-o.gif");
		searchnav_illu_over = newImage(root + "/images/searchnav-illu-o.gif");
		searchnav_motn_over = newImage(root + "/images/searchnav-motn-o.gif");
		searchnav_type_over = newImage(root + "/images/searchnav-type-o.gif");	
		searchnav_merc_over = newImage(root + "/images/searchnav-merch-o.gif");	
		preloadFlag = true;
	}
}

function crunchypopSelect()
	{
	var i = document.crunchypop.category.selectedIndex;
	var v = document.crunchypop.category.options[i].value;
	location = "/products/" + v;
	}

function openalert(windowname) {
	msgWindow=window.open (windowname,"alertWindow","toolbar=no,menubar=no,resizable=no,scrollbars=no,width=400,height=300");
}

function openhelp(windowname) {
	msgWindow=window.open (windowname,"helpWindow","toolbar=no,menubar=no,resizable=no,scrollbars=yes,width=450,height=470");
}

function openhelpshuttleboard(windowname) {
	msgWindow=window.open (windowname,"helpWindow","toolbar=no,menubar=no,resizable=no,scrollbars=yes,width=450,height=560");
}

function opensmall(windowname) {
	msgWindow=window.open (windowname,"smallWindow","toolbar=no,menubar=no,resizable=no,scrollbars=yes,width=450,height=250");
}

function opencontent(windowname) {
	msgWindow=window.open (windowname,"contentWindow","toolbar=yes,menubar=no,resizable=yes,scrollbars=yes,width=600,height=600");
}

function openpreview(windowname) {
	msgWindow=window.open (windowname,"previewWindow","toolbar=no,menubar=no,resizable=no,scrollbars=no,width=600,height=300");
}

// toggle visibility - snatched from zeldman.com - thanks jeffery!

function toggle( targetId ){
  if (document.getElementById){
  		target = document.getElementById( targetId );
  			if (target.style.display == "none"){
  				target.style.display = "";
  			} else {
  				target.style.display = "none";
  			}
  	}
}

function FindElement(controlId)
{
	if (document.getElementById) {
		var el1 = document.getElementById(controlId);
		if (el1 != null)
		{
			return el1;
		}
	}
		
	if (document.all)
	{
		var el2 = document.all[controlId];
		if (el2 != null)
		{
			return el2;
		}
	}
	
	var frm = document.forms[0];
	var el3 = frm.controlId;
	if (el3 != null) 
	{
		return el3;
	}
	
	for (var i = 0; i < frm.elements.length; i++)   {
		if (frm.elements[i].name.indexOf(el3) != -1) {
			return frm.elements[i];
		}
	}
	
	return null;
}

var g_BlockSubmit = false;
function checkBlockedSubmit()
{
	if (g_BlockSubmit)
	{
		g_BlockSubmit = false;
		return false;
	}
	return true;
}

function trapFlont(evt, flontPreviewUrl, flontSelectionControlId, sizeSelectionControlId, textControlId)
{
	if (!enterKeyPressed(evt))
	{
		return true; 
	}
	else
	{
		g_BlockSubmit = true;
		OpenFlontPreviewFromControl(flontPreviewUrl, flontSelectionControlId, sizeSelectionControlId, textControlId);
		
		evt.cancelBubble = true;
		return false;
	}
}


function trapEnterKey(evt, btnName)
{
	if (!enterKeyPressed(evt))
	{
		return true; 
	}
	else
	{
		__doPostBack(btnName,'');
		
		evt.cancelBubble = true;
		return false;
	}
}

function enterKeyPressed(evt)
{ 
	if (g_bIsNav4)
	{
		if (evt.which != 13 && evt.which != 3)
		{
			return false;
		}
		else
		{
			return true;
		}
	}
	else
	{
		if (event.keyCode != 13 && event.keyCode != 3)
		{
			event.returnValue = event.keyCode;
			return false;
		}
		
		event.returnValue = false;
		return true;
	} 
}

function CalcPrice(url)
{
	window.open(url,"calcprice","resizable=yes,directories=no,toolbar=no,menubar=no,height=760,width=690,top=10,left=10");
}

function OpenFlontPreviewFromControl(flontPreviewUrl, flontSelectionControlId, sizeSelectionControlId, textControlId)
{
	var flontSelectionControl = FindElement(flontSelectionControlId);
	var sizeSelectionControl = FindElement(sizeSelectionControlId);
	var textControl = FindElement(textControlId);
	
	if (flontSelectionControl != null &&
		sizeSelectionControl != null &&
		textControl != null)
	{
		var selectedFlont = flontSelectionControl.selectedIndex;
		var selectedSize = sizeSelectionControl.selectedIndex;
		
		if (selectedFlont >= 0 &&
		    selectedSize >= 0)
		{
			OpenFlontPreview(
				flontPreviewUrl,
				flontSelectionControl.options[selectedFlont].value,
				sizeSelectionControl.options[selectedSize].value,
				escape(textControl.value));
		}
	}
}

function OpenFlontPreview(flontPreviewUrl, fontId, size, text)
{
	var url = flontPreviewUrl + '?fontID=' + fontId + '&size=' + size + '&text=' + text;
	msgWindow = window.open(url, 'previewWindow', 'toolbar=no,menubar=no,resizable=yes,scrollbars=no,width=700,height=400');
}

function OpenZoom(zoomUrl)
{
	msgWindow = window.open(zoomUrl, 'zoomWindow', 'toolbar=no,menubar=no,resizable=yes,scrollbars=no,width=425,height=500');
}

function browseJump(browselistID, productsDir, vendorPage)
{
	var browselistControl = FindElement(browselistID);
	if (browselistControl != null)
	{
		vendorJump(browselistControl, productsDir, vendorPage);
	}
}

function vendorJump(browselistControl, productsDir, vendorPage)
{
	var catPrefix	= "PROD:";
	var vendorCode	= browselistControl.options[browselistControl.selectedIndex].value;
	
	if (vendorCode.length > 0)
	{
		if (vendorCode.indexOf(catPrefix) > -1)
		{
		
			var selectedCat		= vendorCode.replace(catPrefix,"");
			var landingUrl		= productsDir;
			
			switch(selectedCat)
			{
				case "IMG":
				landingUrl		+= "/photography/";
				break;
				
				case "ILL":
				landingUrl		+= "/illustration/";
				break;
				
				case "MOT":
				landingUrl		+= "/motion";
				break;
				
				case "TYP":
				landingUrl		+= "/type";
				break;

				case "MER":
				landingUrl		+= "/merch";
				break;
								
				default:
				break;
			}
		
			window.location = landingUrl;
		}
		else
		{
			var vendorUrl	= productsDir + vendorPage + vendorCode;
			window.location = vendorUrl;
		}
	}
}

function keywordJump(keywordControl, resultsPage)
{
	var keyword	= keywordControl.options[keywordControl.selectedIndex].value;
	
	if (keyword.length > 0)
	{
		var resultsUrl = resultsPage + keyword;
		window.location = resultsUrl;
	}
}

function checkAllItems(allCheck)
{
	var checkStatus = allCheck.checked;
	var frm = document.forms[0];

	for (var i = 0; i < frm.elements.length; i++)
	 {
		if (frm.elements[i].type == "checkbox")
		{
			frm.elements[i].checked = checkStatus;
		}
	}
}

function toggleAllCheckedStatus(thisCheckbox, allCheckboxID)
{
	var thisCheckboxStatus = thisCheckbox.checked;
	var frm = document.forms[0];
	var allCheckBox = FindElement(allCheckboxID);

	if (allCheckBox != null)
	{
		if (thisCheckboxStatus == false) //current box was unchecked
		{
			allCheckBox.checked = false;
		}
		else //current box was checked
		{
			var allItemsChecked = true;
			for (var i = 0; i < frm.elements.length; i++)
			{
				if (frm.elements[i].type == "checkbox" && frm.elements[i] != allCheckBox)
				{
					if (!frm.elements[i].checked)
					{
						allItemsChecked = false;
						break;
					}
				}
			}
			
			allCheckBox.checked = allItemsChecked;
		}
	}
}

function NonCDSearchToggle(cdCheckbox)
{
	FindElement(cdCheckbox).checked = false;
}

function CDSearchToggle(rmCheckbox, rfCheckbox)
{
	FindElement(rmCheckbox).checked = false;
	FindElement(rfCheckbox).checked = false;
}

//********************************************************************
//
//  This code is from Dynamic Web Coding at http://www.dyn-web.com/
//  Copyright 2003 by Sharon Paine 
//  See Terms of Use at http://www.dyn-web.com/bus/terms.html
//  regarding conditions under which you may use this code.
//  This notice must be retained in the code as is!
//
//********************************************************************
//
// Leave in page for way to customize layout of tooltip and avoid
// errors if onmouseovers/onmouseouts before page completely loaded
// (variables for tooltip content are generated dynamically by page)
//
//********************************************************************

function doTooltip(e, msg) {
  if ( typeof Tooltip == "undefined" || !Tooltip.ready ) return;
  Tooltip.show(e, msg);
}

function hideTip() {
  if ( typeof Tooltip == "undefined" || !Tooltip.ready ) return;
  Tooltip.hide();
}

// -->
