/**
 * Javascript class for the Livescore results
 *
 * @namespace        
 * @version          $Id: class.livescore.compressed.js 33 2010-07-16 21:30:38Z tomtaz $
 * @author           Tomtaz
 * @LastChangedBy    $LastChangedBy: tomtaz $    
 * @date             2010-6-2 19:3:00 +100
 * @LastChangedDate  $LastChangedDate: 2010-07-16 23:30:38 +0200 (Fr, 16. Jul 2010) $
 * @Revision         $Revision: 33 $
 * @copyright        © 2010 by „Tomtaz Scripts & IT-Service“
 * @license          Full licensed to tippspiel4free.de - (TipperManager)
 */

var Livescore={showGoalAlert:true,layerOpend:false,fadeAction:null,fader:null,newGoalTimeout:null,DocumentHeight:null,DocumentWidth:null,LayerPosTop:null,LayerPosLeft:null,goalAlertOff:function(){this.showGoalAlert=false;this.layerOpend==true&&this.fadeOut();return false},closeLayer:function(){this.layerOpend==true&&this.fadeOut();this.newGoalTimeout&&clearTimeout(this.newGoalTimeout);return false},fadeIn:function(){this.fadeAction="in";this.setOverLayerWidthHeight();this.setBoxPosition();$("#GoalMessage").style.display= "";this.fader=setInterval("Livescore.fade()",1)},fadeOut:function(){this.fadeAction="out";$("#GoalLayer").style.display="none";this.fader=setInterval("Livescore.fade()",1)},fade:function(){if(!$("#GoalMessage")){clearInterval(this.fader);return false}if(this.fadeAction=="in"){$("body")[0].style.overflow="hidden";this.layerOpend=true;$("#GoalLayer").style.display="";clearInterval(this.fader)}else if(this.fadeAction=="out"){$("body")[0].style.overflow="";clearInterval(this.fader);$("#GoalLayer").style.display= "none";$("#GoalMessage").style.display="none";this.layerOpend=false}},init:function(){setInterval("Livescore.startRequest( )",3E4)},startRequest:function(){request=new Ajax({Method:"POST",Url:BASE+"ajax.php",Params:{"do":"livescore",id:Math.floor(Math.random()*99999999999)},OnLoading:function(){$("#RefreshTime").innerHTML='<img src="'+LOADING_IMG+'" style="margin: 0; border: none; padding: 0; float: none;" alt="'+LOADING+'" />'},OnSuccess:function(a){Livescore.handleResponse(a)}});request.doRequest()}, handleResponse:function(a){if(this.showGoalAlert==true&&a.newGoals){$("#GoalCont").innerHTML=a.newGoals;this.fadeIn();this.newGoalTimeout=setTimeout("Livescore.fadeOut()",2E4)}if(a.ranklist)$("#Ranklist").innerHTML=a.ranklist;if(a.livetable)$("#LiveTable").innerHTML=a.livetable;this.handleLiveGames(a.scores.live);this.handleFinishdGames(a.scores.finishd);this.handleNotStartedGames(a.scores.notstarted);$("#RefreshTime").innerHTML=a.time},handleLiveGames:function(a){$("#Live").innerHTML=a},handleFinishdGames:function(a){$("#Finishd").innerHTML= a},setOverLayerWidthHeight:function(){var a=document.body.scrollHeight,b=document.body.scrollWidth,c=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:document.body.clientHeight,d=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:document.body.clientWidth;if(a<c)a=c;if(b<d)b=d;$("#GoalMessage").style.height=a+10+"px";$("#GoalMessage").style.width=b+"px"},setBoxPosition:function(){var a= (window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:document.body.clientHeight)/2+(window.pageYOffset?window.pageYOffset:document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop);$("#GoalLayer").style.top=a+"px"},handleNotStartedGames:function(a){$("#NotStarted").innerHTML=a}};Event.add(window,"load",function(){Livescore.init()});

/**
 * END $Id: class.livescore.compressed.js 33 2010-07-16 21:30:38Z tomtaz $
 */
