function showOverlay(){
		//$("div.overlay2").show().height($(document).height());
		$("div.popup2 a.close, a.close").click(function(){
			$("div.popup2").fadeOut();
			$("div.overlay2").hide();
			$("div.overlay2").height('0');
			return false;
		})
	};
$(document).ready(function() {
	

    $('#mycarousel').jcarousel();
	$('#mycarousel li:last').css({'border-right': 'none', 'margin-right': '0px'});
	
	 $('#mycarousel2').jcarousel();
	$('#mycarousel2 li:last').css({'border-right': 'none', 'margin-right': '0px'});
	
	var curUrl = location.href;	
	var curArr = curUrl.split('/');
	if(curArr[3]=='removal_of_trees.php'){
		$('#header').css('background', 'url(/img/header-bg-remove.jpg) no-repeat left top')
	} 
	else if(curArr[3]=='kronirovanie.php'){
		$('#header').css('background', 'url(/img/header-bg-kronirovanie.jpg) no-repeat left top')
	}
	else if(curArr[3]=='treatment_of_trees.php'){
			$('#header').css('background', 'url(/img/header-bg-treatment.jpg) no-repeat left top')
	}
	else if(curArr[3]=='stump_cleaning.php'){
			$('#header').css('background', 'url(/img/header-bg-stump.jpg) no-repeat left top')
	}
	else if(curArr[3]=='decoration.php'){
			$('#header').css('background', 'url(/img/header-bg-decoration.jpg) no-repeat left top')
	};
	
	
	$("a.feed-btn").click(function(){	
		//showOverlay();
		//$("div.feed").fadeIn();
		//return false;
	});	
	//************** Music *****************
	$("#jquery_jplayer").jPlayer({
		ready: function () {
			$("#jquery_jplayer").change('lyube.mp3');
			//$("#jquery_jplayer").play();
		},
		cssPrefix: "different_prefix_example"
	});
	$("#jquery_jplayer").jPlayerId("play", "player_play");
	$("#jquery_jplayer").jPlayerId("pause", "player_pause");
	//************** Music *****************
	
	
});
//*************foto-video*******************/
function getResult(elid,type) {
		$('#foto').html('');
		$('#video').html('');
		$('#comments').html('');
		$('#loading, #loader').css('display','block');
		$('#fotoid').val(elid);
		if(type == 1){
			typename = 'Фото';
		} 
		else if(type == 5){
			typename = 'Видео';
		};
		$('#type').val(typename);
		$.ajax({
			type: "POST",
			//dataType: "json",
			url:  "action.php",
			data: "fotoid="+elid,
			success: function(data) {
			var data = $.evalJSON(data);	
				var html = data.fotoimg;
				var comments = data.comments;
				$('#foto').html(html);							
				$('#comments').html(comments);				
				$('#loading, #loader').css('display','none');
				$("div.overlay2").show().height($(document).height());
			}
		});	
		showOverlay();		
		$("div.feed").fadeIn();
		return false;
	
}

function getResult2(elid,type) {
		$('#foto').html('');
		$('#video').html('');
		$('#comments').html('');
		$('#loading, #loader').css('display','block');
		$('#fotoid').val(elid);
		if(type == 1){
			typename = 'Фото';
		} 
		else if(type == 5){
			typename = 'Видео';
		};
		$('#type').val(typename);
		$.ajax({
			type: "POST",
			//dataType: "json",
			url:  "action-video.php",
			data: "videoid="+elid,
			success: function(data) {
			var data = $.evalJSON(data);	
				var html = data.video;
				var comments = data.comments;
				$('#video').html(html);				
				$('#comments').html(comments);							
				$('#loading, #loader').css('display','none');
				$("div.overlay2").show().height($(document).height());
			}
		});		
		showOverlay();		
		$("div.feed").fadeIn();
		return false;

}	
//************foto-video****************/


 
	

