  // Determine page
 var parms = new Array();
 var values = new Array();

 parmlist = document.location.toString();
 parmpart = parmlist.split("?")[1];
 pag = -1;
 if (parmpart)
  {
  parts = parmpart.split("&");
  for (nCnt=0; nCnt<parts.length; nCnt++)
   {
    parms[nCnt] = parts[nCnt].split("=")[0];
    values[nCnt] = parts[nCnt].split("=")[1];
    if (parms[nCnt] == 'pag') pag = values[nCnt];
   }
  }
 if (pag == 999) deleteCookie('language',null,null);

 function Is() {
    var agent   = navigator.userAgent.toLowerCase();
    this.major  = parseInt(navigator.appVersion);
    this.minor  = parseFloat(navigator.appVersion);
    this.ns     = ((agent.indexOf('mozilla')   != -1) &&
                  (agent.indexOf('spoofer')    == -1) &&
                  (agent.indexOf('compatible') == -1) &&
                  (agent.indexOf('opera')      == -1) &&
                  (agent.indexOf('webtv')      == -1));
    this.ns2    = (this.ns && (this.major      ==  2));
    this.ns3    = (this.ns && (this.major      ==  3));
    this.ns4    = (this.ns && (this.major      ==  4));
    this.ns6    = (this.ns && (this.major      >=  5));
    this.ie     = (agent.indexOf("msie")       != -1);
    this.ie3    = (this.ie && (this.major      <   4));
    this.ie4    = (this.ie && (this.major      ==  4) &&
                  (agent.indexOf("msie 5.0")   == -1));
    this.ie5    = (this.ie && (this.major      ==  4) &&
                  (agent.indexOf("msie 5.0")   != -1));
    this.ieX    = (this.ie && !this.ie3 && !this.ie4);	
}


var is = new Is();
 
 function setLanguage(lang)
 {
  var now = new Date();
  now.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000);
  setCookie('language',lang,now,null,null,false);
 }  
 
 function getLanguage()
 {
  return getCookie('language');
 }
 
 function setPage(page)
 {
  var now = new Date();
  now.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000);
  setCookie('page',page,now,null,null,false);
 }  

 function getPage()
 {
  return getCookie('page');
 }

  function setSubPage(page)
 {
  var now = new Date();
  now.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000);
  setCookie('subpage',page,now,null,null,false);
 }  

 function getSubPage()
 {
  return getCookie('subpage');
 }

 function resize()
 {
  window.resizeTo(1155,885); 
 }
