$(document).ready(function(){
       $('#cat_menu_content').slideUp();

$('#cat_menu_title').toggle(
function(){
$('#cat_menu_content').slideDown();
},
function(){
$('#cat_menu_content').slideUp();
}
);

$('#cat_map_title').toggle(
function(){
$('#cat_map_content').slideUp();
},
function(){
$('#cat_map_content').slideDown();
}
);


	$('.icons .ic .ccc').toggle(function(){
		$(this).parent('div').children('.small_icons_content').css({display: 'block'});
	},function(){
		$(this).parent('div').children('.small_icons_content').css({display: 'none'});
	});
	$("#menu li .sub1 li .sub1").each(function(i){
		var ps1w = $(this).parent("li").width();
		$(this).css({marginLeft: ps1w+'px'});
    });

//$('#menu li.someclass:last-child').css({width: '199px'});
	
	$("#menu li").hover(function(){
		$(this).children("a").children("i").addClass("hover");
		$(this).children(".sub1").css({visibility: "visible"});
			},function(){
		$(this).children(".sub1").css({visibility: "hidden"});
		$(this).children("a").children("i").removeClass("hover");
	});	


	
	bigphotos (templ, bigphoto_num);
	function bigphotos (templ, bigphoto_num) {
		var bigphoto_rand = Math.floor( Math.random() * (bigphoto_num + 1) );
		$("#bigphoto").attr({src: 'img/photo_t'+templ+'/'+bigphoto_rand+'.jpg'});
	}
	if (monuments != 0) {
		var monuments_num = Math.floor( Math.random() * (monuments + 1) );
		$("#monument")
		.css({background: 'url(img/monument/'+monuments_num+'.jpg) no-repeat bottom left'});
	}
	

	
	/*  sort */
	$("#sort_b").toggle(function(){
		//$("#sort").slideDown();
		$("#sort").css({display: "block"});
	},function(){
		//$("#sort").slideUp();
		$("#sort").css({display: "none"});
	});
	$("a.best1").hover(function(){
		$(this).css({backgroundPosition: "0px -38px"});
			},function(){
		$(this).css({backgroundPosition: "0px 0px"});
	});	
	$(".sel").click(function() {
		$(".opt").css({display: "none"});
		$(this).parent(".select").children(".opt").css({display: "block"});
	});
	$(".sel").toggle(function(){
		$(this).parent(".select").children(".opt").css({display: "block"});
	},function(){
		$(this).parent(".select").children(".opt").css({display: "none"});
	});
	$(".opt p").click(function() {
		$(".opt p").children("input[@type='checkbox']").removeAttr("checked");
		var txt = $(this).text();
		var valx = $(this).children("input[@type='checkbox']").val();
		//alert(valx);
		var path = $(this).parent(".opt").parent(".select").children(".sel");
		path.children("span").text(txt);
		path.children("input").val(valx);
		//alert($(this).parent(".opt").parent(".select").children(".sel").children("input").val());
		$(this).children("input[@type='checkbox']").attr("checked","checked");
$('.opt').css({display: 'none'});
	});
	/* end  sort */
	
	/*u-data*/
	$("#profile-icons li").click(function() {
		var id = $(this).attr("id");
		$("#profile-icons li").removeAttr("class");
		$("div.data").css({display: "none"});
		$(this).addClass("selected");
		$('#'+id+'-data').fadeIn();
	});
	var defdata = $("#profile-icons li").eq('0').attr("id");
	$('#'+defdata+'-data').fadeIn();
	$("#profile-icons li").eq('0').addClass("selected");
	/*end u-data*/
	

function ukazatel_nah (){
	$("#uk_m a").eq('0').addClass("ukazatel_fst");
	$("#uk_m a").eq('1').addClass("ukazatel_scnd");
	$("#menu li").eq('0').css({background: "transparent"});
}
 ukazatel_nah();		
	
	
	/**/
	$("#mycarousel li img").click(function(){
		var src = $(this).attr("src");
		big_def(src);
	});
//	big_def ($("#mycarousel li").eq('0').children("img").attr("src"));
	function big_def (src){
		var myreg = '.thumb_';
		var newsrc = src.replace(myreg, '');
		$(".big img").attr("src", newsrc);
	}
	
});