function init() {
    try{
     //    document.getElementById("plusfm").innerHTML='<iframe align="top" width="160" height="280" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no" src="?app=widget:plusfm"/>';
         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("botBan").innerHTML='<iframe align="top" width="468" height="60" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no" src="incl/botb.html"/>';
         document.getElementById("weather").innerHTML='<iframe align="top" width="160" height="215" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no" src="?app=widget:weather"/>';
         document.getElementById("trafficfeed").innerHTML='<iframe align="top" width="160" height="600" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no" src="?app=widget:trafficfeed"/>';
      //   document.getElementById("facebooklike").innerHTML='<iframe src="http://www.facebook.com/plugins/like.php?href=www.wkiosk.com&amp;layout=button_count&amp;show_faces=true&amp;width=157&amp;action=recommend&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:158px; height:21px;" allowTransparency="true"/>';
   } catch(err){}

 /* document.getElementById("plusfm").innerHTML='<iframe align="top" width="100%" height="235" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no" src="?app=widget:plusfm"/>';
*/
    /*
 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');

  /*==tooltip==*/
     offsetxpoint=-75 //Customize x offset of tooltip  -75
     offsetypoint=5   //Customize y offset of tooltip   5

     ie=document.all
     ns6=document.getElementById && !document.all
     enabletip=false
    if (ie||ns6)
     tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : ""

     document.onmousemove=positiontip

}

 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) {
  document.goForm.action = '?';
  if(indoid){document.goForm.app.value = indoid;}
  if(paramName1) {document.goForm.field1.value = paramName1;document.goForm.value1.value = escape(paramValue1);}
  if(paramName2) {document.goForm.field2.value = paramName2;document.goForm.value2.value = escape(paramValue2);}
  if(paramName3) {document.goForm.field3.value = paramName3;document.goForm.value3.value = escape(paramValue3);}
  if(paramName4) {document.goForm.field4.value = paramName4;document.goForm.value4.value = escape(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){
     if(window.external){ window.external.AddFavorite(window.location.href, document.title); return false; } // IE
   }


 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;}
    gostr="http://translate.google.com/translate?sl="+instr.split("|")[0].split("$")[1]+"&tl="+instr.split("|")[1]+"&u=http%3A%2F%2Fwww.wkiosk.com%2F%3Fcountry%3D"+instr.split("|")[0].split("$")[0]+"%26language%3D"+instr.split("|")[0].split("$")[1];
    ww=window.open(gostr);
    ww.focus();
}

function cClick(obj){
 if ( typeof obj == "string") {
   para ='url';
   val = obj
  }else{
   para ='rurl';
   val = obj.href;
 }
 var xmlhttp;
  if (window.XMLHttpRequest) {
 xmlhttp=new XMLHttpRequest();
 } else if (window.ActiveXObject) {
 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
 } else return;
 xmlhttp.open('GET','?app=ureg&'+para+'='+encodeURIComponent(val),true);
 xmlhttp.send(null);
}

/*=======================tooltip============================= */

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function ddrivetip(thetext,xurl){
if (ns6||ie){
    // tipobj.style.width="489px"
	 tipobj.style.background = 'yellow url(incl/pic/loader.gif) no-repeat center center';
     tipobj.innerHTML=thetext
	 tipobj.style.border = '1px solid black';
     enabletip=true
  return false
 }
}

function positiontip(e){
if (enabletip){
var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
//Find out how close the mouse is to the corner of the window
var rightedge=ie&&!window.opera? ietruebody().clientWidth-event.clientX-offsetxpoint : window.innerWidth-e.clientX-offsetxpoint-20
var bottomedge=ie&&!window.opera? ietruebody().clientHeight-event.clientY-offsetypoint : window.innerHeight-e.clientY-offsetypoint-20
var leftedge=(offsetxpoint<0)? offsetxpoint*(-1) : -1000   //-1000
//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<tipobj.offsetWidth)
//move the horizontal position of the menu to the left by it's width
tipobj.style.left=ie? ietruebody().scrollLeft+event.clientX-tipobj.offsetWidth+"px" : window.pageXOffset+e.clientX-tipobj.offsetWidth+"px"
else if (curX<leftedge)
tipobj.style.left="5px"
else
//position the horizontal position of the menu where the mouse is positioned
tipobj.style.left=curX+offsetxpoint+"px"

//same concept with the vertical position
if (bottomedge<(tipobj.offsetHeight-300)) //100
tipobj.style.top=ie? ietruebody().scrollTop+event.clientY-tipobj.offsetHeight-offsetypoint+"px" : window.pageYOffset+e.clientY-tipobj.offsetHeight-offsetypoint+"px"
else
tipobj.style.top=curY+offsetypoint+"px"
tipobj.style.visibility="visible"
}
}

function hideddrivetip(){
if (ns6||ie){
enabletip=false
tipobj.style.visibility="hidden"
tipobj.style.left="-1000px"  //-1000
tipobj.style.backgroundColor=''
tipobj.style.width=''
}
}

function setsearch(sname,surl){
  show('ssite');
  document.wget.qe.value='';
  document.wget.qe.style.background="yellow";
  document.wget.qe.focus();
  document.getElementById('ssite').innerHTML='<input type="radio" class="radio" name="stype" value="s"/>'+ sname;
  document.wget.wksite.value=surl;
  document.wget.wksitename.value=sname;
  document.wget.stype[0].checked=true;
  return false;
}

function wtest(){
  document.wget.q.value="site:"+document.wget.wksite.value+" "+document.wget.qe.value;
  return true;
}

function writit(text,id){
	if (document.getElementById)
	{
		x = document.getElementById(id);
		x.innerHTML = '';
		x.innerHTML = text;
	}
	else if (document.all)
	{
		x = document.all[id];
		x.innerHTML = text;
	}
	else if (document.layers)
	{
		x = document.layers[id];
		x.document.open();
		x.document.write(text);
		x.document.close();
	}

}

