var loop,tickerobj,tickerpos=0,tickeroff=0;
function GagolgaInit(){countdown();rsImg(515,'fui');wichtig();if(popup_pm)Popup('_new_pm','?page=pm_popup',300,150,'no','no',1);TickerInit();}
function toSt(n){s='';if(n<10) s+='0';return s+n.toString();}
function countdown(){if(nextleveltime!=0){d=new Date();count=Math.floor(nextleveltime-(d.getTime()/1000));if(count<=0){if(loop=='0'){document.getElementById("countdown").innerHTML ='00h 00m 00s';loop='1';}else{document.getElementById("countdown").innerHTML='<span style="color:#000;">00h 00m 00s<'+'/span>';loop='0';}}else{secs_count=toSt(count%60);count=Math.floor(count/60);mins_count=toSt(count%60);count=Math.floor(count/60);hours_count=count%24;count=Math.floor(count/24);hours_count=toSt(hours_count+(count*24));document.getElementById("countdown").innerHTML=hours_count+'h '+mins_count+'m '+secs_count+'s';}window.setTimeout('countdown()',990);}}
function reallyDo(msg,link){user=confirm(msg);if (user==true){window.location.href = link;}else{return false;}}
function Popup(n,u,w,h,s,r,c){var f,l=(screen.width-w)/2,t=(screen.height-h)/2,p='height='+h+',width='+w+',';if(c==1)p+='top='+t+',left='+l+',';p+='scrollbars='+s+',resizable='+r;window.open(u,n,p);return false;f.statusbar=false;} 
function askSubmit(msg,data){ok=confirm(msg);if(ok==true){document.data.value=data;return true;}else{return false;}}
function Content(id,data){document.getElementById(id).innerHTML=data;}
function CbInvert(form){for (var i = 0; i< form.elements.length; i++){var e=form.elements[i];if(e.type=="checkbox")if(e.checked==true)e.checked=false;else e.checked=true;}}
function wichtig(){var obj = document.getElementById('blinker');if(obj){if(obj.style.color == 'red'){obj.style.color = 'white';}else{obj.style.color = 'red';}window.setTimeout('wichtig()', 1000);}}
function rsImg(mW,id){if(document.images.length>0){var iH,iW,di,l;for(l=0;l<document.images.length;l++){d=document.images[l];if(d.name==id){iW=d.width;iH=d.height;if(iW>mW){d.width=mW;d.height=iH/(iW/mW);d.style.border="1px solid #FD9800";d.onclick=function(){window.open(this.src,id,'');};d.onmouseover=function(){this.style.cursor='pointer';};d.onmouseout=function(){this.style.cursor='default';};}}}}}
function TickerInit(){tickerobj=document.getElementById('tickertxt');if(tickerobj){tickerobj.innerHTML=tickerobj.innerHTML+tickerobj.innerHTML+tickerobj.innerHTML;tickeroff=tickerobj.offsetWidth/3;setInterval('Ticker()',50);}}  
function Ticker(){if(Math.abs(tickerpos) > tickeroff){tickerpos=0;}tickerobj.style.left=tickerpos+'px';tickerpos=parseInt(tickerpos)-2;}
