


var newwindow = '';
function GemsPopup(url)
{
        if (!newwindow.closed && newwindow.location)
        {
                newwindow.location.href = url;
        }
        else
        {
                newwindow=window.open(url,"_blank","location=0,statusbar=0,menubar=0,scrollbars=1,resizable=1,width=620,height=290");
                if (!newwindow.opener) newwindow.opener = self;
        }
        if (window.focus) {newwindow.focus()}
        return false;
}

function SetCookie(sName, sValue, oExpires, sPath, sDomain, bSecure) {
	var sCookie = sName + "=" + encodeURIComponent(sValue);

	if (oExpires) {
		sCookie += "; expires=" + oExpires.toGMTString();
	}

	if (sPath) {
		sCookie += "; path=" + sPath;
	}

	if (sDomain) {
		sCookie += "; domain=" + sDomain;
	}

	if (bSecure) {
		sCookie += "; secure";
	}

	document.cookie = sCookie;
}
				
function GetCookie(sName) {

	var sRE = "(?:; )?" + sName + "=([^;]*);?";
	var oRE = new RegExp(sRE);
	
	if (oRE.test(document.cookie)) {
		return decodeURIComponent(RegExp["$1"]);
	} else {
		return null;
	}

}                

function DeleteCookie(sName, sPath, sDomain) {
	var sCookie = sName + "=; expires=" + (new Date(0)).toGMTString();
	if (sPath) {
		sCookie += "; path=" + sPath;
	}

	if (sDomain) {
		sCookie += "; domain=" + sDomain;
	}
	
	document.cookie = sCookie;
}

