// JavaScript Document
/*jQuery.noConflict();*/
$(document).ready(function() {
	
/* Левое меню */
	$('.aside_nav .top_level_active > li:not(.exp_default)').removeClass('exp').find('ul.inner').hide();
	var i=0;
	
	$('.aside_nav .top_level_active > li.top').click(function()
	{
		
		if($(this).hasClass('exp'))
		{
			i=1;
		}
		else
		{
			i=0;
		}

		
		if (i==0)
		{
			$('.aside_nav .top_level_active > li').removeClass('exp').find('ul.inner').slideUp(500);
			$(this).addClass('exp').find('ul.inner').slideDown(500);
			
		}
		else 
		{
			$('.aside_nav .top_level_active > li').removeClass('exp').find('ul.inner').slideUp(500);
			
		}
		
	});
	
/* слайдеры 
$('#slider-1').serialScroll({
		items:'li',
		prev:'#slider-1_next',
		next:'#slider-1_prev',
		axis:'y',
		duration:700,
		start:1, 
		force:true,
		stop:true,
		lock:false,
		cycle:false,
		jump: true 
});
$('#slider-2').serialScroll({
		items:'li',
		prev:'#slider-2_next',
		next:'#slider-2_prev',
		axis:'x',
		duration:300,
		offset:-390,
		start:2,
		force:true,
		stop:true,
		lock:false,
		cycle: false,
		jump: true 		
});
$('#slider-3').serialScroll({
		items:'li',
		prev:'#slider-3_next',
		next:'#slider-3_prev',
		axis:'x',
		duration:300,
		offset:-480,
		start:4,
		force:true,
		stop:true,
		lock:false,
		cycle: false,
		jump: true 		
});
$('#slider-4').serialScroll({
		items:'li',
		prev:'#slider-4_next',
		next:'#slider-4_prev',
		axis:'y',
		duration:700,
		start:1, 
		force:true,
		stop:true,
		lock:false,
		cycle:false,
		jump: true 
});
/* .add-comment форма */
$('.you-name').focus(
	function () {
		if ($(this).attr('value') == 'Ваше Имя:')
		{
			$(this).attr('value', '');
		}
});
$('.you-name').blur(
	function () {
		if ($(this).attr('value') == '')
		{
			$(this).attr('value', 'Ваше Имя:');
		}
});
$('.you-email').focus(
	function () {
		if ($(this).attr('value') == 'E-mail:')
		{
			$(this).attr('value', '');
		}
});
$('.you-email').blur(
	function () {
		if ($(this).attr('value') == '')
		{
			$(this).attr('value', 'E-mail:');
		}
});
$('.you-comment').focus(
	function () {
		if ($(this).attr('value') == 'Ваш коментарий:')
		{
			$(this).attr('value', '');
		}
});
$('.you-comment').blur(
	function () {
		if ($(this).attr('value') == '')
		{
			$(this).attr('value', 'Ваш коментарий:');
		}
});	
/* форма обратный звонок */
$('.you-name-zvonok').focus(
	function () {
		if ($(this).attr('value') == 'Ваше Имя:')
		{
			$(this).attr('value', '');
		}
});
$('.you-name-zvonok').blur(
	function () {
		if ($(this).attr('value') == '')
		{
			$(this).attr('value', 'Ваше Имя:');
		}
});
$('.number-telefona').focus(
	function () {
		if ($(this).attr('value') == 'Номер телефона:')
		{
			$(this).attr('value', '');
		}
});
$('.number-telefona').blur(
	function () {
		if ($(this).attr('value') == '')
		{
			$(this).attr('value', 'Номер телефона:');
		}
});
/* форма задать вопрос */
$('.you-name-vopros').focus(
	function () {
		if ($(this).attr('value') == 'Ваше Имя:')
		{
			$(this).attr('value', '');
		}
});
$('.you-name-vopros').blur(
	function () {
		if ($(this).attr('value') == '')
		{
			$(this).attr('value', 'Ваше Имя:');
		}
});
$('.you-email-tel').focus(
	function () {
		if ($(this).attr('value') == 'E-mail или Телефон:')
		{
			$(this).attr('value', '');
		}
});
$('.you-email-tel').blur(
	function () {
		if ($(this).attr('value') == '')
		{
			$(this).attr('value', 'E-mail или Телефон:');
		}
});
$('.vash-vopros').focus(
	function () {
		if ($(this).attr('value') == 'Ваш вопрос:')
		{
			$(this).attr('value', '');
		}
});
$('.vash-vopros').blur(
	function () {
		if ($(this).attr('value') == '')
		{
			$(this).attr('value', 'Ваш вопрос:');
		}
});






    $("#phone_callback_submit").click(function(){
	//alert(1);
            var options = {
                    target: "#phone_callback_div",
                    url: "/feedback/phone_callback.php",
                    success: function() {
			//alert(444);
			//alert(2);
                    }
            };
	   // alert(3);
            $("#phone_callback_div").ajaxSubmit(options);
	    alert('Спасибо за Ваше сообщение.');

    });
    

    $("#question_callback_submit").click(function(){
	//alert(11);
            var options = {
                    target: "#question_callback_div",
                    url: "/feedback/question_callback.php",
                    success: function() {
			//alert(444);
			//alert(12);
                    }
            };
	    //alert(13);
            $("#question_callback").ajaxSubmit(options);
	    //alert(14);
	    alert('Спасибо за Ваш вопрос.');

    });
    









});
