/**
 * @author lyykfi
**/

var IE6 = false /*@cc_on || @_jscript_version < 5.7 @*/;
var IE7 = false /*@cc_on || @_jscript_version == 5.7 @*/;
var gteIE7 = false /*@cc_on || @_jscript_version >= 5.7 @*/;
var isMSIE = /*@cc_on!@*/false;
var isOpera=window.opera?1:0;

$(function (){  
    $('.hidden_input_text').focus(function() {
  		if($(this).attr("value") == $(this).attr("alt")) {
  			$(this).attr("value", "")
  		}
	});
	
	$('.hidden_input_text').blur(function() {
  		if($(this).attr("value") == "") {
  			$(this).attr("value", $(this).attr("alt"))
  		}
	});
	
	
	jQuery.extend(jQuery.validator.messages, {
		required: "Это поле необходимо заполнить",
		remote: "Исправьте это поле чтобы продолжить",
		email: "Введите правильный email адрес.",
		url: "Введите верный URL.",
		date: "Введите правильную дату.",
		dateISO: "Введите правильную дату (ISO).",
		number: "Введите число.",
		digits: "Введите только цифры.",
		creditcard: "Введите правильный номер вашей кредитной карты.",
		equalTo: "Повторите ввод значения еще раз.",
		accept: "Пожалуйста, введите значение с правильным расширением.",
		maxlength: jQuery.format("Нельзя вводить более {0} символов."),
		minlength: jQuery.format("Должно быть не менее {0} символов."),
		rangelength: jQuery.format("Введите от {0} до {1} символов."),
		range: jQuery.format("Введите число от {0} до {1}."),
		max: jQuery.format("Введите число меньше или равное {0}."),
		min: jQuery.format("Введите число больше или равное {0}.")
	});
	
	$(".validate").validate();
	
	/*
	$jScroller.add("#news_select .input_box","#news_select .container","left",4, true);
    $jScroller.start();
    */
    
    $("#last_nomer .body table .left_cell .bg1").height($("#last_nomer .body table .left_cell").height()-45);
    
    $("#last_nomer .body table .right_cell .right_cell_body .items .item").hover(
    		function() {
    			if(!$(this).hasClass("current")) {
	    			numer = $(this).attr("numer");
	    			
	    			$("#last_nomer .body table .right_cell .right_cell_body .items .item").removeClass("current");
	    			$(this).addClass("current");
	    			
					$(".news_items").queue(function  () {
						$(this).slideUp();
						if($(this).hasClass(".news_items_"+numer)) {
							$(this).slideDown();
						}
						$(this).dequeue();
					});
				}
    		}, function() {
    		}
    )
    
    $("#topnav ul li.level1").hover(
		function() {
			numer = $(this).attr("numer");
			 jQuery.each($("#topnav ul li ul"), function() {
			 	elem_numer = $(this).attr("numer");
			 	
			 	if(elem_numer != numer) {
			 		$(this).css("display","none");
			 	} else {
			 		$(this).css("display","block");
			 	}
			 });
		}, function() {
		}
    );
});
