$(document).ready( function() {
	// Запуск часов;
	showtime();
	// Кнопки;
	$("div.image","#catalog").hover(function() {
        $(this).css("background-position","0% 100%");
    }, function() {
        $(this).css("background-position","0% 0%");
    });
    // FancyBox;
    $("a.fancybox").fancybox();
	// ;
	$("a.preview").each(function() {
        $(this).attr("href",$(this).attr("url"));
    });
	$("a.preview").fancybox({
		ajax: { type: "GET" }
	});
	// Карусель;
	$("#photos").jcarousel();
	// Стрелки для фотографий;
	$("#fancybox-left").hover(function() {
        $(this).css("background-position","0% 50%");
    }, function() {
        $(this).css("background-position","100% 50%");
    });
	$("#fancybox-right").hover(function() {
        $(this).css("background-position","100% 50%");
    }, function() {
        $(this).css("background-position","0% 50%");
    });
    // Списки городов;
    $("div.item","#phone").hover(function() {
        $("div.city-list",$(this)).show();
    }, function() {
        // ;
    });
    $("div.city-list").hover(function() {
        // ;
    }, function() {
        $(this).hide();
    });
});
// Часы;
function showtime() {
    var now = new Date($("#now").html());
    var hours = now.getHours();
    var minutes = now.getMinutes();
    var seconds = now.getSeconds()
    var timeValue = hours;
    timeValue += ((minutes < 10) ? ":0" : ":") + minutes;
    //timeValue += ((seconds < 10) ? ":0" : ":") + seconds;
    now.setSeconds(seconds+1);
    $("span","#time").html(timeValue);
    $("#now").html(now.toUTCString());
    setTimeout("showtime()",1000);
}
