function openWindow(url)
{
popupWin = window.open(url, "openWin", "width=400, height=250, scrollbars=yes"); 
}
function highlights(obj) {
	obj.parentNode.style.backgroundColor = "#697aae";
	obj.parentNode.style.backgroundImage="url(/lib/cellphoneshop/cps-topnav-lightblue.jpg)";
}
function offlights(obj) {
	obj.parentNode.style.backgroundImage="url(/lib/cellphoneshop/cps-topnav-blue.jpg)";
}

function addEvent(elm, evType, fn, useCapture)
{
	if (elm.addEventListener)
	{
		elm.addEventListener(evType,fn,useCapture);
		return (true);
	}
	else if ( elm.attachEvent )
	{
		var r = elm.attachEvent('on' + evType, fn);
		return (r);
	}
	else
	{
		elm['on' + evType] = fn;
	}
}

function imgPreload()
{
	var x = new Image();
	x.src = "/lib/cellphoneshop/cps-topnav-lightblue.jpg";
}

addEvent(window, 'load', imgPreload);

$(document).ready(function () {
    $("#xchange").change(function () {
        var pr = xchangeRates[$(this).get()[0].selectedIndex - 1];
        if (typeof (pr) == 'undefined') {
            $("#foreignCurr").html("");
        }
        else {
            $("#foreignCurr").html("(" + pr + ")");
        }
        SetCookie("cur", $("#xchange").val());
    });
    if ($.query.get("cur") != "") {
        SetCookie("cur", $.query.get("cur"));
    }
    if (GetCookie("cur") != null && GetCookie("cur") != "null" && GetCookie("cur") != "") {
        if (GetCookie("cur") != "Change Currency") {
            $("#xchange").val(GetCookie("cur")).change();
        }
    }
});
