function check_submit_form()
{
	if($('#fio').val() == '')
	{
		alert("Введите Контактное лицо!");
		$('#fio').focus();
		return false;
	}
	if($('#phone').val() == '')
	{
		alert("Введите Телефон!");
		$('#phone').focus();
		return false;
	}
	var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
	if($('#email').val() == '' || reg.test($('#email').val()) == false)
	{
		alert("Введите Е-mail!");
		$('#email').focus();
		return false;
	}
	if($('#adres').val() == '')
	{
		alert("Введите Адрес доставки!");
		$('#adres').focus();
		return false;
	}
	return true;
}
function check_review_form()
{
	if($('#rating').val() == 0)
	{
		alert("Выберите оценку!");
		return false;
	}
	if($('#display_name').val() == '')
	{
		alert("Введите Контактное лицо!");
		$('#display_name').focus();
		return false;
	}
	var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
	if($('#email').val() == '' || reg.test($('#email').val()) == false)
	{
		alert("Введите Е-mail!");
		$('#email').focus();
		return false;
	}
	if($('#head').val() == '')
	{
		alert("Введите Заголовок!");
		$('#head').focus();
		return false;
	}
	if($('#body').val() == '')
	{
		alert("Введите Описание!");
		$('#body').focus();
		return false;
	}
	return true;
}
function formatText(index, panel)
{
	return index + "";
}
function ShowBann (path, w, h)
{
	window.open(path,'ShowBann','width='+w+',height='+h+',status=no,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes,top='+ Math.round((screen.height/2)-(h/2)) +',left=' + Math.round((screen.width/2)-(w/2)));
}
$(document).ready(function(){

	$("ul.tabs").tabs("div.panes > div");
	$("ul.tabs_price").tabs("div.panes_price > div");
	
	

	function addNav()
	{
		$(this).addClass('mfNavTopHover');
		$(this).children('li.topLevel a').css({'color':'#006699', 'padding-top':'0px'});
		$(this).children('div.mfNavInnerWrap').slideDown(150);
	};

	function hideNav()
	{
		$(this).removeClass('mfNavTopHover');
		$(this).children('li.topLevel a').css({'color':'#fff', 'padding-top':'0'});
		$(this).children('a.mfNavNoChange').css({'color': '#da0011'});
		$(this).children('div.mfNavInnerWrap').hide();
	};

	var mfNav =
	{
		interval: 100,
		sensitivity: 4,
		over: addNav,
		timeout: 175,
		out: hideNav
	};

	$('#mfTopNav li.topLevel').hoverIntent(mfNav);

	if($('.anythingSlider').length)
	{
		$('.anythingSlider').anythingSlider({
			easing: "easeInOutExpo",			// Anything other than "linear" or "swing" requires the easing plugin
			autoPlay: false,						// This turns off the entire FUNCTIONALY, not just if it starts running or not.
			delay: 3000,						// How long between slide transitions in AutoPlay mode
			startStopped: false,				// If autoPlay is on, this can force it to start stopped
			animationTime: 600,					// How long the slide transition takes
			hashTags: true,						// Should links change the hashtag in the URL?
			buildNavigation: true,				// If true, builds and list of anchor links to link to each slide
			pauseOnHover: true,					// If true, and autoPlay is enabled, the show will pause on hover
			startText: "Go",					// Start text
			stopText: "Stop",					// Stop text
			navigationFormatter: formatText     // Details at the top of the file on this use (advanced use)
		});

		$('#slide-jump').click(function(){
			$('.anythingSlider').anythingSlider(6);
		});
	}

	if($('#galleria').length)
	{
		$('#galleria').galleria({
			image_crop: true,
			autoplay: 10000,
			height:424
		});
	}

	$(".input-field input").blur(
		function() {
			$("label[for='" + $(this).attr('id') + "']").css("textIndent", ((($(this). val($.trim($(this).val())).val() == '') || ($(this).val($.trim($(this).val())).val() == -1)) ? "0px" : "-9999px"));
		}
	).focus(
		function() {
			$("label[for='" + $(this). attr('id') + "']").css("textIndent", "-9999px");
		}
	).trigger("blur");
});
