var ban_num = 1;
var ban_zindex = 1;

function change_banner()
{	
	ban_num = ban_num + 1;
	if (ban_num > 4)
	{
		ban_num = 1;
	}
	
	ban_zindex = ban_zindex + 1; 	
	banner_actions(ban_num, 1000);
}

function banner_actions(num, fade_time)
{
	$("#bn" + num).hide().css({"z-index":ban_zindex});
	$(".banner .pages a").removeClass("over");
	$("#b"  + num).addClass("over");
	$("#bn" + num).fadeIn(fade_time);
}

function first_load()
{
	$(".banner .pages").show('slow');
	$("#bn1").fadeIn(1000);
	banner_interval = setInterval('change_banner()', 5000);
}
var banner_interval;
$(document).ready(function(){	
	setTimeout('first_load()', 1000);	
	
	$(".banner .pages a").bind("mouseover", function(){		
		clearInterval(banner_interval);		
		if(parseInt($(this).attr('id').substring(1, 2)) != ban_num)
		{	
			ban_num = parseInt($(this).attr('id').substring(1, 2));		
			ban_zindex = ban_zindex + 1;		
			banner_actions(ban_num, 600);
		}
	});
	
	$(".banner").hover(function(){		
		clearInterval(banner_interval);		
	}, function(){
		banner_interval = setInterval('change_banner()', 5000);
	});
	$('#livesupport').bind('click', function(){
		window.open('http://forexhunt.org/livezilla/livezilla.php','','width=590,height=550,left=0,top=0,resizable=yes,menubar=no,location=no,status=yes,scrollbars=yes');
		return false;
	});	
	
	$('#hotl').hover(function(){
		$('.hotline').addClass('active');
	},function(){
		$('.hotline').removeClass('active');
	});
});