
function RedirectToCart(productId, variantId, qty) {


    var isWishList = document.getElementsByName('IsWishList_' + productId + '_' + variantId);
    isWishList.value = '0';

    var isGiftRegistry = document.getElementsByName('IsGiftRegistry_' + productId + '_' + variantId);
    isGiftRegistry.value = '0';

		var quantityField = document.getElementsByName('Quantity_' + productId + '_' + variantId);
		quantityField.value = qty;
		
    document.forms[0].action = '/addtocart.aspx?RequestProductID=' + productId + '&RequestVariantID=' + variantId ;
    document.forms[0].method = 'POST'

    document.forms[0].submit();

    return false;
    //document.forms[0].submit(); 
}

var wpq_shift = 582;
var wpq_speed = 29;
var wpq_hold = false;

var positions = new Array();
var minimums = new Array();

var i;
for (i = 0; i < 100; i++) {
    positions[i] = 0;
    minimums[i] = -3000 + wpq_shift;
	
}

function clickLess(index) {

    var position = positions[index];
	
    if (!wpq_hold && position < 0) {
        moveLess(position + wpq_shift, index);
    }
  
  	
}

function moveLess(max, index) {

    var position = positions[index];
    if (position < max) {
        wpq_hold = true;
		//oohay251@yahoo.com do not allow position to exceed max or the sliding will slowly get off kilter
        position = ((position + wpq_speed) > max) ? max : position + wpq_speed;
        var catName = "store_cat" + index ;
        var positionText = position + "px";
        document.getElementById(catName).style.left = positionText;
        positions[index] = position;
        window.setTimeout("moveLess(" + max + "," + index + ");", 0);
    }
    else {        
        wpq_hold = false;
    }
}

function clickMore(index) {

    var position = positions[index];
    var minimum = minimums[index];
    try {
    if (!wpq_hold && position > minimum) {
        moveMore(position - wpq_shift, index)
    }
  } catch ( e ) 
  {
  	
  }
}

function moveMore(min, index) {

    var position = positions[index];
    
    if (position > min) {
        wpq_hold = true;
		//oohay251@yahoo.com do not allow position to go below min or the sliding will slowly get off kilter
		position = ((position - 29) < min) ? min : position - 29;
        var catName = "store_cat" + index ;
        var positionText = position + "px";
        document.getElementById(catName).style.left = positionText;
        positions[index] = position;
        window.setTimeout("moveMore(" + min + ", " + index + ");", 0);
    }
    else {
        wpq_hold = false;
    }
}

function shiftList(id,dirc)
{
	for(var idx=0;idx < 5;idx++) HideOrShowNext(id,dirc);
}
function HideOrShowNext(id,dirc)
{
	var x = document.getElementById(id);
	if(x && x.hasChildNodes)
	{
		if(dirc == 0)
		{
			
			var y = null;
			for(var e = 0;e < x.childNodes.length;e++)
			{
				y = x.childNodes.item(e);
				if(y.nodeType == 3) continue;
				if(!(y.style && y.style.display == 'none')) break;
				y = null;
			}
			if(y && y.nodeType != 3 && x.childNodes.length > 5 && y != x.childNodes.item(x.childNodes.length - 5))
				y.style.display = 'none';
		}
		else
		{
			
			var y = null;
			for(var e = x.childNodes.length - 1;e >= 0;e--)
			{
				y = x.childNodes.item(e);
				if(y.nodeType == 3) continue;
				if(!(y.style && y.style.display != 'none')) break;
				y = null;
			}
			if(y && y.nodeType != 3) try
			{
				y.style.cssText = y.style.cssText.replace(/(^|;)\w*display:\w*[^;]*/ig,'') + ';display: -moz-inline-stack;display: inline-block;*display:inline;';				
			}
			catch(err)
			{
				try
				{
					var stl = y.getAttributeNode('style');
					stl.value.replace(/(^|;)\w*display:\w*[^;]*/ig,'') + ';display: -moz-inline-stack;display: inline-block;*display:inline;';
					y.setAttributeNode(stl);
				}
				catch(err)
				{
					
				}
			
			}
		}
	}
}