window.onload = window.onresize;
window.onresize = fontSize;

function fontSize()
 {
 	if (document.body.clientWidth < 991)	{
		//$("BODY").css("font-size", '70%');
		$("TD").css("font-size", '60%');
		}
	else	{
		//$("BODY").css("font-size", '90%');
		$("TD").css("font-size", '75%');
		}
 }
 
 function change_bg_tr(id, type)	{
 	if (type == 'in')
		$("#"+id+" TD").css("backgroundColor", "#f2f2f2")
	else
		$("#"+id+" TD").css("backgroundColor", "#fff");
 }
 
function show_block_form_sent_pass() {
	$("#block_form_sent_pass").css("display", "block");
	$("#sphere_form_sent_pass").css("display", "block");
	$("#block_form_authorization").css("display", "none");
	$("#sphere_frame_authorization").css("display", "none");
}

function show_block_form_authorization() {
	$("#block_form_sent_pass").css("display", "none");
	$("#sphere_form_sent_pass").css("display", "none");
	$("#block_form_authorization").css("display", "block");
	$("#sphere_frame_authorization").css("display", "block");
}

function sub_select() {
	flag = 'start';
	count = document.all['nominacion_id'].length
	for (i = 0; i <= count-1; i++) {
		if (flag == 'next') {
			flag = 'end';
			document.all['nominacion_id'][i].selected = true;
			break;
		}
		if (document.all['nominacion_id'].value == 'next' && document.all['nominacion_id'][i].selected == true) flag = 'next';
	}
}

function change_dop_div(id, div)	{
	var div_menu = $("#" + div), 
		div = $("div", div_menu);

		
	if ($("#" + id).attr("class") != "activ")
		{
		for (var i=0; i<div.length; i++ )
			{
			div_id = $(div[i]).attr("id");
			$("#"+div_id).css("display", "none");
			//$("#"+div_id).animate({height: "hide"}, 300);
			
			//$("#div_" + id).css("display", "block");
			}
		$("#div_" + id).animate({height: "show"}, 300);
		}
}

var start_movie=0;
function main_movie()	{
	setTimeout('movie()', 3000);
}

function movie()	{
	if (start_movie<1800)	{
	if (start_movie < 200)
		num=5;
	else if ((start_movie > 200 && start_movie < 250) || (start_movie > 750 && start_movie < 800))
		num=4.5;
	else if ((start_movie > 250 && start_movie < 300) || (start_movie > 700 && start_movie < 750))
		num=4;
	else if ((start_movie > 300 && start_movie < 350) || (start_movie > 650 && start_movie < 700))
		num=3.5;
	else if ((start_movie > 350 && start_movie < 400) || (start_movie > 600 && start_movie < 650))
		num=3;
	else if ((start_movie > 400 && start_movie < 500) || (start_movie > 500 && start_movie < 600))
		num=2;
	else if (start_movie > 800)
		num=6;
	else
		num=1;
		
		step=start_movie+num;
		$("#smith").css("margin-left",  step + "px");
		start_movie=step;
		setTimeout('movie()', 50);
		}
	else
		return false;
}