$().ready(function()
{
	
	$('#s1').cycle({ 
	    fx:    'fade',
	    timeout: 12000,
	    speed: 500,
	    delay: 1000, 
	    pager: '#nav',
	    after: function() {  
        $('#nav').css("z-index", "10"); 
        $('#s1').css("z-index", "5");  
        $('#s1 > div').css("background-color", "transparent"); 
    	} 
	});
	
	$("div.news_text").hover(function() { $(this).children("a").addClass("highlight"); 
										  $(this).prev().prev().children("a").addClass("highlight"); 
										}, function() { $(this).children("a").removeClass("highlight"); 
														$(this).prev().prev().children("a").removeClass("highlight"); 	
	});
	$("div.news_title").hover(function() { $(this).children("a").addClass("highlight"); 
										  $(this).next().next().children("a").addClass("highlight"); 
										}, function() { $(this).children("a").removeClass("highlight"); 
														$(this).next().next().children("a").removeClass("highlight"); 
	});
	$("div.hot_text").hover(function() { $(this).children("a").addClass("highlight"); 
										  $(this).prev().prev().children("a").addClass("highlight"); 
										}, function() { $(this).children("a").removeClass("highlight"); 
														$(this).prev().prev().children("a").removeClass("highlight"); 	
	});
	$("div.hot_title").hover(function() { $(this).children("a").addClass("highlight"); 
										  $(this).next().next().children("a").addClass("highlight"); 
										}, function() { $(this).children("a").removeClass("highlight"); 
														$(this).next().next().children("a").removeClass("highlight"); 
	});
	
	$("div.fsc_bt div").click(function()
	{
		$("div.active").removeClass("active");
		var classname= $(this).attr("class");
		$(this).addClass("active");
		$("div.fscores:visible").hide();
		$("#"+classname).show();
		return false;
	});
	
	$("div.rds1 div.fsc_game:last-child").css("border", "0");
	$("div.rds2 div.fsc_game:last-child").css("border", "0");
	$("div.rds3 div.fsc_game:last-child").css("border", "0");
	$("div.rds4 div.fsc_game:last-child").css("border", "0");
	$("div.rds5 div.fsc_game:last-child").css("border", "0");
	$("div.rds6 div.fsc_game:last-child").css("border", "0");
	
	$("div.tab_bt div").click(function()
	{
		$("div.active1").removeClass("active1");
		var classname= $(this).attr("class");
		$(this).addClass("active1");
		$("div.tab:visible").hide();
		$("#"+classname).show();
		return false;
	});
		
	$('.arrow').bind('click', function(e) {

		e.preventDefault();
		if ($('#toggled-content-' + this.id).hasClass('slide_test')) 
		{	$('.toggled-content').slideUp();
			$('#toggled-content-' + this.id).removeClass('slide_test');
		}
		else {
			$('.toggled-content').slideUp();
			$('.toggled-content').removeClass('slide_test');
			$('#toggled-content-' + this.id).slideDown('slow');
			$('#toggled-content-' + this.id).addClass('slide_test');
		}
		$j = $('#toggled-content-' + this.id);
		$.ajax({
			type: "GET",
			url: "game.php",
			data: "gid="+this.id,
			success: function(msg) {
				$j.css("background", "none");
				$j.html(msg);
			}
			});

		});
	
	
});

$().ready(function()
		{
			$("div#nextKol1").click(function()
			{
				$("#prevKol1").show();
				var id = $("div.rds1:visible").attr("id").substring(7);
				$("div.rds1:visible").hide();
				var m = parseInt(id)+1;
				var nid = "rds1kol" +m;
				$("#"+nid).show();
				if(m>29) $("#nextKol1").hide();
				return false;
			});
			$("div#nextKol2").click(function()
					{
						$("#prevKol2").show();
						var id = $("div.rds2:visible").attr("id").substring(7);
						$("div.rds2:visible").hide();
						var m = parseInt(id)+1;
						var nid = "rds2kol" +m;
						$("#"+nid).show();
						if(m>29) $("#nextKol2").hide();
						return false;
					});
			$("div#nextKol3").click(function()
					{
						$("#prevKol3").show();
						var id = $("div.rds3:visible").attr("id").substring(7);
						$("div.rds3:visible").hide();
						var m = parseInt(id)+1;
						var nid = "rds3kol" +m;
						$("#"+nid).show();
						if(m>29) $("#nextKol3").hide();
						return false;
					});
			$("div#nextKol4").click(function()
					{
						$("#prevKol4").show();
						var id = $("div.rds4:visible").attr("id").substring(7);
						$("div.rds4:visible").hide();
						var m = parseInt(id)+1;
						var nid = "rds4kol" +m;
						$("#"+nid).show();
						if(m>29) $("#nextKol4").hide();
						return false;
					});
			$("div#nextKol5").click(function()
					{
						$("#prevKol5").show();
						var id = $("div.rds5:visible").attr("id").substring(7);
						$("div.rds5:visible").hide();
						var m = parseInt(id)+1;
						var nid = "rds5kol" +m;
						$("#"+nid).show();
						if(m>21) $("#nextKol5").hide();
						return false;
					});
			$("div#nextKol6").click(function()
					{
						$("#prevKol6").show();
						var id = $("div.rds6:visible").attr("id").substring(7);
						$("div.rds6:visible").hide();
						var m = parseInt(id)+1;
						var nid = "rds6kol" +m;
						$("#"+nid).show();
						if(m>17) $("#nextKol6").hide();
						return false;
					});
	
			$("div#prevKol1").click(function()
			{
				$("#nextKol1").show();
				var id = $("div.rds1:visible").attr("id").substring(7);
				var m = parseInt(id)-1;
				$("div.rds1:visible").hide();
				var nid = "rds1kol" +m;
				$("#"+nid).show();
				if(m<2) $("#prevKol1").hide();
				return false;
			});
			$("div#prevKol2").click(function()
					{
						$("#nextKol2").show();
						var id = $("div.rds2:visible").attr("id").substring(7);
						var m = parseInt(id)-1;
						$("div.rds2:visible").hide();
						var nid = "rds2kol" +m;
						$("#"+nid).show();
						if(m<2) $("#prevKol2").hide();
						return false;
					});
			$("div#prevKol3").click(function()
					{
						$("#nextKol3").show();
						var id = $("div.rds3:visible").attr("id").substring(7);
						var m = parseInt(id)-1;
						$("div.rds3:visible").hide();
						var nid = "rds3kol" +m;
						$("#"+nid).show();
						if(m<2) $("#prevKol3").hide();
						return false;
					});
			$("div#prevKol4").click(function()
					{
						$("#nextKol4").show();
						var id = $("div.rds4:visible").attr("id").substring(7);
						var m = parseInt(id)-1;
						$("div.rds4:visible").hide();
						var nid = "rds4kol" +m;
						$("#"+nid).show();
						if(m<2) $("#prevKol4").hide();
						return false;
					});
			$("div#prevKol5").click(function()
					{
						$("#nextKol5").show();
						var id = $("div.rds5:visible").attr("id").substring(7);
						var m = parseInt(id)-1;
						$("div.rds5:visible").hide();
						var nid = "rds5kol" +m;
						$("#"+nid).show();
						if(m<2) $("#prevKol5").hide();
						return false;
					});
			$("div#prevKol6").click(function()
					{
						$("#nextKol6").show();
						var id = $("div.rds6:visible").attr("id").substring(7);
						var m = parseInt(id)-1;
						$("div.rds6:visible").hide();
						var nid = "rds6kol" +m;
						$("#"+nid).show();
						if(m<2) $("#prevKol6").hide();
						return false;
					});
		});




$(function() {
	if($.browser.msie){
	$('div').each(function(i) {
	if($(this).css('position')!='absolute') $(this).css('zIndex', 1000 - (i * 10));
	});
	}
	})
	
					/*
				$("#"+nid + " div").hide();
				$("#"+nid).show('slow');
				
				$("#"+nid + " > div").show("slow", function(){
					$(this).children("div:eq(0)").show("fast", function () {
					    $(this).next("div").show("fast", arguments.callee);
					  });
				});
				*/
