var timer=new Object();var ab=new Object();var bb=new Object();var cb=db();var eb=0;var auto_reload=1;var fb=new Object();var	is_opera=window.opera!==undefined;var	is_ie=document.all!==undefined&&window.opera===undefined;var is_ie6p=document.compatMode!==undefined&&document.all!==undefined&&window.opera===undefined;var is_ie7=document.documentElement!==undefined&&document.documentElement.style.maxHeight!==undefined;var is_ie6=is_ie6p&&!is_ie7;var is_ff2p=window.Iterator!==undefined;var is_ff3p=document.getElementsByClassName!==undefined;var is_ff2=is_ff2p&&!is_ff3p
function gb(){return hb('height');}
function ib(){return hb('width');}
function hb(jb){var kb=0,lb=0;if(typeof(window.innerWidth)=='number'){kb=window.innerWidth;lb=window.innerHeight;}
else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){kb=document.documentElement.clientWidth;lb=document.documentElement.clientHeight;}
else if(document.body&&(document.body.clientWidth||document.body.clientHeight)){kb=document.body.clientWidth;lb=document.body.clientHeight;}
if(jb=='height')return lb;if(jb=='width')return kb;}
var gmwds=false;function start(){mb("l1");mb("l2");mb("l3");mb("l4");initCounter();if(typeof init_local=='function'){init_local();}
if(gmwds){gmwd();}
}
function nb(){return new Date().getTime();}
function db(){return Math.round(nb()/1000);}
function ob(pb){p=pb.innerHTML.split(":");qb=p[0]*3600+p[1]*60+p[2]*1;return qb;}
function rb(s){var sb,tb,ub;if(s>-2){sb=Math.floor(s/3600);tb=Math.floor(s/60)%60;ub=s%60;t=sb+":";if(tb<10){t+="0";}
t+=tb+":";if(ub<10){t+="0";}
t+=ub;}
else
{t="<a href=\"#\"><span class=\"c0 t\">00:00:00</span>?</a>";}
return t;}
function initCounter(){for(var i=1;;i++){pb=document.getElementById("tp"+i);if(pb!=null){ab[i]=new Object();ab[i].node=pb;ab[i].counter_time=ob(pb);}
else{break;}
}
for(i=1;;i++){pb=document.getElementById("timer"+i);if(pb!=null){bb[i]=new Object();bb[i].node=pb;bb[i].counter_time=ob(pb);}
else{break;}
}
executeCounter();}
function executeCounter(){for(var i in ab){vb=db()-cb;wb=rb(ab[i].counter_time+vb);ab[i].node.innerHTML=wb;}
for(i in bb){vb=db()-cb;xb=bb[i].counter_time-vb
	if(eb==0&&xb<1){
		eb=1;
		if(auto_reload==1){
			setTimeout("document.location.reload()",3000);
		}
	else if(auto_reload==0){
		setTimeout("mreload()",1000);
	}
}
else{}
wb=rb(xb);bb[i].node.innerHTML=wb;}
if(eb==0){window.setTimeout("executeCounter()",1000);}
}
function mb(yb){pb=document.getElementById(yb);if(pb!=null){fb[yb]=new Object();var zb=pb.innerHTML.match(/(\d+)\/(\d+)/);element=zb[0].split("/");$b=parseInt(element[0]);_b=parseInt(element[1]);ac=pb.title;if(ac!=0){bc=nb();timer[yb]=new Object();timer[yb].start=bc;timer[yb].production=ac;timer[yb].start_res=$b;timer[yb].max_res=_b;timer[yb].ms=3600000/ac;cc=100;if(timer[yb].ms<cc){timer[yb].ms=cc;}
timer[yb].node=pb;executeTimer(yb);}
else
{timer[yb]=new Object();fb[yb].value=$b;}
}
}
function executeTimer(yb){vb=nb()-timer[yb].start;if(vb>=0){dc=Math.round(timer[yb].start_res+vb*(timer[yb].production/3600000));if(dc>=timer[yb].max_res){dc=timer[yb].max_res;}
else
{window.setTimeout("executeTimer('"+yb+"')",timer[yb].ms);}
fb[yb].value=dc;timer[yb].node.innerHTML=dc+'/'+timer[yb].max_res;}
}
var ec=new Array(0,0,0,0,0);function add_res(fc){gc=fb['l'+(5-fc)].value;hc=haendler*carry;ec[fc]=ic(ec[fc],gc,hc,carry);document.getElementById('r'+fc).value=ec[fc];}
function upd_res(fc,jc){gc=fb['l'+(5-fc)].value;hc=haendler*carry;if(jc){kc=gc;}
else
{kc=parseInt(document.getElementById('r'+fc).value);}
if(isNaN(kc)){kc=0;}
ec[fc]=ic(parseInt(kc),gc,hc,0);document.getElementById('r'+fc).value=ec[fc];}
function ic(lc,mc,nc,oc){pc=lc+oc;if(pc>mc){pc=mc;}
if(pc>nc){pc=nc;}
if(pc==0){pc='';}
return pc;}
function mreload(){param='reload=auto';url=window.location.href;if(url.indexOf(param)==-1){if(url.indexOf('?')==-1){url+='?'+param;}
else
{url+='&'+param;}
}
document.location.href=url;}

