/*
 *   (c) Copyright 2007 Hen's Teeth Network, Inc. All rights reserved.
 *   Redistribution without prior written permission is strictly prohibited.
 *   Contact Art Zemon www.hens-teeth.net
 *
 */

function htnRedirectToWishlist(oForm)
{
	oForm.setAttribute("action", "/HTN/wishlist/index.php");
}

function htnRedirectStyleItemToWishlist(oForm)
{
	oForm.setAttribute("action", "/HTN/wishlist/index.php?wltype=1");
}

function htnRedirectEdgeOfUrgeToWishlist(key)
{
    alert('redirecting');
    location = "http://edgeofurge.com/HTN/wishlist/index.php?key=" + key + "&wlAddItem.x=45&wlAddItem.y=11&wlAddItem=wlAddItem";
}


function htnWishListSelectStyle()
{
	var sURLSuffix = location.href;
	var aURLParts = sURLSuffix.split('&');
	var aPart;
	var sStyleSKU = '';
	var flagWLStyleItem = false;
	for (var i=0; i < aURLParts.length; i++)
	{
		aVar = aURLParts[i].split('=');
		if ('wlstyle' == aVar[0])
		{
			sStyleSKU = aVar[1];
			flagWLStyleItem = true;
			break;
		}
	}
	
	if (! flagWLStyleItem)
	{
		return;
	}
	
	var oSelect = document.style_item_form.key;
	for (var i=0; i < oSelect.length; i++)
	{
		if (sStyleSKU == oSelect[i].value)
		{
			oSelect.selectedIndex = i;
		}
	}
}
