// By George Chiang
// Courtesy of SimplytheBest.net - http://simplythebest.net/scripts/
var dn
c1=new Image(); c1.src="./mod/jetztheader/img/clock_images/c1.gif"
c2=new Image(); c2.src="./mod/jetztheader/img/clock_images/c2.gif"
c3=new Image(); c3.src="./mod/jetztheader/img/clock_images/c3.gif"
c4=new Image(); c4.src="./mod/jetztheader/img/clock_images/c4.gif"
c5=new Image(); c5.src="./mod/jetztheader/img/clock_images/c5.gif"
c6=new Image(); c6.src="./mod/jetztheader/img/clock_images/c6.gif"
c7=new Image(); c7.src="./mod/jetztheader/img/clock_images/c7.gif"
c8=new Image(); c8.src="./mod/jetztheader/img/clock_images/c8.gif"
c9=new Image(); c9.src="./mod/jetztheader/img/clock_images/c9.gif"
c0=new Image(); c0.src="./mod/jetztheader/img/clock_images/c0.gif"
cb=new Image(); cb.src="./mod/jetztheader/img/clock_images/cb.gif"
s1=new Image(); s1.src="./mod/jetztheader/img/clock_images/cb.gif"
s2=new Image(); s2.src="./mod/jetztheader/img/clock_images/cb.gif"
function extract(h,m,s,text){
if (!document.images)
return

if (text==1){
    document.images.s1.src="./mod/jetztheader/img/clock_images/seit.gif"
    document.images.s2.src="./mod/jetztheader/img/clock_images/open.gif"
}
if (text==2){
    document.images.s1.src="./mod/jetztheader/img/clock_images/noch.gif"
    document.images.s2.src="./mod/jetztheader/img/clock_images/open.gif"
}
if (text==3){
    document.images.s1.src="./mod/jetztheader/img/clock_images/seit.gif"
    document.images.s2.src="./mod/jetztheader/img/clock_images/close.gif"
}
if (text==4){
    document.images.s1.src="./mod/jetztheader/img/clock_images/in.gif"
    document.images.s2.src="./mod/jetztheader/img/clock_images/open.gif"
}
if (h<=9){
    document.images.a.src=c0.src;

    if (h==-1) document.images.b.src=eval("c"+0+".src") 
    else document.images.b.src=eval("c"+h+".src") 

} else {
document.images.a.src=eval("c"+Math.floor(h/10)+".src")
document.images.b.src=eval("c"+(h%10)+".src") 

}
    
if (m<=9){
document.images.d.src=c0.src
document.images.e.src=eval("c"+m+".src")
} else {
document.images.d.src=eval("c"+Math.floor(m/10)+".src")
document.images.e.src=eval("c"+(m%10)+".src")
}

//if (s<=9){
//document.g.src=c0.src
//document.images.h.src=eval("c"+s+".src")
//} else {
//document.images.g.src=eval("c"+Math.floor(s/10)+".src")
//document.images.h.src=eval("c"+(s%10)+".src")
//}

document.getElementsByName('text1').write=string1
//if (dn=="AM") document.j.src=cam.src
//else document.images.j.src=cpm.src
}
function show3(){
if (!document.images)
return
var Digital=new Date()
var hours=Digital.getHours()
var minutes=Digital.getMinutes()
var seconds=Digital.getSeconds()
var day=Digital.getDay()
var delta
var text
var openhour=18;
var closehour=4;
if (day==1) closehour=2
if (day==6) openhour=20


if (hours>=openhour && hours<=24) { delta=hours-18;text=1;string1='Seit';string2='geöffnet' }
if (hours>=0 && hours<=2) { delta=1-hours;minutes=60-minutes;seconds=60-seconds;text=2;string1='Noch';string2='geöffnet'}
if (hours>=closehour && hours<10) { delta=10-hours;text=3;string1='Seit';string2='geschlossen' }
if (hours>=10 && hours<=openhour) { delta=openhour-hours-1;minutes=60-minutes;seconds=60-seconds;text=4;string1='In';string2='geöffnet'}
//else deltahours=hours

extract(delta,minutes,seconds,text)
setTimeout("show3()",10000)
}


 var beIE = document.all?true:false;
function openRandlos(urlPop,windowW,windowH,windowX,windowY,autoclose){
    var title =  ""
    s = "width="+windowW+",height="+windowH;
  if (beIE){
    NFW = window.open("","popFrameless","fullscreen,"+s)
    NFW.blur()
    window.focus()
    NFW.resizeTo(windowW,windowH)
    NFW.moveTo(windowX,windowY)
    var frameString=""+
"<html>"+
"<head>"+
"<title>"+title+"</title>"+
"</head>"+
"<frameset rows='*,0' framespacing=0 border=0 frameborder=0>"+
"<frame name='top' src='"+urlPop+"' scrolling=no MARGINHEIGHT='0' MARGINWIDTH='0' FRAMEBORDER='0'>"+
"<frame name='bottom' src='about:blank' scrolling='no' MARGINHEIGHT='0' MARGINWIDTH='0' FRAMEBORDER='0'>"+
"</frameset>"+
"</html>"
    NFW.document.open();
    NFW.document.write(frameString)
    NFW.document.close()
  } else {
    windowW = windowW+15
    windowH = windowH+42
    s = "width="+windowW+",height="+windowH;
    NFW=window.open(urlPop,"popFrameless",+s)
    NFW.blur()
    NFW.resizeTo(windowW,windowH)
    NFW.moveTo(windowX,windowY)
    window.focus()

  }
  NFW.focus()
  if (autoclose){
    window.onunload = function(){NFW.close()}
  }
}



 var popJetztWindow=null;
function popJetzt(urlPop,windowW,windowH,windowX,windowY,autoclose){

{LeftPosition=200;TopPosition=300;}
settings='width='+ windowW + ',height='+ windowH + ',top=' + windowY + ',left=' + windowX + ',location=no,directories=no,menubar=no,toolbar=no,status=no,scrollbars=auto,resizable=no,dependent=no';
popJetztWindow=window.open(urlPop,"",settings);
popJetztWindow.focus()
}

function popScroll(urlPop,windowW,windowH,windowX,windowY,autoclose){

{LeftPosition=200;TopPosition=300;}
settings='width='+ windowW + ',height='+ windowH + ',top=' + windowY + ',left=' + windowX + ',location=no,directories=no,menubar=no,toolbar=no,status=no,scrollbars=yes,resizable=no,dependent=no';
popJetztWindow=window.open(urlPop,"",settings);
popJetztWindow.focus()
}





function showtip2(current,e,text){
  if (document.all&&document.readyState=="complete"){
    document.all.tooltip2.innerHTML='<marquee style="border:0px solid black">'+text+'</marquee>'
    document.all.tooltip2.style.pixelLeft=event.clientX+document.body.scrollLeft+10
    document.all.tooltip2.style.pixelTop=event.clientY+document.body.scrollTop+10
    document.all.tooltip2.style.visibility="visible"
}
  else if (document.layers){
    document.tooltip2.document.nstip.document.write('<b>'+text+'</b>')
    document.tooltip2.document.nstip.document.close()
    document.tooltip2.document.nstip.left=0
    currentscroll=setInterval("scrolltip()",100)
    document.tooltip2.left=e.pageX+10
    document.tooltip2.top=e.pageY+10
    document.tooltip2.visibility="show"
}
}
function hidetip2(){
  if (document.all)
    document.all.tooltip2.style.visibility="hidden"
    else if (document.layers){
    clearInterval(currentscroll)
    document.tooltip2.visibility="hidden"
}
}
function showtip(current,e,text){
  if (document.all&&document.readyState=="complete"){
    document.all.tooltip.innerHTML='<marquee style="border:0px solid black">'+text+'</marquee>'
    document.all.tooltip.style.pixelLeft=event.clientX+document.body.scrollLeft+10
    document.all.tooltip.style.pixelTop=event.clientY+document.body.scrollTop+10
    document.all.tooltip.style.visibility="visible"
}
  else if (document.layers){
    document.tooltip.document.nstip.document.write('<b>'+text+'</b>')
    document.tooltip.document.nstip.document.close()
    document.tooltip.document.nstip.left=0
    currentscroll=setInterval("scrolltip()",100)
    document.tooltip.left=e.pageX+10
    document.tooltip.top=e.pageY+10
    document.tooltip.visibility="show"
}
}
function hidetip(){
  if (document.all)
    document.all.tooltip.style.visibility="hidden"
    else if (document.layers){
    clearInterval(currentscroll)
    document.tooltip.visibility="hidden"
}
}


function textticker(current,e,text){
 
    document.getByID(tooltip).innerHTML='<marquee style="border:0px solid black">'+text+'</marquee>'
    document.getByID(tooltip).style.pixelLeft=event.clientX+document.body.scrollLeft+10
    document.getByID(tooltip).style.pixelTop=event.clientY+document.body.scrollTop+10
    document.getByID(tooltip).style.visibility="visible"


}

