		var tr; 
		function OnlineAnim(index,num) {
			var before; var after; var n1; var n2;  

			// hide before
			before=index-1;
			if (before<0) before=num;
			n1="onlinegame"+before;
			dojo.style(n1,"visibility","hidden");
			dojo.style(n1,"opacity","0");

			// hide after
			after=index+1;
			if (after>num) after=0;
         n1="onlinegame"+after;
         dojo.style(n1,"visibility","hidden");
         dojo.style(n1,"opacity","0");

			// show actual
			n1="onlinegame"+index;
			dojo.style(n1,"visibility","visible");
			dojo.style(n1,"opacity","0");
			dojox.fx.fadeTo({ node: n1,			duration: 500,		delay: 0, 			end: 1,		onEnd: t=setTimeout("OnlineAnim("+after+","+num+")", 5000) }).play();
		}

		function TransferStop() {
			clearTimeout(tr);
		}

		function TransferPlay (index,num) {
			
		}
		function TransferAnim(index,num) {
			var before; var after; var n1; var n2;  

			// hide before
			before=index-1;
			if (before<0) before=num;
			n1="tpage"+before;
			dojo.style(n1,"visibility","hidden");
			dojo.style(n1,"opacity","0");

			// hide after
			after=index+1;
			if (after>num) after=0;
         n1="tpage"+after;
         dojo.style(n1,"visibility","hidden");
         dojo.style(n1,"opacity","0");

			// show actual
			n1="tpage"+index;
			dojo.style(n1,"visibility","visible");
			dojo.style(n1,"opacity","0");
			dojox.fx.fadeTo({ node: n1,			duration: 500,		delay: 0, 			end: 1,		onEnd: tr=setTimeout("TransferAnim("+after+","+num+")", 5000) }).play();
		}


		function Anim(index) {
			for (i=1; i<5; i++) { if (i != index) { n = "mnewstext"+i; dojo.style(n,"visibility","hidden"); n = "mnewsbigpic"+i;	dojo.style(n,"visibility","hidden"); n = "mnewsthumb"+i+"over"; dojo.style(n,"visibility","visible");} }
			n="mnewsbigpic"+index;
			dojo.style(n,"visibility","visible");
			n = "mnewsthumb"+index+"over";
			dojo.style(n,"visibility","hidden");
			n = "mnewstext"+index;
			dojo.style(n,"visibility","visible");
			var x = index+1;
			if (x>4) x=1;
			// anim1 = dojox.fx.fadeTo({ node: n,			duration: 300,		delay: 0, 			end: 1,		onEnd: t=setTimeout("Anim("+eval(x)+")", 4000) }).pause();
			anim1 = dojox.fx.fadeTo({ node: n,			duration: 300,		delay: 0, 			end: 1,		onEnd: tmain=setTimeout("Anim("+eval(x)+")", 4000) });
			// currentAnimation = anim1.play();			
		}		

		function doAnim(index,from,currentAnimationmain) {
			clearTimeout(tmain);			
			if (from == 0) currentAnimationmain.stop();
			var anim1;
			if (currentAnimationmain.status() != "playing") { 
				for (i=1; i<5; i++) { if (i != index) { n = "mnewstext"+i; dojo.style(n,"visibility","hidden"); n = "mnewsbigpic"+i;	dojo.style(n,"visibility","hidden"); n = "mnewsthumb"+i+"over"; dojo.style(n,"visibility","visible");} }
				n="mnewsbigpic"+index;
				dojo.style(n,"visibility","visible");
				n = "mnewsthumb"+index+"over";
				dojo.style(n,"visibility","hidden");
				n = "mnewstext"+index;
				dojo.style(n,"visibility","visible");
				var x = index+1;
				if (x>4) x=1;
			} 			
			// if (index>4) index=1;
			// var x = Anim("+eval(index)+");
			// t=setTimeout(x, 3000);
		}

		function showframe(index,from,currentAnimationmain) {
			clearTimeout(tmain);			
			currentAnimationmain.stop();
			var anim1;
				for (i=1; i<5; i++) { if (i != index) { n = "mnewstext"+i; dojo.style(n,"visibility","hidden"); n = "mnewsbigpic"+i;	dojo.style(n,"visibility","hidden"); n = "mnewsthumb"+i+"over"; dojo.style(n,"visibility","visible");} }
				n="mnewsbigpic"+index;
				dojo.style(n,"visibility","visible");
				n = "mnewsthumb"+index+"over";
				dojo.style(n,"visibility","hidden");
				n = "mnewstext"+index;
				dojo.style(n,"visibility","visible");
				var x = index+1;
				if (x>4) x=1;
			// if (index>4) index=1;
			// var x = "Anim("+eval(index)+")";
			// t=setTimeout(x, 3000);
		}


		function CkMseOut(obj){
			var e=window.event||arguments.callee.caller.arguments[0];
			if (zxcCkEventObj(e,obj)){
				clearTimeout(tmain);
				// load();
			}
		}

		function zxcCkEventObj(e,p){
			if (!e) var e=window.event;
			e.cancelBubble=true;
			if (e.stopPropagation) e.stopPropagation();
			if (e.target) eobj=e.target;
			else if (e.srcElement) eobj=e.srcElement;
			if (eobj.nodeType==3) eobj=eobj.parentNode;
			var eobj=(e.relatedTarget)?e.relatedTarget:(e.type=='mouseout')?e.toElement:e.fromElement;
			if (!eobj||eobj==p) return false;
			while (eobj.parentNode) { if (eobj==p) return false; eobj=eobj.parentNode; }
			return true;
		}

      function showgamedetails(i,f,t){
			var n1="game"+i+"bottom";
			var n2="game"+i+"bottomup";
			var n3="game"+i;
			var n4="game"+i+"more";
			dojo.fx.slideTo({ node: n2, left:"0", top:"152", duration: 100, unit:"px" }).play();
			dojo.style(n4,"visibility","visible");			
			dojo.style(n1,"visibility","hidden");			
			dojo.style(n2,"visibility","visible");			
			dojo.style(n3,"height","166px");			

			// hide everybody else
			for (j=f;j<t;j++) {
				if (j!=i) {
					var n1="game"+j+"bottom";
					var n2="game"+j+"bottomup";
					var n3="game"+j;
					n4="game"+j+"more";					
					dojo.style(n4,"visibility","hidden");
					dojo.style(n2,"visibility","hidden");
					dojo.style(n1,"visibility","visible");
					dojo.fx.slideTo({ node: n2, left:"0", top:"50", unit:"px" }).play();
					dojo.style(n3,"height","62px");
				}
			}		
		}

		function hidegamedetails(i,f,t) {
			var n1="game"+i+"bottom";
			var n2="game"+i+"bottomup";
			var n3="game"+i;
			var n4="game"+i+"more";
			dojo.style(n4,"visibility","hidden");			
			dojo.style(n2,"visibility","hidden");			
			dojo.style(n1,"visibility","visible");			
			dojo.fx.slideTo({ node: n2, left:"0", top:"50", unit:"px" }).play();
			dojo.style(n3,"height","62px");
		}

		function showleague(i,f,t) {
			// hide everybody but "i"
			var n1; var n2; var n3; var n4; 
			for (j=1;j<=9;j++) { 
				if (j!=i) { 
					n1="gamecontainer"+j;
					dojo.style(n1,"position","absolute");
					dojo.style(n1,"visibility","hidden");
					n2="league"+j+"title";
					dojo.style(n2,"backgroundImage","url('http://img.hunbasket.webpont.com/art/ferfikosar/musor-league"+j+"off.gif')");
				}
			} 
			// hide all game details
			for (j=1;j<70;j++) {
				if (j<f || j>t) {
					n1="game"+j+"bottom";
					n2="game"+j+"bottomup";
					n3="game"+j;
					n4="game"+j+"more";					
					if (	(testForObject(n1)) && (testForObject(n2)) && (testForObject(n3)) && (testForObject(n4)) ) { 
						dojo.style(n1,"visibility","hidden");
						dojo.style(n2,"visibility","hidden");
						dojo.style(n3,"visibility","hidden");
						dojo.style(n4,"visibility","hidden");
						dojo.fx.slideTo({ node: n2, left:"0", top:"50", unit:"px" }).play();
						dojo.style(n3,"height","62px");
					}
				} else {
					n1="game"+j+"bottom";
					n2="game"+j+"bottomup";
					n3="game"+j;
					n4="game"+j+"more";					
					if (	(testForObject(n1)) && (testForObject(n2)) && (testForObject(n3)) && (testForObject(n4)) ) { 
						dojo.style(n1,"visibility","visible");
						dojo.style(n2,"visibility","hidden");
						dojo.style(n3,"visibility","visible");
						dojo.style(n4,"visibility","hidden");
						dojo.fx.slideTo({ node: n2, left:"0", top:"50", unit:"px" }).play();
						dojo.style(n3,"height","62px");					
					}
				}
			}						
			// show "i"
			n2="gamecontainer"+i;
			dojo.style(n2,"visibility","visible");
			dojo.style(n2,"position","relative");
			n3="league"+i+"title";
			dojo.style(n3,"backgroundImage","url('http://img.hunbasket.webpont.com/art/ferfikosar/musor-league"+i+".gif')");
		}

		function shownb2() {
			dojo.style("nb2","visibility","visible");
			dojo.style("nb1","visibility","hidden");
			showtab('4');
		}

		function shownb1() {
			dojo.style("nb1","visibility","visible");
			// dojo.style("nb2","visibility","hidden");
         dojo.style("endutanpotlas","visibility","hidden");
			showtab('1');
		}

		function showtab(i) {
			// hide everybody but "i"
			var n1; var n2; 
			for (j=1;j<=8;j++) { 
				n1="tleague"+j;
				n2="tl"+j;
				if (j!=i) { 
					dojo.style(n1,"visibility","hidden");					
					dojo.style(n2,"color","#4D4D4D");					
					dojo.style(n2,"backgroundColor","#F7F7F7");					
				} else {
					dojo.style(n1,"visibility","visible");			
					dojo.style(n2,"color","#FFFFFF");							
					dojo.style(n2,"backgroundColor","#004775");					
				}
			} 
		}

		function showrank (league) {
			var n1; var n2; var n3;
			for (i=1;i<=3;i++) {
				n1="rankmiddle"+i+"container";
				n2="rankhun"+i+"s";
				if (i==league) {
					dojo.style(n1,"visibility","visible");
					dojo.style(n2,"backgroundImage","url('http://img.hunbasket.webpont.com/art/ferfikosar/rank-"+i+"on.gif')");
				} else {
					dojo.style(n1,"visibility","hidden");
					dojo.style(n2,"backgroundImage","url('http://img.hunbasket.webpont.com/art/ferfikosar/rank-"+i+"off.gif')");
				}
			}
			n3="rankmiddle1";
			dojo.fx.slideTo({ node: n3, left:"0", top:"0", duration: 300, unit:"px" }).play();
			n3="rankmiddle2";
			dojo.fx.slideTo({ node: n3, left:"0", top:"0", duration: 300, unit:"px" }).play();
			n3="rankmiddle3";
			dojo.fx.slideTo({ node: n3, left:"0", top:"0", duration: 300, unit:"px" }).play();
		}

		function rankpager(league, direction) {
			var n1; var minpos; var maxpos; var coord; var pos; 
			if (league==1) { minpos=1; maxpos=-564; }
			if (league==2) { minpos=1; maxpos=-1410; }
			if (league==3) { minpos=1; maxpos=-1410; }
			n1="rankmiddle"+league;
			cord = dojo.position(n1);
			if (direction==1) {
				// paging right
				pos=cord.x-309-141;
				if (pos>maxpos) { dojo.fx.slideTo({ node: n1, left: pos, top:"0", duration: 100, unit:"px" }).play(); }
			} else {
				// paging left
				pos=cord.x-309+141;
				if (pos<minpos) { dojo.fx.slideTo({ node: n1, left: pos, top:"0", duration: 100, unit:"px" }).play(); }				
			}
		}

		function testForObject(Id, Tag) {
			var o = document.getElementById(Id);
			if (o) { if (Tag) { if (o.tagName.toLowerCase() == Tag.toLowerCase()) { return o; } } else { return o; } }
			return null;
		}

				function galpageleft(act, max) {
					// prepare next page
					var tmp=act-1;
					var nextpage="gal"+tmp;
					var actpage="gal"+act;
					dojo.fadeOut({ node: actpage, duration: 500, onEnd: shownext(nextpage, actpage) }).play();
				}

				function galpageright(act, max) {
					// prepare next page
					var tmp=act+1;
					var nextpage="gal"+tmp;
					var actpage="gal"+act;
					dojo.fadeOut({ node: actpage, duration: 500, onEnd: shownext(nextpage, actpage) }).play();					
				}

				function shownext (nextpage, actpage) {
					dojo.style(nextpage,"opacity","0");
					dojo.style(nextpage,"visibility","visible");
					dojo.fadeIn({ node: nextpage, duration: 500 }).play();
					dojo.style(actpage,"opacity","0");
					dojo.style(actpage,"visibility","hidden");				
				}

		function showutanpotlas() {
			dojo.style("endutanpotlas","visibility","visible");
			dojo.style("nb1","visibility","hidden");
			showtab('4');
		}
