function OpenWindow999(url,name,features) { window.open(url,name,features); } var popUpWin=0; function popUpWindow(URLStr, left, top, width, height) { if(popUpWin) { if(!popUpWin.closed) popUpWin.close(); } popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=1,resizable=1,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+''); } function setCookie(NameOfCookie, value, expiredays) { //I use this javascript to set cookies because I hate php and his cookies // Three variables are used to set the new cookie. // The name of the cookie, the value to be stored, // and finally the number of days until the cookie expires. // The first lines in the function convert // the number of days to a valid date. var ExpireDate = new Date (); ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000)); // The next line stores the cookie, simply by assigning // the values to the "document.cookie" object. // Note the date is converted to Greenwich Mean time using // the "toGMTstring()" function. if ((NameOfCookie == "Id_Marche")) { var ExpireDateDelete = new Date (2005, 3, 25, 4, 0, 0, 0); document.cookie = NameOfCookie + "=" + escape(value) + "; expires=" + ExpireDateDelete.toGMTString() + "; path=/; domain=www.libertytv.com"; } document.cookie = NameOfCookie + "=" + escape(value) + "; expires=" + ExpireDate.toGMTString() + "; path=/; domain=libertytv.com"; } function delCookie(NameOfCookie) { // The function simply checks to see if the cookie is set. // If so, the expiration date is set to Jan. 1st 1970. if (getCookie(NameOfCookie)) { document.cookie = NameOfCookie + "=" + "; expires=Thu, 01-Jan-70 00:00:01 GMT"; } } function getCookie(NameOfCookie) { // First we check to see if there is a cookie stored. // Otherwise the length of document.cookie would be zero. if (document.cookie.length > 0) { // Second we check to see if the cookie's name is stored in the // "document.cookie" object for the page. // Since more than one cookie can be set on a // single page it is possible that our cookie // is not present, even though the "document.cookie" object // is not just an empty text. // If our cookie name is not present the value -1 is stored // in the variable called "begin". begin = document.cookie.indexOf(NameOfCookie+"="); if (begin != -1) // Note: != means "is not equal to" { // Our cookie was set. // The value stored in the cookie is returned from the function. begin += NameOfCookie.length+1; end = document.cookie.indexOf(";", begin); if (end == -1) end = document.cookie.length; return unescape(document.cookie.substring(begin, end)); } } return null; // Our cookie was not set. // The value "null" is returned from the function. } function setLanguage(idMarket) { delCookie('Id_Marche'); setCookie('Id_Marche',idMarket,180); document.location.replace("http://www.libertytv.com/index.php?id_market=" + idMarket); }