function init() {

  document.getElementById("topBan").innerHTML='<iframe align="top" width="728" height="90" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no" src="incl/topb.html"/>';
  document.getElementById("rightb").innerHTML='<iframe align="top" width="120" height="600" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no" src="incl/rightb.html"/>';
  document.getElementById("botBan").innerHTML='<iframe align="top" width="468" height="60" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no" src="http://www.goldbannerx.org/display.php?id=532"><ilayer align="top" width="468" height="60" src="http://www.goldbannerx.org/display.php?id=532"/></iframe>';
  document.getElementById("weather").innerHTML='<iframe align="top" width="100%" height="224" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no" src="?app=weather"/>';
 if(document.goForm.xcountry.value == 'EE'){
    document.getElementById("xmltv").innerHTML='<iframe align="top" width="100%" height="100%"  marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no" src="?app=xmltv&country=EE"/>';
    document.getElementById('xmltv').style.height = document.body.scrollHeight;
 }
  init_table_list('rsstable');
}

 function hide(object) {
    if (document.getElementById && document.getElementById(object) != null)
         node = document.getElementById(object).style.visibility='hidden';
    else if (document.layers && document.layers[object] != null)
        document.layers[object].visibility = 'hidden';
    else if (document.all)
         document.all[object].style.visibility = 'hidden';
}
function show(object) {
    if (document.getElementById && document.getElementById(object) != null)
         node = document.getElementById(object).style.visibility='visible';
    else if (document.layers && document.layers[object] != null)
        document.layers[object].visibility = 'visible';
    else if (document.all)
        document.all[object].style.visibility = 'visible';
}

function showrss(object) {
    document.getElementById('p'+object).innerHTML = "<table width='450px' height='1%' ><tr><td class='rssRowPre'>"+document.getElementById(object).innerHTML+"</td></tr></table>"
    if (document.getElementById && document.getElementById(object) != null)
         node = document.getElementById("p"+object).style.visibility='visible';
    else if (document.layers && document.layers[object] != null)
        document.layers["p"+object].visibility = 'visible';
    else if (document.all)
        document.all["p"+object].style.visibility = 'visible';
}


function setdate(dd,mm,yy) {
document.datech.day.value=dd;
document.datech.month.value=mm;
document.datech.year.value=yy;
document.datech.submit();
}

function gogo(indoid, paramName1, paramValue1, paramName2, paramValue2,paramName3, paramValue3,paramName4, paramValue4) {
  if(indoid){document.goForm.app.value = indoid;}
  // alert(document.goForm.app.value);
  if(paramName1) {document.goForm.field1.value = paramName1;document.goForm.value1.value = paramValue1;}
  if(paramName2) {document.goForm.field2.value = paramName2;document.goForm.value2.value = paramValue2;}
  if(paramName3) {document.goForm.field3.value = paramName3;document.goForm.value3.value = paramValue3;}
  if(paramName4) {document.goForm.field4.value = paramName4;document.goForm.value4.value = paramValue4;}
  document.goForm.submit();}

function hidee(object) {document.all[object].style.visibility = 'hidden';}
function showw(object) {document.all[object].style.visibility = 'visible';}

function ismaxlength(obj){
var mlength=obj.getAttribute? parseInt(obj.getAttribute("maxlength")) : ""
if (obj.getAttribute && obj.value.length>mlength)
obj.value=obj.value.substring(0,mlength)
}


function redir(inst,inst2){
formn=document.taskform;

for(d=formn.subarea.options.length-1;d>0;d--){formn.subarea.options[d]=null;}
formn.area.options[0]=new Option("choose","")
// formn.subarea.options[0]=new Option("choose","")
u=1;v=0;
 for(i=0;i<gr.length-1;i++){
	if((((i/2)+"").indexOf("."))==-1){
 		   ins = gr[i].split("@");
               formn.area.options[u]=new Option(ins[1],ins[0]);
                 if(inst==ins[0]){
                  formn.area.options[u].selected=true;
                     for(j=0;j<gr[i+1].length-1;j++){
                        ins2 = gr[i+1][j].split("@");
                        formn.subarea.options[v]=new Option(ins2[1],ins2[0]);
                        if(inst2==ins2[0]){formn.subarea.options[v].selected=true;}
                        v+=1;
                   }
            }
         u+=1;
      }
 }
}

function  addhomepage(inthis){
  inthis.style.behavior='url(#default#homepage)';inthis.setHomePage('http://www.wkiosk.com');
 }

 function  addfavorites(inthis){
   window.external.AddFavorite(location.href, document.title);
 }


 function  localset(la,co){
   co=co.toUpperCase();
   SetCookie('wkiosk',la+"-"+co,360);
  gogo(document.goForm.app.value,'language',la,'country',co);
 }


function SetCookie(cookieName,cookieValue,nDays) {
 var today = new Date();
  var expire = new Date();
   if (nDays==null || nDays==0) nDays=1;
    expire.setTime(today.getTime() + 3600000*24*nDays);
     document.cookie = cookieName+"="+escape(cookieValue)
                      + ";expires="+expire.toGMTString()+";path=/";
}


var http = false;

if(navigator.appName == "Microsoft Internet Explorer") {
  http = new ActiveXObject("Microsoft.XMLHTTP");
} else {
  http = new XMLHttpRequest();
}


function addrsscontent(innurl) {
  http.open("GET", "?app=rssfeeds&urlid="+innurl+"&r="+Math.random(), true);
  http.onreadystatechange=function() {
    if(http.readyState == 4) {
      document.getElementById('light').innerHTML = http.responseText;
    }
  }
  http.send(null);
}




function rssWindow(inrssurl) {
 document.getElementById('light').style.display='block';
 document.getElementById('fade').style.display='block';
 addrsscontent(inrssurl)
 window.scroll(0,0);
}

function closeRssW() {
 document.getElementById('light').style.display='none';
 document.getElementById('fade').style.display='none'
}


function init_table_list(tableid) {
   if(document.getElementById(tableid)!==null){
    try {
        var r=document.getElementById(tableid).getElementsByTagName('tr');
    } catch(e) { return;}
    var l=r.length;
    for (i=0;i<l;i++){
        var x= 'r'+r[i].id;
        r[i].onmouseover =  function(){this.style.backgroundColor="#fff";};
     if (i%2 == 0){
      r[i].onmouseout = function(){this.style.backgroundColor="";}
     }
     else {
      r[i].style.backgroundColor='#ccc';
      r[i].onmouseout = function(){this.style.backgroundColor="#ccc";}
     }
    }
   }
}

function openLinkk(inurl) {
 window.open(inurl);
}

function translate(instr) {
    if(instr == ''){return;}
    var x = instr.split("$");
   /*var google_url ="http://www.google.com/translate?langpair=en|en&u=www.forbiddensite.com "*/
   /* http://translate.google.com/translate?prev=_t&hl=en&ie=UTF-8&u=http%3A%2F%2Fwww.wkiosk.com%2Fkiosk%2Fkiosk%3Fcountry%3DFI%26language%3Dfi&sl=fi&tl=et&history_state0=*/
  /*  var gostr ="http://www.google.com/translate?langpair="+x[1]+"&u="+escape("www.wkiosk.com/kiosk/kiosk?language="+x[1].split("|")[0]+"&amp;country="+x[0]+""); */
     gostr="http://translate.google.com/translate?prev=_t&hl=en&ie=UTF-8&u=http%3A%2F%2Fwww.wkiosk.com%2Fkiosk%3Fcountry%3D"+x[0]+"%26language%3D"+x[1].split("|")[0]+"&sl="+x[1].split("|")[0]+"&tl="+x[1].split("|")[1]+"";
//     alert(gostr);
    ww=window.open(gostr);
    ww.focus();
}

/*==================================================== */