var  anzhotel = 1;
var  google_ad_client = "pub-1071768995704142";
var  google_ad_slot = "5972445854";
var  google_ad_width = 468;
var  google_ad_height = 60;
var  menuids=["suckertree1"];
var  newslist=new Array();
var  cnt=0;
var  curr = "";
var  i=-1;
var pageTracker1 = "";
var pageTracker2 = "";

// if (screen.height<600) location.href="http://www.urlaub-anbieter.com/offroadthailand.htm";

function init4x4()
{
  setTimeout('newsticker()',1000);
  zeigeKarte();
}

function getHoeheObject(obj)
{
  var hoehe = 0;
  if (window.getComputedStyle) hoehe = window.getComputedStyle(document.getElementById(obj), "").getPropertyValue("height");
  if ((hoehe==0) && layout.currentStyle) hoehe = document.getElementById(obj).currentStyle.height;
  if (hoehe.indexOf("px")>0) hoehe = hoehe.substring(0,hoehe.indexOf("px"));
  return hoehe;
}


function zeigeKarte()
{
  var hoehe = getHoeheObject("page");
  if ((hoehe<1300) || (hoehe == "auto"))
  {
     document.getElementById("woher").style.visibility="hidden";
  }
}

/*
function setDivMittig()
{
   x =Math.floor(window.innerWidth / 2)-400;
   document.getElementById("headder").style.left=x;
   document.getElementById("pic").style.left=x;
   document.getElementById("con_back").style.left=x;
   document.getElementById("foot").style.left=x;
}

*/

function buildsubmenus()
{
  for (var i=0; i<menuids.length; i++)
  {
     var menueelement = document.getElementById(menuids[i]);
     if (menueelement != null)
     {
     var ultags=menueelement.getElementsByTagName("ul");
     for (var t=0; t<ultags.length; t++)
     {
       ultags[t].parentNode.getElementsByTagName("a")[0].className="subfolderstyle";
           if (ultags[t].parentNode.parentNode.id==menuids[i])
           {
                  ultags[t].style.left=ultags[t].parentNode.offsetWidth+"px";
           }
           else
           {
                  ultags[t].style.left=ultags[t-1].getElementsByTagName("a")[0].offsetWidth+"px";
             }
       ultags[t].parentNode.onmouseover=function(){this.getElementsByTagName("ul")[0].style.display="block";}
       ultags[t].parentNode.onmouseout=function() {this.getElementsByTagName("ul")[0].style.display="none";}
     }
         for (var t=ultags.length-1; t>-1; t--)
         {
                ultags[t].style.visibility="visible";
                ultags[t].style.display="none";
         }
     }    
  }
}

function newsticker()
{
        if (i < newslist[cnt][0].length - 1)
        {
           i++;
           temp1 = newslist[cnt][0];
           temp1 = temp1.split('');
           curr = curr+temp1[i];
           temp2 = newslist[cnt][1];
           if (temp2.length<3)
           {
             temp2="#start";
           }
           ticker.innerHTML = "<center><b><a href='"+temp2+"'><font color='red' target='_self'>"+curr+"</b></a></center>";
           setTimeout('newsticker()',10);
           return;
        }
        i = -1; curr = "";
        if (cnt<newslist.length-1) cnt++; else cnt=0;
        setTimeout('newsticker()',4000);
}


function getJetztMinuten()
{
  minuten = Math.round(new Date().getTime() / 1000);
  return minuten - 1236900000;
}


function ping()
{
   var dauer =  document.getElementById("dauer");
   if (dauer!=null)
   {
     dauer.innerHTML   = "P";
     document.ping.url.value= "";
     document.ping.jetzt.value= "ping";
     var myAjax = new Ajax.Request(document.ping.action,
                    { method: 'get',
                      parameters: Form.serialize(document.getElementById('ping')),
                      onComplete: pingping
                  })
   }               
}


function startping()
{
   var dauer =  document.getElementById("dauer");
   if (dauer!=null)
   {
     dauer.innerHTML   = "S";
     document.ping.url.value= document.URL;
     document.ping.jetzt.value= "start";
     var myAjax = new Ajax.Request(document.ping.action,
                    { method: 'get',
                      parameters: Form.serialize(document.getElementById('ping')),
                      onComplete: pingping
                  })
   }
}

function stopping()
{
   var dauer =  document.getElementById("dauer");
   if (dauer!=null)
   {

   dauer.innerHTML   = "E";
   document.ping.url.value= "";
   document.ping.jetzt.value= "stop";
   var myAjax = new Ajax.Request(document.ping.action,
                    { method: 'get',
                      parameters: Form.serialize(document.getElementById('ping')),
                      onComplete: pingping
                  })
   }
   top.location.href="http://www.thailand-rundreisen.net";
}




var pingcounter = 0;

function countping()
{
   pingcounter++;
   if (pingcounter == 1)
   {   
      ping();  
   }
   if (pingcounter>100)   
   {   
      pingcounter = 0;  
    }  
}


function pingping(originalRequest)
{
   var response = originalRequest.responseText;
   document.getElementById("dauer").innerHTML   = response;

}


function on(x)  { document.getElementById("hotel_"+x).style.visibility="visible";}
function out(x) { document.getElementById("hotel_"+x).style.visibility="hidden"; }
function nix()  {  }

//aktiv = window.setInterval("ping();",1000*30*1);  // alle 0,5 Minuten
//window.setTimeout("startping();",1000*4);  


if (window.addEventListener) window.addEventListener("load", buildsubmenus, false);
                        else if (window.attachEvent) window.attachEvent("onload", buildsubmenus);



