// JavaScript Document
/*
$.fn.cycle.defaults.speed   = 900;
$.fn.cycle.defaults.timeout = 6000;

$(function() {
    // run the code in the markup!
    $('pre code').each(function() {
        eval($(this).text());
    });
});
function slideSwitch() {
    var $active = $('#slideshow IMG.active');
    if ( $active.length == 0 ) $active = $('#slideshow IMG:last');
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow IMG:first');
    $active.addClass('last-active');
    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval( "slideSwitch()", 4000 );
});
*/

function swichtap(divname)
{
	$('#'+divname).show();
	$('#'+divname+'_detail').show();
	if(divname!='casino'){	$("#casino").hide();$("#casino_detail").hide();}
	if(divname!='football'){	$("#football").hide();$("#football_detail").hide();}
	if(divname!='slotmachine'){	$("#slotmachine").hide();$("#slotmachine_detail").hide();}
	if(divname!='e_games'){	$("#e_games").hide();$("#e_games_detail").hide();}
}
function loadnews(divname)
{
	var totalnew = $("#totalnews").val();
	var totalnews = eval(totalnew)-1;
	for(var i=1;i<=totalnews;i++)
	{
		if(divname!='n'+i){	$("#n"+i+"_head").hide('slow');document.getElementById('n'+i).className = 'n2';}
	}
	
	$('#'+divname+'_head').show('slow');
	document.getElementById(divname).className = 'n1';
}
function loadnewauto(divname)
{
		$('#n'+divname+'_head').show('slow');
		document.getElementById('n'+divname).className = 'n1';
		/*
		if(divname!='1'){	$("#n1_head").hide('slow');document.getElementById('n1').className = 'n2';}
		if(divname!='2'){	$("#n2_head").hide('slow');document.getElementById('n2').className = 'n2';}
		if(divname!='3'){	$("#n3_head").hide('slow');document.getElementById('n3').className = 'n2';}
		*/
		var totalnew = $("#totalnews").val();
		var totalnews = eval(totalnew)-1;
		for(var i=1;i<=totalnews;i++)
		{
			if(divname!=i){	$("#n"+i+"_head").hide('slow');document.getElementById('n'+i).className = 'n2';}
		}
		var nn = eval(divname)+1;
		if(nn>totalnews){nn = 1;}
		setTimeout('loadnewauto('+nn+')',5000);
}