﻿jQuery(function() {
    var hovered = false;
    jQuery(".header .nav li").each(function() {
        if (jQuery("li", this).length > 1) {
            jQuery(this).hover(
                function() {
                    jQuery(this).addClass("sub_nav_over");
                    if (hovered === false && jQuery.browser.msie && parseInt(jQuery.browser.version) == 6) {
                        jQuery("a:eq(0)", this).css("background-position", "100% 0%");
                        jQuery("a:eq(0) span", this).css("background-position", "0% 0%");
                        DD_belatedPNG.fixPng(jQuery("a:eq(0)", this).get(0));
                        DD_belatedPNG.fixPng(jQuery("a:eq(0) span", this).get(0));
                        hovered == true;
                    }
                },
                function() {
                    jQuery(this).removeClass("sub_nav_over");
                    if (jQuery.browser.msie && parseInt(jQuery.browser.version) == 6) {
                        jQuery("a:eq(0)", this).css("background-position", "-100% -100%");
                        jQuery("a:eq(0) span", this).css("background-position", "-100% -100%");
                    }
                }
            );
        }
    });
});
jQuery(function() {
    jQuery(".top_pane .search .textbox input").each(function() {
        jQuery(this).data("remtext", jQuery(this).val());
        jQuery(this).focus(function() {
            if (jQuery(this).val() == jQuery(this).data("remtext")) jQuery(this).val("");
        }).blur(function() {
            if (jQuery(this).val() == "") jQuery(this).val(jQuery(this).data("remtext"));
        });
    });
    jQuery("textarea[name='message']").focus(function() {
        if ($(this).val() == 'Введите ваши сообщение..') {
            $(this).val('');
        }
    });
    jQuery("textarea[name='message']").blur(function() {
        if ($(this).val() == '') {
            $(this).val('Введите ваши сообщение..');
        }
    });
    jQuery(".callback_textbox input[name='fullname']").blur(function() {
        if ($(this).val() == '') {
            $(this).val('Полное имя');
        }
    });
    jQuery(".callback_textbox input[name='fullname']").focus(function() {
        if ($(this).val() == 'Полное имя' || $(this).val() == '') {
            $(this).val('');
        }
    });
    jQuery(".callback_textbox input[name='phone']").blur(function() {
        if ($(this).val() == '') {
            $(this).val('Телефон');
        }
    });
    jQuery(".callback_textbox input[name='phone']").focus(function() {
        if ($(this).val() == 'Телефон' || $(this).val() == '') {
            $(this).val('');
        }
    });
    jQuery(".callback_textbox input[name='email']").blur(function() {
        if ($(this).val() == '') {
            $(this).val('Email');
        }
    });
    jQuery(".callback_textbox input[name='email']").focus(function() {
        if ($(this).val() == 'Email' || $(this).val() == '') {
            $(this).val('');
        }
    });
});
$(function() {
    $("input.styled_checkbox:checkbox").checkbox({
        empty: "/assets/images/checkbox/empty.gif"
    });
});
