$().ready(function() {
//    $(".labeled").each(function() { this.value = this.title; });
//    $(".labeled").focus(function() { this.style.color = '#000'; if (this.value == this.title) { this.value = ''; }});
//    $(".labeled").blur(function() { if (this.value == '') { this.value = this.title; this.style.color = '#999'; } });
//    $("#password").focus(function() { this.type = 'password'; })
//    $("#password").blur(function() { if (this.value == '' || this.value == this.title) { this.type = 'text'; } })

    $('.gallery a').lightBox({
        imageLoading: '/images/lightbox-ico-loading.gif',
        imageBtnPrev: '/images/lightbox-btn-prev.gif',
        imageBtnNext: '/images/lightbox-btn-next.gif',
        imageBtnClose: '/images/lightbox-btn-close.gif',
        imageBlank: '/images/lightbox-blank.gif',
        txtImage: 'Фотография',
        txtOf: 'из'
        });
    
    jQuery('.gallery').jcarousel({});
    
    $("#tabs").tabs();
       
    $("#navigation").treeview({
        persist: "cookie",
        collapsed: true,
        unique: true
    });
});

var popUpWindow;

function openPopUpWindow(link)
{
    popUpWindow = window.open(link, 'popUpWindow', 'top=50,left=50,menubar=0,toolbar=0,status=0,height=600,width=600,resizable=1');
    popUpWindow.focus();
    return false;
}

function closePopUpWindow(link)
{
    window.opener.focus();
    window.close();
}

function map(lon, lat, text)
{
    var latlng = new google.maps.LatLng(lon, lat);
    var options = { zoom: 16, center: latlng, mapTypeId: google.maps.MapTypeId.ROADMAP };
    var map = new google.maps.Map(document.getElementById('map'), options);
    var marker = new google.maps.Marker({ position: latlng, map: map });
    var infowindow = new google.maps.InfoWindow({ content: text });
    google.maps.event.addListener(marker, 'click', function() { infowindow.open(map, marker); });    
}

//function map(lon, lat, text) {
//  if (GBrowserIsCompatible()) {
//    var map = new GMap2(document.getElementById("map"));
//    map.setCenter(new GLatLng(lon, lat), 15);
//    var marker = new GMarker(new GLatLng(lon, lat));
//    GEvent.addListener(marker, "click", function() {  
//        marker.openInfoWindowHtml(text);  
//    }); 
//    map.addOverlay(marker);
//    map.addControl(new GLargeMapControl());
//  }
//}

