function shide(id){
	$("#"+id).slideToggle("slow");
	return false;
}
function hidd(){
		$("#block_img").fadeOut("slow",ch_foto);
	}
function ch_foto(){
   	if(j>dv.length-1) j=0;
   	//(Math.round((Math.random()*(dv.length-1))));
   	document.getElementById('img_1').src=dv[j].src;
   	//j++;
   	//if(j>dv.length-1) j=0;
   	//document.getElementById('img_2').src=dv[j].src;
   	if (shs!=0){
   		$("#block_img").fadeIn("slow");
   	}
  	else shs=1;
   	j++;
   	setTimeout(hidd, 6000);
}
function _ch_day(){
	jQuery.post('ajax.php', {
        "ch_day":$("#ch_day").attr('value')
	},function(data){
		$("#kol_pipl").html(data);
		_ch_sum();
	});
}

function _ch_sum(){
	jQuery.post('ajax.php', {
        "ch_sum":$("#kk_p").attr('value')
	},function(data){
		$("#sum").html(data);
	});
}

function send_mess(i){
	if(i==1){
		if($("#name").attr('value') && $("#email").attr('value') && $("#title").attr('value') && $("#text").attr('value')){
			document.getElementById('cont_form').submit();
		} else { alert('Вы не заполнили обязательные поля!');}
	}
	if(i==2){
		if($("#name2").attr('value') && $("#tel2").attr('value')){
			document.getElementById('reg_kurs').submit();
		} else { alert('Вы не заполнили обязательные поля!');}
	}
	if(i==3){
		if($("#name3").attr('value') && $("#tel3").attr('value')){
			document.getElementById('reg_merop').submit();
		} else { alert('Вы не заполнили обязательные поля!');}
	}
	if(i==4){
		if($("#name4").attr('value') && $("#email4").attr('value') && $("#mme4").attr('value')){
			document.getElementById('main_ff').submit();
		} else { alert('Вы не заполнили обязательные поля!');}
	}
}

$(document).ready(function(){
	$(".accordion2").click(function(){

		$(".menu_lft_bg ul").find("ul:visible").slideUp("slow");
		$(this).next("ul:hidden").slideDown("slow");

		return false;
	});
	
	$("#mkm").change(function(){
		jQuery.post('ajax.php', {
        "kurs":$("#mkm").attr('value')
		},function(data){
			$("#mkm2").html(data);
		});
	});


});


hs.registerOverlay(
    	{
    		thumbnailId: null,
    		overlayId: 'controlbar',
    		position: 'top right',
    		hideOnMouseOut: true
		}
	);
	
    hs.graphicsDir = 'js/highslide/graphics/';
    hs.captionEval = 'this.thumb.alt';
    //hs.captionEval = 'this.thumb.title';
