
top_flag=0;
count_promo = 3;
delay=5000;

$(window).load(function(){
    my_id=setTimeout('promo_show(top_flag+1)',delay);
});

$(document).ready(function(){	

    get_footer();
	$("table.default").each(function(i){ 
  		$(this).find("tr:odd").addClass("bg");
	});

    $("#window td").each(function(i){
        $(this).find("div.one").eq(0).show();
    });

	$("#button_faq input").click(function(){
		$(this).parent("#button_faq").hide();
		$('#hide_form').show("slow");
		return false;
	});
});

$(window).resize(function(){
    get_footer();
});

function get_footer() {
	var height=137;
	var screen_f = $("#footer").height();
    if (screen_f>height) {
        $("#footer").css({"margin-top" : -screen_f + "px"});
        $("#padding_bot").css({"padding-bottom" : 113 + (screen_f-height) + "px"});
    }
}

function promo_show(number) {
        clearTimeout(my_id);
        if (number==count_promo) number=0;
        $("#window td").each(function(i){ 
              $(this).find("div.one").eq(top_flag).fadeOut(100);
            $(this).find("div.one").eq(number).fadeIn(100);
        });
        top_flag=number;
        my_id=setTimeout('promo_show(top_flag+1)',delay);
}
