/*
lib.js for ARBOE

Author:			  manfred.schneiderbauer@world-direct.at
Version:      1.322 (last: 1.321)
Last Changed:	2008-12-11 (last: 2009-02-02)

CAUTION: ON THE OTHER SYSTEM MIGHT BE A CHANGED VERSION OF THIS FILE! mps

*/

// set document.domain
var lh=location.host; var lS=lh.substring(lh.lastIndexOf('.'),lh.length); var lP=lh.replace(lS,'');lP=lP.substring(lP.lastIndexOf('.')+1,lP.length); lh=lP+lS; document.domain=lh;

// delay between slides in milliseconds

var slideDelay=5000;

// init automatic slideshow
function titleSlideshow(){

if(document.readyState=='complete'||window.readyForSlideshow||!isIE5up||isIE7up)
  {
  if(window.readyForSlideshow) // flag for short delay after reached readystate to let IE do the heavy CSS rendering before
    {
    window.currentSlide=0;
    window.showRuns=true;
    d('dvTitleAnimation').getElementsByTagName('img')[0].style.visibility='visible';
    titleSlideshow_Init(); // initial fade-in and handler setting
    }else{
    // set delay to let IE render the heavy CSS dependant from the CPU speed
    var delay=200;
    if(window.CPUSpeed<500){delay=750;}
    if(window.CPUSpeed>499&&window.CPUSpeed<1000){delay=500;}
    if(window.CPUSpeed>999&&window.CPUSpeed<2000){delay=250;}
    window.readyForSlideshow=true;
    window.setTimeout("titleSlideshow();",delay); // restart one more time to let IE do the (...blah...)
    }
  }else{
  window.setTimeout("titleSlideshow();",250);
  }
}

// initial fade-in
function titleSlideshow_Init(count){
if(!count) // initital init
  {
  count=0;
  getElementsByClass('img','cest_button_img')[0].src='/fileadmin/arboe/dev/img/bg_teaserbox_1.gif';
  getElementsByClass('a','cest_button_title')[0].style.color='white';
  getElementsByClass('a','cest_button_subtitle')[0].style.color='white';

  if(isIE55up)
    {
       getElementsByClass('a','cest_button_title')[0].style.top='0px';
       getElementsByClass('a','cest_button_title')[1].style.top='0px';
       getElementsByClass('a','cest_button_title')[2].style.top='0px';
       getElementsByClass('a','cest_button_subtitle')[0].style.whiteSpace='normal';
       getElementsByClass('a','cest_button_subtitle')[1].style.whiteSpace='normal';
       getElementsByClass('a','cest_button_subtitle')[2].style.whiteSpace='normal';
    }

  var thisButt=''; var thisButtCount=0; var tl=''; var ii=0;
  for(var i=0;i<3;i++)
    {
     thisButt=getElementsByClass('div','cest_button')[i];
     thisButt.style.className='cest_button clib_link';

     thisButt.setAttribute('buttcount',i);
     //thisButt.onclick=function(){location.href=this.getElementsByTagName('a')[0].href;}
     //thisButt.onclick=function(){window.open(this.getElementsByTagName('a')[0].href);}
     tl=thisButt.getElementsByTagName('a');
     for(ii=0;ii<tl.length;ii++)
      {
       tl[ii].target='_blank';
      }
     thisButt.onmouseover=function()
      {
      titleSlideshow_toggle(this.getAttribute('buttcount'),true);
      this.onmouseover=null;
      }
     thisButt.onmouseout=function()
      {
      titleSlideshow_toggle(this.getAttribute('buttcount'),false);
      this.onmouseover=function()
        {
        titleSlideshow_toggle(this.getAttribute('buttcount'),true);
        this.onmouseover=null;
        }
      }
    }
  }
if(isIE5up)
  {
   d('dvTitleAnimation').style.filter='progid:DXImageTransform.Microsoft.Alpha(opacity='+count+')';
  } else {
   d('dvTitleAnimation').style.opacity=count/100;
   d('dvTitleAnimation').style.MozOpacity=count/100;
   d('dvTitleAnimation').style.KhtmlOpacity=count/100;
  }

count=count+5;

if(count==100)
  {
    d('dvTitleAnimation').style.filter='';
    d('dvTitleLogo').style.display='block';
    titleSlideshow_Proceed();
  }else{
    window.setTimeout("titleSlideshow_Init("+count+");",15);
  }
}

// transit to current slide
function titleSlideshow_Show(){
var imgContainer=d('dvTitleAnimation');

window.oldSlide=''; window.newSlide='';

if(window.currentSlide==0) // set image objects (later add menu butts)
  {
    window.oldSlide=imgContainer.getElementsByTagName('img')[2]; window.newSlide=imgContainer.getElementsByTagName('img')[0];
  } else if (window.currentSlide==1) {
    window.oldSlide=imgContainer.getElementsByTagName('img')[0]; window.newSlide=imgContainer.getElementsByTagName('img')[1];
  } else if (window.currentSlide==2) {
    window.oldSlide=imgContainer.getElementsByTagName('img')[1]; window.newSlide=imgContainer.getElementsByTagName('img')[2];
  }

titleSlideshow_transit();
}

// automatically increase slide counter
function titleSlideshow_Proceed(){
if(showRuns) // if we're not stopped by onmouseovering...
  {
  titleSlideshow_Show(); // transit slide
  window.currentSlide++; // inc slide
  if(window.currentSlide==3){window.currentSlide=0;} // reset slide
  }

window.setTimeout("titleSlideshow_Proceed();",slideDelay); // continue triggering
}

// transit effect control; elements in window.oldslide and window.newslide
function titleSlideshow_transit(count){

// transit
window.setTimeout("titleSlideshow_transitElement('','picfade','');",slideDelay); // pic
//window.setTimeout("titleSlideshow_transitElement('','pic','');",500); // pic
if(window.showRuns && 1==2) // only if not mouse-triggered
  {
  //window.setTimeout("titleSlideshow_transitElement('logo_plate','plate','in');",500); // plate
  window.setTimeout("titleSlideshow_transitElement('logo_a','letter','in');",0); // a
  window.setTimeout("titleSlideshow_transitElement('logo_r','letter','in');",200); // r
  window.setTimeout("titleSlideshow_transitElement('logo_b','letter','in');",400); // b
  window.setTimeout("titleSlideshow_transitElement('logo_o','letter','in');",600); // o

  // trans-out
  //window.setTimeout("titleSlideshow_transitElement('logo_plate','plate','out');",1200); // plate
  window.setTimeout("titleSlideshow_transitElement('logo_a','letter','out');",1400); // a
  window.setTimeout("titleSlideshow_transitElement('logo_r','letter','out');",1500); // r
  window.setTimeout("titleSlideshow_transitElement('logo_b','letter','out');",1600); // b
  window.setTimeout("titleSlideshow_transitElement('logo_o','letter','out');",1700); // o
  }
}

// transit effect execution
// element = className for object if elementmode!=pic or index number if elementmode==pic
// elementmode = plate || letter || pic
// mode = in || out
function titleSlideshow_transitElement(element,elementmode,mode,count){
var thisEl='';

if(elementmode=='plate') // plate effects
  {
   thisEl=getElementsByClass('img',element)[0];
   if(mode=='in') // plate trans-in'
    {
     if(count==undefined){count=0;}
     count=count+5;
     if(isIE5up)
      {
       thisEl.style.filter='progid:DXImageTransform.Microsoft.Alpha(opacity='+count+')';
      } else {
       thisEl.style.opacity=count/100;
       thisEl.style.MozOpacity=count/100;
       thisEl.style.KhtmlOpacity=count/100;
      }
     if(count<50)
      {
        window.setTimeout("titleSlideshow_transitElement('"+element+"','"+elementmode+"','"+mode+"',"+count+");",50);
      }
    }
   if(mode=='out') // plate trans-in'
    {
     if(count==undefined){count=50;}
     count=count-20;
     if(isIE5up)
      {
       thisEl.style.filter='progid:DXImageTransform.Microsoft.Alpha(opacity='+count+')';
      } else {
       thisEl.style.opacity=count/100;
       thisEl.style.MozOpacity=count/100;
       thisEl.style.KhtmlOpacity=count/100;
      }
     if(count>-1)
      {
        window.setTimeout("titleSlideshow_transitElement('"+element+"','"+elementmode+"','"+mode+"',"+count+");",50);
      }
    }

  }

if(elementmode=='letter') // letter effects
  {
   thisEl=getElementsByClass('img',element)[0]; var zoom=0; var classBuffer='';

   if(mode=='in') // letter trans-in
    { // init
     if(count==undefined){count=0;}
     count=count+5;
     if(isIE5up)
      {
       thisEl.style.filter='progid:DXImageTransform.Microsoft.Alpha(opacity='+count+')';
      } else {
       thisEl.style.opacity=count/100;
       thisEl.style.MozOpacity=count/100;
       thisEl.style.KhtmlOpacity=count/100;
      }
     if(count<101)
      {
        window.setTimeout("titleSlideshow_transitElement('"+element+"','"+elementmode+"','"+mode+"',"+count+");",15);
      }
    }

   if(mode=='out') // letter trans-out
    {
     if(count==undefined){count=100;} // init
     count=count-20;
     if(isIE5up)
      {
       thisEl.style.filter='progid:DXImageTransform.Microsoft.Alpha(opacity='+count+')';
      } else {
       thisEl.style.opacity=count/100;
       thisEl.style.MozOpacity=count/100;
       thisEl.style.KhtmlOpacity=count/100;
      }

      zoom=zoom+2;
      thisEl.style.width=thisEl.offsetWidth+zoom+'px';
      thisEl.style.height=thisEl.offsetHeight+zoom+'px';
      thisEl.style.left=thisEl.offsetLeft-zoom/2+'px';
      thisEl.style.top=thisEl.offsetTop-zoom/2+'px';

      if(count>-1)
      {
        window.setTimeout("titleSlideshow_transitElement('"+element+"','"+elementmode+"','"+mode+"',"+count+");",100);
      }else{ // reset sizes and positions
       thisEl.style.width=''; thisEl.style.height=''; thisEl.style.top=''; thisEl.style.left='';
      }
    }

  }

  if(elementmode=='pic')
    {
      if(count==undefined) // init
        {
         count=0;
         window.newSlide.style.zIndex=2; window.newSlide.style.visibility='visible';
         window.oldSlide.style.zIndex=2;
        // reset buttons and set current button
        for(i=0;i<3;i++)
          {
          getElementsByClass('img','cest_button_img')[i].src='/fileadmin/arboe/dev/img/bg_teaserbox_0.gif';
          }
        getElementsByClass('img','cest_button_img')[window.currentSlide].src='/fileadmin/arboe/dev/img/bg_teaserbox_1.gif';
        }
      // slap effect
      window.oldSlide.style.height=170-count+'px'; window.oldSlide.style.width='233px';
      window.oldSlide.style.top=count+'px';
      window.oldSlide.style.width='233px';
      window.newSlide.style.height=count+'px'; window.newSlide.style.width='233px';
      count=count+10;
      if(count<171)
        {
        window.setTimeout("titleSlideshow_transitElement('','"+elementmode+"','',"+count+");",50);
        }else{
        // reset images
        window.newSlide.style.height='170px';
        window.oldSlide.style.visibility='hidden'; window.oldSlide.style.height='0px'; window.oldSlide.style.top='0px'; window.oldSlide.style.width='233px';window.oldSlide.style.zIndex=1;
        }
    }

    if(elementmode=='picfade'&&window.showRuns)
      {
       var oldS=0; var newS=1;
       if(window.currentSlide==0){oldS=2;newS=0;}
       if(window.currentSlide==2){oldS=1;newS=2;}
       titleSlideshow_fadeIn(oldS,newS);

       // reset buttons and set current button
       for(i=0;i<3;i++)
         {
         getElementsByClass('img','cest_button_img')[i].src='/fileadmin/arboe/dev/img/bg_teaserbox_0.gif'
         }
       getElementsByClass('img','cest_button_img')[newS].src='/fileadmin/arboe/dev/img/bg_teaserbox_1.gif';

       for(i=0;i<3;i++)
         {
         getElementsByClass('a','cest_button_title')[i].style.color='';
         getElementsByClass('a','cest_button_subtitle')[i].style.color='';
         }

       var a1=getElementsByClass('div','cest_button')[newS].getElementsByTagName('a')[0];
       var a2=getElementsByClass('div','cest_button')[newS].getElementsByTagName('a')[1];
       a1.style.color='white'; a2.style.color='white';

      }

}

// buttons OMO handler
function titleSlideshow_toggle(buttcount,mode){

var a1=getElementsByClass('div','cest_button')[buttcount].getElementsByTagName('a')[0];
var a2=getElementsByClass('div','cest_button')[buttcount].getElementsByTagName('a')[1];

if(mode) // over
  {
    // match
    window.showRuns=false; // stop show
    for(i=0;i<3;i++)
      {
      getElementsByClass('img','cest_button_img')[i].src='/fileadmin/arboe/dev/img/bg_teaserbox_0.gif';
      getElementsByClass('a','cest_button_title')[i].style.color='';
      getElementsByClass('a','cest_button_subtitle')[i].style.color='';
      }
    getElementsByClass('img','cest_button_img')[buttcount].src='/fileadmin/arboe/dev/img/bg_teaserbox_1.gif';

    a1.style.color='white'; //a1.style.textDecoration='underline';
    a2.style.color='white'; //a2.style.textDecoration='underline';

    var oldSlide=window.currentSlide; var newSlide=buttcount;
    titleSlideshow_fadeInOmo_Exec(oldSlide,newSlide);
  }else{ // out

    a1.style.textDecoration='none';
    a2.style.textDecoration='none';

    //window.currentSlide=buttcount; // match butt and restart show
    //window.showRuns=true; // restart show
  }
}

// slide-in the actual pic OMO
function titleSlideshow_fadeInOmo_Exec(oldS,newS){
var imgContainer=d('dvTitleAnimation');
titleSlideshow_fadeInOmo(oldS,newS);
}
function titleSlideshow_fadeInOmo(oldS,newS,count){
  var imgContainer=d('dvTitleAnimation');
  var oldSlide=imgContainer.getElementsByTagName('img')[oldS];
  var newSlide=imgContainer.getElementsByTagName('img')[newS];
  var isAlreadyThere=false; window.currentSlide=newS;

if(count==undefined)
  {
  window.showRuns=false;
  count=0;
  if(newSlide.style.zIndex!=3) // if it's not yet in the front...
    {
    // reset all
    for(var i=0;i<3;i++)
      {
      imgContainer.getElementsByTagName('img')[i].style.zIndex=1;
      imgContainer.getElementsByTagName('img')[i].style.visibility='hidden';
      }
    oldSlide.style.zIndex=2; oldSlide.style.visibility='visible';
    newSlide.style.zIndex=3; newSlide.style.visibility='visible';
    if(isIE5up)
      {
      newSlide.style.filter='progid:DXImageTransform.Microsoft.Alpha(opacity=0)';
      }else{
      newSlide.style.opacity=0;
      newSlide.style.MozOpacity=0;
      newSlide.style.KhtmlOpacity=0;
      }
    }else{isAlreadyThere=true;}
  }else if(!isAlreadyThere){
    count=count+10;
    if(isIE5up)
    {
     newSlide.style.filter='progid:DXImageTransform.Microsoft.Alpha(opacity='+count+')';
    }else{
     newSlide.style.opacity=count/100;
     newSlide.style.MozOpacity=count/100;
     newSlide.style.KhtmlOpacity=count/100;
    }
  }
 if(count<101)
   {
   if(!isAlreadyThere)
      {
      window.setTimeout("titleSlideshow_fadeInOmo("+oldS+","+newS+","+count+");",15);
      }
   }
}

// slide-in the actual pic
function titleSlideshow_fadeIn(oldS,newS,count){

if(!window.thisOldS||window.thisOldS==undefined)
  {
   window.thisOldS=oldS;
  }

if(window.thisOldS==oldS)
  {

  var imgContainer=d('dvTitleAnimation');
  var newSlide=imgContainer.getElementsByTagName('img')[newS];
  var oldSlide=imgContainer.getElementsByTagName('img')[oldS];
  if(count==undefined) // init
    {
      newSlide.style.visibility='visible';
      newSlide.style.zIndex=2;
      oldSlide.style.zIndex=1;
      count=5;
    }
    if(isIE5up)
      {
        newSlide.style.filter='progid:DXImageTransform.Microsoft.Alpha(opacity='+count+')';
      }else{
        newSlide.style.opacity=count/100; newSlide.style.MozOpacity=count/100; newSlide.style.KhtmlOpacity=count/100;
      }
    count=count+5;
    if(count<101)
      {
      window.setTimeout("titleSlideshow_fadeIn("+oldS+","+newS+","+count+");",15);
      }else{
      if(isIE5up)
        {
          newSlide.style.filter='progid:DXImageTransform.Microsoft.Alpha(opacity=100)';
        }else{
          newSlide.style.opacity=1; newSlide.style.MozOpacity=1; newSlide.style.KhtmlOpacity=1;
        }
      oldSlide.style.visibility='hidden';
      window.thisOldS=false;
      }
   }
}

// quirk: redirection to 'betriebsraete.arboe.at'
if(location.href.toLowerCase().indexOf('/betriebsraeteaktion')!=-1)
  {
   location.replace('http://betriebsraete.arboe.at');
  }

// map24.com inclusion
if(location.href.indexOf('/wegbeschreibung.')!=-1){
  document.write('<scr'+'ipt type="text/javascript" language="javascript" src="http://api.maptp.map24.com/ajax?appkey=FJX637ed9c707dd9311cdd54c31bec46X35"></script><scr'+'ipt type="text/javascript" language="javascript" src="/fileadmin/arboe/dev/scripts/map24.js"></script>');
}

// reformat latest news items without image
function reformatLatestNews(){
  var allNews=getElementsByClass('div','news-latest-item'); var thisText='';
  for(var i=0;i<allNews.length;i++)
    {try{
     if(!allNews[i].getElementsByTagName('img')[0])
      {
       thisText=allNews[i].getElementsByTagName('div')[4];
       thisText.style.width='320px';
       thisText.style.position='relative'; thisText.style.left='-100px';
      }
    }catch(error){}}
}

function correctTwoBottomBoxes(){if(d('dvTitleAnimation')){
try{
  var leftBox=getElementsByClass('div','csc-frame csc-frame-indent3366')[5];
  var rightBox=getElementsByClass('div','csc-frame csc-frame-indent3366')[6];

  var firstBox=getElementsByClass('div','csc-frame csc-frame-indent3366')[1];
  var secondBox=d('dvVerkehrsmeldungen');

  var firstMediumBox=getElementsByClass('div','csc-frame csc-frame-indent3366')[4];

  leftBox.style.width='325px'; rightBox.style.width='325px';

  if(isIE55up) // all-IE quirks
    {
    // remove subtitle teaser top gap
    var subtitles=getElementsByClass('a','cest_button_subtitle');
    for(var s=0;s<subtitles.length;s++)
      {
       subtitles[s].style.position='absolute';
       subtitles[s].style.top='15px';
      }
    }
  if(isIE7up) // IE7 quirks
    {
    // position boxes
    firstBox.style.position='absolute'; firstBox.style.top='311px';
    secondBox.style.position='absolute'; secondBox.style.top='626px'; secondBox.style.left='375px';
    leftBox.style.position='absolute'; leftBox.style.top='675px'; leftBox.style.left='30px';
    rightBox.style.position='absolute'; rightBox.style.top='675px'; rightBox.style.left='375px'
    firstMediumBox.style.position='absolute'; firstMediumBox.style.top='470px';
    firstMediumBox.style.width='760px';
    // create and position first medium box x separator element
    var sep=document.createElement('img');
    sep.id='imSepMediumBox'; sep.src='/fileadmin/arboe/dev/img/sep_x-mediumbox.gif';
    document.body.appendChild(sep);
    // remove the very same separator from the wrong position
    firstMediumBox.parentNode.previousSibling.style.display='none';
    }else if(isIE55up&&!isIE7up){ // IE5.5/6 quirks
    // position boxes
    leftBox.style.position='absolute'; leftBox.style.top='675px'; leftBox.style.left='30px';
    rightBox.style.position='absolute'; rightBox.style.top='675px'; rightBox.style.left='375px';
    rightBox.id='dvStartpageRightNewsBox';
    }else{ // non-IE
    // position boxes
    leftBox.style.position='absolute'; leftBox.style.top='675px'; leftBox.style.left='30px';
    rightBox.style.position='absolute'; rightBox.style.top='675px'; rightBox.style.left='375px';
    }

}catch(error){}
}}

// create Benzinpreise teaser on start page
function createBenzinpreise(headlineText){try{

  // --- begin config countries and fuel sorts here (arg1|arg1shortcut,arg2|arg2shortcut,...)
  var countries='Burgenland|Bgld,K&auml;rnten|Ktn,Nieder&ouml;sterreich|Noe,Ober&ouml;sterreich|Ooe,Salzburg|Sbg,Steiermark|Stmk,Tirol|T,Vorarlberg|Vbg,Wien|Wien';
  var fuels='Diesel|Diesel,Normalbenzin|Normal,Super 95|Super95,Super 98|Super98';
  // --- end config

var countryArr=new Array();countryArr=countries.split(','); var fuelArr=new Array();fuelArr=fuels.split(',');
var countryOptions='<option value="" selected>Bundesland</option>';
for(var i=0;i<countryArr.length;i++)
  {countryOptions+='<option value="'+countryArr[i].split('|')[1]+'">'+countryArr[i].split('|')[0]+'</option>';}
var fuelOptions='<option value="" selected>Treibstoff</option>';
for(i=0;i<fuelArr.length;i++)
  {fuelOptions+='<option value="'+fuelArr[i].split('|')[1]+'">'+fuelArr[i].split('|')[0]+'</option>';}

var selects='<select id="seFuel" class="se_startteaser" style="margin-bottom:5px;">'+fuelOptions+'</select><br><select id="seCountry" class="se_startteaser" style="margin-bottom:7px;">'+countryOptions+'</select><img src="fileadmin/arboe/dev/img/bt_preis-abfragen.gif" alt="Preis abfragen" class="clib_link" onclick="createBenzinpreise_callLink();">';
var html='<div class="servicebox_start"><div class="header_c8"><div class="box_img"><img src="/fileadmin/arboe/dev/img/box_newsheader_start.gif" width="211" height="27" alt="Service" /></div><div class="box_header"><span class="box_headertext" id="spBenzinpreiseHeadertext">'+headlineText+'</span></div></div><div class="box_content"><div class="service-box-content" style="height:90px;">'+selects+'</div></div><div class="box_bottom"><img src="/fileadmin/arboe/dev/img/box_bottom_start.gif" width="211" height="9" alt="Service" /></div></div>';

d('dvBenzinpreise').innerHTML=html;

}catch(error){window.setTimeout("createBenzinpreise('"+headlineText+"')",1000);}}

function createBenzinpreise_callLink(){
 var cV=d('seCountry').options[d('seCountry').options.selectedIndex].value;
 var fV=d('seFuel').options[d('seFuel').options.selectedIndex].value;
 if(cV!=''&&fV!='')
  {
  if(isIE55up)
    {
    clib_dwin.open('http://www3.arboe.at/arboe/lverkehr.nsf/'+cV+fV+'?OpenView&mode=1',d('spBenzinpreiseHeadertext').innerHTML,'htmlmode=no,scrollbars=yes,titlebar=yes,buttons=yes,width=900,height=600,top=20,left=20','')
    }else{
    window.open('http://www3.arboe.at/arboe/lverkehr.nsf/'+cV+fV+'?OpenView&mode=1');
    }
  }

}

// create Verkehrsmeldungen teaser on start page; only IE & Gecko, other browsers show default text and simple link
function createVerkehrsmeldungen(headlineText,srcSubdomain,srcPath){try{

var srcURL='http://'+srcSubdomain+'.'+document.domain+'/'+srcPath;

var teaserText='Hier lesen Sie die aktuellen Verkehrsmeldungen des ARB&Ouml;.<br><a href="http://www.arboe.at/aktuelle_verkehrsinformationen.html" style="color:#000000;font-weight:normal;">&gt; mehr Infos</a>';

window.srcURL=srcURL;

var html='<div class="servicebox_start"><div class="header_c8"><div class="box_img"><img src="/fileadmin/arboe/dev/img/box_newsheader_start_rot.gif" width="211" height="27" alt="Service" /></div><div class="box_header"><span class="box_headertext">'+headlineText+'</span></div></div><div class="box_content"><div class="service-box-content" style="height:90px;overflow:hidden;"><div id="dvVerkehrsmeldungenTeaser">'+teaserText+'</div></div></div><div class="box_bottom"><img src="/fileadmin/arboe/dev/img/box_bottom_start.gif" width="211" height="9" alt="Service" /></div></div>';
html+='<iframe id="ifVerkehrsmeldungen" src="'+srcURL+'" style="visibility:hidden;height:1px;width:1px;position:absolute;top:-10000px;left:-10000px;"></iframe>';

d('dvVerkehrsmeldungen').innerHTML=html;

createVerkehrsmeldungen_fetchMeldung(headlineText);
}catch(error){window.setTimeout("createVerkehrsmeldungen('"+headlineText+"','"+srcSubdomain+"','"+srcPath+"')",1000);}}
function createVerkehrsmeldungen_fetchMeldung(headlineText){
window.headlineText=headlineText;
var vm=d('ifVerkehrsmeldungen');

try{
if(vm.contentWindow&&vm.contentWindow.document&&vm.contentWindow.document.documentElement&&vm.contentWindow.document.documentElement.innerHTML){
  if(window.oldVMLength==undefined||!window.oldVMLength)
    {
     window.oldVMLength=0;
    }
  if(d('ifVerkehrsmeldungen').contentWindow.document.documentElement.innerHTML.length==window.oldVMLength)
    {
    var vmText=d('ifVerkehrsmeldungen').contentWindow.document.documentElement.innerHTML;
    var vmObj=d('ifVerkehrsmeldungen').contentWindow.document;

      // create teaser
      var vmTeaser='';
      // "slice" the whole text body by using double linebreaks as separators
      // try to fetch the first article, on fail deliver replacement text
      try{
        var allF=vmObj.getElementsByTagName('font');
        for(var i=0;i<allF.length;i++)
          {
           if(allF[i].innerHTML=='Verkehrslage')
            {
              vmTeaser=allF[i+1].innerHTML;
            }
          }
        while(vmTeaser.indexOf('<BR><BR>')!=-1){vmTeaser=vmTeaser.replace('<BR><BR>','<BR>');}
        while(vmTeaser.indexOf('<br><br>')!=-1){vmTeaser=vmTeaser.replace('<br><br>','<br>');}
        while(vmTeaser.indexOf('<BR>')!=-1){vmTeaser=vmTeaser.replace('<BR>',' ');}
        while(vmTeaser.indexOf('<br>')!=-1){vmTeaser=vmTeaser.replace('<br>',' ');}
        if(vmTeaser.length>100)
          {
          vmTeaser=vmTeaser.substring(0,100);
          }
        vmTeaser=vmTeaser.substring(0,vmTeaser.lastIndexOf(' '))+'&nbsp;...';
      }catch(error){
      vmTeaser='Hier lesen Sie die aktuellen Verkehrsmeldungen des ARB&Ouml;.';
     }

    if(vmTeaser=='&nbsp;...'){vmTeaser='Hier lesen Sie die aktuellen Verkehrsmeldungen des ARB&Ouml;.';}
    vmTeaser+='<br><a href="http://www.arboe.at/aktuelle_verkehrsinformationen.html" style="color:#000000;font-weight:normal;">&gt; mehr Infos</a>';
    d('dvVerkehrsmeldungenTeaser').innerHTML=vmTeaser;

    }else{
    window.oldVMLength=d('ifVerkehrsmeldungen').contentWindow.document.documentElement.innerHTML.length;
    window.setTimeout("createVerkehrsmeldungen_fetchMeldung('"+headlineText+"');",1000);
    }
  }else{window.setTimeout("createVerkehrsmeldungen_fetchMeldung('"+headlineText+"');",25);}
}catch(error){window.setTimeout("createVerkehrsmeldungen_fetchMeldung('"+headlineText+"');",25);}
}
function createVerkehrsmeldungen_callLink(){
if(isIE55up||isGecko)
  {
  clib_dwin.open(window.vmText,window.headlineText,'htmlmode=yes,scrollbars=yes,titlebar=yes,buttons=yes,width=400,height=300,top=100,left=100','')
  }else{
  window.open(window.srcURL);
  }
}

// create Routeplaner teaser on start page
function createRoutenplaner(headlineText){try{

  // --- begin config countries and fuel sorts here (arg1|arg1shortcut,arg2|arg2shortcut,...)
  // --- end config

var html='<form name="submitForm"  method="get" action="http://star.map24.com/arboe" target="_blank"><input type="hidden" name="search" value="1"><input type="hidden" name="q" value=""><input type="hidden" name="s" value=""><input type="hidden" name="d" value=""><input type="hidden" name="midx" value=""></form><form name="m24_routenplaner" id="m24_routenplaner" method="get" action="http://star.map24.com/arboe" target="_blank"><div class="servicebox_start"><div class="header_c8"><div class="box_img"><img src="/fileadmin/arboe/dev/img/box_newsheader_start_rot.gif" width="211" height="27" alt="Service" /></div><div class="box_header"><span class="box_headertext">'+headlineText+'</span></div></div><div class="box_content"><div class="service-box-content" style="height:90px;"><nobr><input value="Ort PLZ Stra&szlig;e" onclick="this.value=\'\';" onkeypress="clib_keys(13,\'btRouteBerechnen\');" name="s_search" id="s_search" class="ip_startteaser" style="margin-bottom:5px;">&nbsp;<b class="bRoutenplanerLabel">Start</b></nobr><br><nobr><input value="Ort PLZ Stra&szlig;e" name="s_destination" id="s_destination" class="ip_startteaser" style="margin-bottom:7px;" onclick="this.value=\'\';" onkeypress="clib_keys(13,\'btRouteBerechnen\');">&nbsp;<b class="bRoutenplanerLabel">Ziel</b></nobr><br><img id="btRouteBerechnen" src="fileadmin/arboe/dev/img/bt_route-berechnen.gif" alt="Route berechnen" class="clib_link" onclick="if(d(\'s_search\').value!=\'\'&&d(\'s_destination\').value!=\'\'&&d(\'s_search\').value!=\'Ort PLZ Stra&szlig;e\'&&d(\'s_destination\').value!=\'Ort PLZ Stra&szlig;e\'){m24SendQuery(\'route\');};"></div></div><div class="box_bottom"><img src="/fileadmin/arboe/dev/img/box_bottom_start.gif" width="211" height="9" alt="Service" /></div></div><select name="midx" style="display:none;"><option value="0">Europa</option></select></form>';

d('dvRoutenplaner').innerHTML=html;
}catch(error){window.setTimeout("createRoutenplaner('"+headlineText+"')",1000);}}

// create Schneeberichte teaser on start page
function createSchneeberichte(headlineText){

  // --- begin config countries here (arg1|arg1shortcut,arg2|arg2shortcut,...)
  var countries='K&auml;rnten|Ktn,Nieder&ouml;sterreich|Noe,Ober&ouml;sterreich|Ooe,Salzburg|Sbg,Steiermark|Stmk,Tirol|Tirol,Vorarlberg|Vbg,Wien|Wien,Gletscherskigebiete|Gletscher,S&uuml;dtirol/Italien|Italien';
  // --- end config

var countryArr=new Array();countryArr=countries.split(',');
var countryOptions='<option value="" selected>Bundesland</option>';
for(var i=0;i<countryArr.length;i++)
  {countryOptions+='<option value="'+countryArr[i].split('|')[1]+'">'+countryArr[i].split('|')[0]+'</option>';}

var selects='<select id="seSchneeberichtCountry" class="" style="margin-bottom:7px;">'+countryOptions+'</select><img src="fileadmin/arboe/dev/img/bt_abfragen.gif" alt="Abfragen" class="clib_link" onclick="createSchneeberichte_callLink();">';
var html='<div class="dvServiceboxRight"><h3 id="h3SchneeberichteHeadertext">'+headlineText+'</h3><div class="csc-textpic csc-textpic-left csc-textpic-below"><div class="csc-textpic-text"><p class="bodytext">'+selects+'</p></div></div></div>';

d('dvSchneeberichte').innerHTML=html;
}
function createSchneeberichte_callLink(){
 var cV=d('seSchneeberichtCountry').options[d('seSchneeberichtCountry').options.selectedIndex].value;
 if(cV!='')
  {
  if(isIE55up)
    {
    clib_dwin.open('http://www3.arboe.at/arboe/lwinter.nsf/'+cV+'?OpenView&mode=1',d('h3SchneeberichteHeadertext').innerHTML,'htmlmode=no,scrollbars=yes,titlebar=yes,buttons=yes,width=900,height=600,top=20,left=20','')
    }else{
    window.open('http://www3.arboe.at/arboe/lwinter.nsf/'+cV+'?OpenView&mode=1');
    }
  }
}

// manually position service boxes on start page @ F******, F******, F****** IE7
// (ofcourse, all other browsers render it correctly by themselves, even the also F****** IE6)
function positionServiceBoxes(){try{
var sb1=getElementsByClass('div','servicebox_start')[1];
var sb2=getElementsByClass('div','servicebox_start')[2];
if(isIE7up)
  {
  sb1.style.position='relative'; sb1.style.top='-315px'; sb1.style.left='-115px';
  sb2.style.position='absolute'; sb2.style.top='311px'; sb2.style.left='490px';
  }
window.setTimeout("positionServiceBoxes();",1000);
}catch(error){}}

// Submit form to Map24, Send routeplanner or search request
function m24SendQuery(type)
{
	var q = d('s_search').value;
	var scity = d('s_search').value;
	var dcity = d('s_destination').value;

	var formAction = 'http://star.map24.com/arboe';

	var sDefaultValue = 'Start, Adresse, PLZ oder POI';
	var dDefaultValue = 'ZIEL, Adresse, PLZ oder POI';
	var midx = 1;

	if (q == sDefaultValue) q = '';
	if (scity == sDefaultValue) scity = '';
	if (dcity == dDefaultValue) dcity = '';

	for (var i=0; i<document.m24_routenplaner.midx.length; i++)
	{
		if (document.m24_routenplaner.midx.options[i].selected == true)
		{
			midx = document.m24_routenplaner.midx.options[i].value;
			break;
		}
	}


	switch (type)
	{
		case 'search':
			if (q == '') return;
			document.submitForm.midx.value = midx;
			document.submitForm.q.value = q;
			document.submitForm.submit();
		break;
		case 'route':
			if (scity == '' || dcity == '') return;
			document.submitForm.s.value = scity;
			document.submitForm.d.value = dcity;
			document.submitForm.midx.value = midx;
			document.submitForm.submit();
		break;
	}
}
// Remove default value
function removeDefaultValue(type)
{
	var q = d('s_search').value;
	var s = d('searchin').value;
	var scity = d('s_search').value;
	var dcity = d('s_destination').value;

	var sDefaultValue = 'Start, Adresse, PLZ oder POI';
	var dDefaultValue = 'ZIEL, Adresse, PLZ oder POI';

	switch (type)
	{
		case 'search':
			if (q == sDefaultValue) document.m24_routenplaner.s_search.value = '';
			if (scity == sDefaultValue) document.m24_routenplaner.s_search.value = '';
		break;
		case 'searchin':
			if (s == sDefaultValue) document.m24_hotelsearch.searchin.value = '';
		break;
		case 'route':
			if (dcity == dDefaultValue) document.m24_routenplaner.s_destination.value = '';
		break;
	}
	return;
}

// style buttons
function styleButtons(){try{
var allInps=document.getElementsByTagName('input'); var b=''; var w=0; var tbc=''; // collect elements
for(var i=0;i<allInps.length;i++)
  {
  b=allInps[i];

  /*
  if(b.type=='button'||b.type=='submit'||b.type=='reset'||b.type=='file') // if it's a button-like element...
    {
    w=b.offsetWidth; // get offset width; below the class corresponding to the width is chosen
    if(w<50){tbc=60;}
    if(w>49&&w<110){tbc=120;}
    if(w>109){tbc=240;}
    b.className='button_'+tbc;
    }
  */

  if(b.type=='checkbox'||b.type=='radio') // restyle radio and checkbox elements
    {
      allInps[i].style.backgroundColor='transparent';
      allInps[i].style.border=0;
    }
  }
}catch(error){window.setTimeout("styleButtons();",500);}}
clib_onload("styleButtons()");

// hard-link the logo banner to the root page
function hardLinkLogo(){
  if(d('logo')){
    try{d('logo').getElementsByTagName('a')[0].href='/';}catch(error){}
  }
}
clib_onload("hardLinkLogo()");




/* Google Search */

function goToSearch(urlsite) {

var Ergebnis = urlsite.search(/\?.+/);
if (Ergebnis = -1)
{
	urlsite+='?';
}


var goto=urlsite +'&ipt_search='+escape(d('ipt_search').value);
	window.location.href =goto;
}


/** helper to get url parameter via js **/
function getURLParam(strParamName){
	var strReturn = "";
	var strHref = window.location.href;
	if ( strHref.indexOf("?") > -1 ){
		var strQueryString = strHref.substr(strHref.indexOf("?")).toLowerCase();
		var aQueryString = strQueryString.split("&");
		for ( var iParam = 0; iParam < aQueryString.length; iParam++ ){
			if (aQueryString[iParam].indexOf(strParamName.toLowerCase() + "=") > -1 ){
				var aParam = aQueryString[iParam].split("=");
				strReturn = aParam[1];
				break;
			}
		}
	}
    return unescape(strReturn);
}

// fix top boxes second line @ FF
function fixTopBoxes2ndLineAtFF(){
var allButtTits=getElementsByClass('a','cest_button_title');
for(var i=0;i<allButtTits.length;i++)
  {
  if(allButtTits[i].offsetHeight>55)
    {
     currTop=allButtTits[i].parentNode.getElementsByTagName('a')[1].offsetTop;
     allButtTits[i].parentNode.getElementsByTagName('a')[1].style.top=(currTop+10)+'px';
    }
  }
}
if(isGecko){clib_onload("fixTopBoxes2ndLineAtFF()");}

// correct width of ARBOE AKTION box on portal page at IE6 (widen last indent-3366 box)
function fixBoxesAtIE6(){try{
if(location.href.indexOf('.html')==-1)
  {
  var dvAktionBox=getElementsByClass('div','csc-frame csc-frame-indent3366')[6];
  dvAktionBox.style.width='450px';
  }else{
  var allDivs=document.getElementsByTagName('div');
  for(var i=0;i<allDivs.length;i++)
    {
     if(allDivs[i].className.indexOf('csc-frame-indent3366')!=-1)
      {
       allDivs[i].style.width='100%';
      }
    }
  }
}catch(error){window.setTimeout("fixBoxesAtIE6();",1000);}}
if(isIE55up&&!isIE7up){clib_onload("fixBoxesAtIE6()");}