﻿var phone_status_top = 0, phone_status_bottom = 0;
$(document).ready(function () {
    //$(document).pngFix();

    $('#main-menu > li').mouseover(function () {
        if ($(this).hasClass('brd')) { return; }
        $(this).addClass('cur');
        $(this).find('a').css('color', '#fff');
    });
    $('#main-menu > li').mouseout(function () {
        $(this).removeClass('cur');
        $(this).find('a').css('color', '#a2a2a2');
    });

    $('#search-form input.txt').click(function () {
        var e = $(this);
        if (e.val() == e.attr("ev")) {
            e.val('');
        }
    });
    $('#search-form input.txt').blur(function () {
        var e = $(this);
        if (e.val() == '') {
            e.val(e.attr("ev"));
        }
    });

    $('img.thumbnail').imgZoom({ opacity: 0 });

    $('input.mand').each(function () { if ($(this).val() != '') { $(this).removeClass('mand').addClass('c'); } });
    $('input.mand').focus(function () { $(this).addClass('c'); });
    $('input.mand').blur(function () { if ($(this).val() == '') { $(this).removeClass('c'); } });
    $('input.mand').unload(function () { if ($(this).val() == '') { } else { $(this).addClass('c'); } });
    $('input.c').click(function () { $(this).addClass('c'); });
    $('.block ul li').mouseover(function () { $(this).addClass('cur'); });
    $('.block ul li').mouseout(function () { $(this).removeClass('cur'); });
    show();

    $("#aCities.alll").tooltip1({
        delay: 0,
        left: -50,
        showURL: false,
        fade: 200,
        bodyHandler: function () {
            return $(this).attr('tooltipText');
        }
    });

    $(".title-description").tooltip1({
        delay: 0,
        showURL: false,
        fade: 200,
        bodyHandler: function () {
            var titleDescriptionControlId = $(this).attr("title-description");
            if (titleDescriptionControlId) {
                return $("#" + titleDescriptionControlId).html();
            }
        }
    });
});
function show() {
    $("#counters").show();
}
function AddToshow0(addtohref) { var href = "/Comparison/AddToComparison?val=" + addtohref; $.ajax({ type: "POST", url: href, cache: false, success: function (html) { $("#divComparison").html(html); } }); }
function AddToshow(id, addtohref) {
    var href = "/Comparison/AddToComparison?val=" + addtohref;
    $.ajax({
        type: "POST",
        url: href,
        cache: false,
        success: function (html) { $("#divComparison").html(html); }
    });
    
    var href2 = "/Comparison/ChangeComparer?val=" + addtohref;
    $.ajax({
        type: "POST",
        url: href2,
        cache: false,
        success: function (html) {
            $(id).html(html); 
        }
    });
}
function AddToBasket(addtohref) {
    var href = "/Basket/AddToBasket?val=" + addtohref;
    
    $.ajax({
        type: "POST",
        url: href,
        cache: false,
        success: function (html) {
            $("#divBasket").html(html);
        }
    });
}
