﻿// JScript File


var cartX;
var cartY;

cartX = -75; //ff3,ie7,ie8
//x = -163; //ie6
cartY = -2;

if (/MSIE (\d+\.\d+);/.test(navigator.userAgent))
    { 
    //test for MSIE x.x;
    var ieversion=new Number(RegExp.$1) // capture x.x portion and store as a number
    
    if (ieversion>=8)
        {
        //document.write("Damn, You're using IE8 or above, use FireFox")
        }
    else if (ieversion>=7)
        {
        //document.write("Damn, You're using IE7.x, use FireFox")
        }
    else if (ieversion>=6)
        {
        //document.write("Damn, You're using IE6.x, use FireFox")       
        cartX = -163; //ie6
        }
    else if (ieversion>=5)
        {
        //document.write("Damn, You're using IE5.x, use FireFox")
        cartX = -163; //ie6
        }
    }

function setVisibleCart()
{
	obj = document.getElementById("divShoppingCartPop");
	//obj.style.visibility = (obj.style.visibility == 'visible') ? 'hidden' : 'visible';
	
	if (obj.style.visibility == "visible")
	    {
	    obj.style.visibility = "hidden";
	    showSelects();
	    }
	else
	    {
	    obj.style.visibility = "visible";
	    hideSelects();
	    }
}

function positionCart()
{
	obj = document.getElementById("divShoppingCartPop");
	if (document.documentElement)
	{
		theLeft = document.documentElement.scrollLeft;
		theTop = document.documentElement.scrollTop;
	}
	else if (document.body)
	{
		theLeft = document.body.scrollLeft;
		theTop = document.body.scrollTop;
	}
	theLeft += cartX;
	theTop += cartY;
	obj.style.left = theLeft + 'px' ;
	obj.style.top = theTop + 'px' ;
}

function hideSelects(){
    var x = document.getElementsByTagName("select");

    for (i = 0; i < x.length; i++) {
        //x[i].style.display = "none";
        x[i].style.visibility = "hidden"
    }
}

function showSelects(){
    var x = document.getElementsByTagName("select");

    for (i = 0; i < x.length; i++) {
        //x[i].style.display = "none";
        x[i].style.visibility = "visible"
    }
}

positionCart();

