function goImage()
{
	
	var b = parseInt(document.getElementById("demo1").style.left.replace(/(\d+)(px)/, "$1")) - 1;
	
	document.getElementById("demo1").style.left = b + "px";
	
	t = setTimeout("goImage()", 50);
}

$(document).ready(function() {	
						   
$("div .dmenu").each(function (){	
	$(this).mouseover(function(){							   
		$("div .dmenu").each(function (){	
			id = $(this).attr("id");
			id_smenu = id.replace(/(dmenu)(\d+)/, "smenu$2");
									   
			if(document.getElementById(id_smenu))
				document.getElementById(id_smenu).style.display = "none";
		});
		
		id = $(this).attr("id");
		id_smenu = id.replace(/(dmenu)(\d+)/, "smenu$2");
							   
		if(document.getElementById(id_smenu))
			document.getElementById(id_smenu).style.display = "block";
	});
});

$("#photo_block").load("/pphoto/", {start:0});

$("#button_block a").each(function (){									
	$(this).click(function(){
		$("#photo_block").load("/pphoto/", {start:$(this).attr('id')});
						   
		$("#button_block a").each(function (){	
			if($(this).attr('class')=="button_ch")
			{
				$(this).removeClass("button_ch");
				$(this).addClass("button");
			}
		});
		
		if($(this).attr('class')=="button")
		{
			$(this).removeClass("button");
			$(this).addClass("button_ch");
		}
	});
});

$("#button_block a").each(function (){
$(this).click(function(){
return false;
});
});

//$('#slider').slider({'direction':'hor', 'viewcount' : '8', 'item_width': '117px',  'padding' : '0px',  'left_top' : '#slide_right',  'right_bottom' : '#slide_left'});

});

