﻿ingateFormCheck = function () {
    $("input.clearme").focus(function () {
        if ($(this).attr("title") == $(this).attr("value")) {
            $(this).attr({ "value": "" });
        }
    });
    $("input.clearme").blur(function () {
        if ($(this).attr("value") == "") {
            var defText = $(this).attr("title");
            $(this).attr({ "value": defText });
        }
    });

    $("textarea.clearme").focus(function () {
        if ($(this).attr("title") == $(this).html()) {
            $(this).html("");
        }
    });
    $("textarea.clearme").blur(function () {
        if ($(this).html() == "") {
            var defText = $(this).attr("title");
            $(this).html(defText);
        }
    });
}

startBanner = function () {
    $('.tours').animate({ opacity: 0 }, 1500, function () {
        $('.virt').animate({ opacity: 1 }, 1500, function () {
            $('.virt').animate({ opacity: 0 }, 1500, function () {
                $('.tours').animate({ opacity: 1 }, 1500, function () {

                });
            });
        });
    });

}

$(document).ready(function () {
    ingateFormCheck();
    //$("a[rel=lightbox]").fancybox({ 'zoomSpeedIn': 0, 'zoomSpeedOut': 0, 'overlayShow': true });
    startBanner();
    window.setInterval(startBanner, 6000);

    var gal = null;
    $(function () {
    	//gal = $('.photo_container a').lightBox();
    	//$('#slide_content a').lightBox();
    	//$('#planning a').lightBox();
    });

});



// Добавить в Избранное
function add_favorite(a) {
    title = document.title;
    url = document.location;
    try {
        // Internet Explorer
        window.external.AddFavorite(url, title);
    }
    catch (e) {
        try {
            // Mozilla
            window.sidebar.addPanel(title, url, "");
        }
        catch (e) {
            // Opera
            if (typeof (opera) == "object") {
                a.rel = "sidebar";
                a.title = title;
                a.url = url;
                return true;
            }
            else {
                // Unknown
                alert('Нажмите Ctrl-D чтобы добавить страницу в закладки');
            }
        }
    }
    return false;
}


