var h=0;
var m=0;
$(document).ready(
	function(){
		//nav();
		tr_hover();
		Cufon.replace('.font');
		info();
		plans_tabs();
		setInterval('jump_tab()', 100);
		tmp_show();
	}
	
);

function nav(){
	$('#nav li').hover(
		function(){
			$(this).find("ul").slideDown("fast");
			$(this).find("ul").fadeIn("fast");
			$(this).addClass("active");		
		},
		function(){			
			$(this).find("ul").slideUp("fast");			
			$(this).removeClass("active");
		}
	);	
}

function tr_hover()
{
	$('.table tr').hover(
		function(){$(this).addClass('hover')},
		function(){$(this).removeClass('hover')}
	);
	
	$('.item_1_td').hover(
		function(){$(this).addClass('item_1_hover')},
		function(){$(this).removeClass('item_1_hover')}
	);	
	
	$('.item_1_td').click(
		function(){
			url = $(this).find('a').attr('href');
			location=url;
		}
	);
}

function info()
{
	$('.info').hover(
		function(){
			$('#info').html($(this).attr('rel'));
			$('#info').fadeIn('fast');
			os = $(this).offset();
			$('#info').css('top', (os.top+10)+'px');
			$('#info').css('left', (os.left+10)+'px');
		},
		function(){			
			$('#info').css('display', 'none');	
			$('#info').html('');
		}
	);	
}

function go_table(h1, m1)
{	
	//$('#plans_list').css('height',h+'px');
	//$('#table').css('margin-top', m+'px');	
	//$('#plans_list').animate({height: h1}, "slow");
	$("#table").animate({marginTop: m1}, "slow");
	//m = m1;
}

function jump_tab()
{
	a = $('#table').css('margin-top');
	a = a.replace('px', '');
	if(a!=m)
	{
		//a = a+(m-a)/5;
		//$('#table').css('margin-top', a+'px');	
	}
}

function plans_tabs()
{
	$('.plans_tabs a').click(
		function(){
			$('.active').removeClass('active');	
			$(this).addClass('active');	
		}
	);	
}

function tmp_show()
{
	$('.tmp').hover(
		function(){$(this).addClass('tmp1')},
		function(){$(this).removeClass('tmp1')}
	);
}
