var WinTop, WinLeft, WinWidth, WinHeight;

function InitCookies () {
DelCookie("welcome");
DelCookie("session");
DelCookie("region");
DelCookie("language");
DelCookie("country");
DelCookie("startup");
DelCookie("wintop");
DelCookie("winleft");
DelCookie("winwidth");
DelCookie("winheight");
DelCookie("cover");
DelCookie("newspage");
DelCookie("menu");
}

function AddCookie (name,value) {  
SetCookie('welcome',1);
SetCookie(name,value);
}

function SetWindow (wType) {  
AddCookie('startup', wType);
if (wType != "4") {
   InitSession(); 
   return; }
WinTop = 0;
WinLeft = 0;
WinWidth = 0;
WinHeight = 0;
GetWinDim();
if (WinTop < 0 || WinLeft < 0) {
alert("This mode is not supported on your browser");
return;}
var OrgTop = WinTop;
var OrgLeft = WinLeft;
var OrgWidth = WinWidth;
var OrgHeight = WinHeight;
var ChkWidth = OrgWidth;
var ChkHeight = OrgHeight;
if (OrgWidth > 930) ChkWidth = ChkWidth + 24
if (OrgHeight > 544) ChkHeight = ChkHeight + 148
window.moveTo(0, 0);
window.resizeTo(ChkWidth, ChkHeight);
GetWinDim(); 
WinTop = OrgTop - WinTop;
WinLeft = OrgLeft - WinLeft;
WinWidth = OrgWidth + ChkWidth - WinWidth;
WinHeight = OrgHeight + ChkHeight - WinHeight;
AddCookie('wintop', WinTop);
AddCookie('winleft', WinLeft);
AddCookie('winwidth', WinWidth);
AddCookie('winheight', WinHeight); 
window.moveTo(WinLeft, WinTop);
window.resizeTo(WinWidth, WinHeight); 
}

function ShowLanguage () {  
var vReturn = "";
var vCookie = GetCookie('language');
if (vCookie == null || vCookie == "") vReturn = "all languages";
if (vCookie == "0") vReturn = "english only";
if (vCookie == "1") vReturn = "northern group";
if (vCookie == "2") vReturn = "southern group";
document.write(vReturn);
}

function ShowCountry (cParm) {  
var vReturn = "none selected";
var vCookie = GetCookie('country');
if (cParm != null) vCookie = cParm;
if (vCookie == null) vReturn = "none selected";
if (vCookie == "500au") vReturn = "Australie";
if (vCookie == "041at") vReturn = "Austria";
if (vCookie == "051be") vReturn = "Belgique";
if (vCookie == "031be") vReturn = "Belgium";
if (vCookie == "130br") vReturn = "Brazil";
if (vCookie == "110ca") vReturn = "Canada";
if (vCookie == "111ca") vReturn = "Canada (f)";
if (vCookie == "011dk") vReturn = "Denmark";
if (vCookie == "000eu") vReturn = "Europe";
if (vCookie == "011fi") vReturn = "Finland";
if (vCookie == "050fr") vReturn = "France";
if (vCookie == "040de") vReturn = "Germany";
if (vCookie == "071gr") vReturn = "Greece";
if (vCookie == "021ie") vReturn = "Ireland";
if (vCookie == "070it") vReturn = "Italy";
if (vCookie == "120mx") vReturn = "Mexico";
if (vCookie == "030nl") vReturn = "Netherlands";
if (vCookie == "011no") vReturn = "Norway";
if (vCookie == "061pt") vReturn = "Portugal";
if (vCookie == "060es") vReturn = "Spain";
if (vCookie == "051ch") vReturn = "Suisse";
if (vCookie == "010se") vReturn = "Sweden";
if (vCookie == "041ch") vReturn = "Switzerland";
if (vCookie == "020uk") vReturn = "United Kingdom";
if (vCookie == "100us") vReturn = "United States";
if (cParm == null) document.write(vReturn);
if (cParm != null) return vReturn;
}

function ShowStartup () {  
var vReturn = "";
var vCookie = GetCookie('startup');
if (vCookie == null) vReturn = "leave as is";
if (vCookie == "0") vReturn = "leave as is";
if (vCookie == "1") vReturn = "best fit";
if (vCookie == "2") vReturn = "maximized";
if (vCookie == "3") vReturn = "fullscreen";
if (vCookie == "4") vReturn = "current window";
document.write(vReturn);
}

function ShowCover () {  
var vReturn = "Not selected";
var vCookie = GetCookie('cover');
if (vCookie == null) vReturn = "system default";
if (vCookie == "00") vReturn = "no cover";
if (vCookie == "10") vReturn = "traditional";
if (vCookie == "31") vReturn = "mondriaan";
if (vCookie == "50") vReturn = "unobtrusive";
if (vCookie == "61") vReturn = "silver grey";
if (vCookie == "71") vReturn = "chic beige";
if (vCookie == "82") vReturn = "soft peach";
document.write(vReturn);
}

function ShowNewsPage () {  
var vReturn = "";
var vCookie = GetCookie('newspage');
if (vCookie == null) vReturn = "system default";
if (vCookie == "0") vReturn = "always light";
if (vCookie == "1") vReturn = "as main page";
document.write(vReturn);
}

function GetWinDim() {
if (window.innerWidth) {
   WinTop = window.screenY;
   WinLeft = window.screenX;
   if (window.opera) {
   WinTop = window.screenTop;
   WinLeft = window.screenLeft; }
   WinWidth = window.innerWidth; 
   WinHeight = window.innerHeight; }
else if (document.documentElement && document.documentElement.clientWidth && document.documentElement.clientWidth != 0) {
   WinTop = window.screenTop;
   WinLeft = window.screenLeft;
   WinWidth = document.documentElement.clientWidth;
   WinHeight = document.documentElement.clientHeight; }
else if (document.body) {
   WinTop = window.screenTop;
   WinLeft = window.screenLeft;
   WinWidth = document.body.clientWidth;
   WinHeight = document.body.clientHeight; } 
} 
