jQuery(function($){
   $("input.phone").mask("+420 999 999 999");
});

$(document).ready(function() {
    // tooltip
    $("#modules ul li").cluetip({splitTitle: ' | ', positionBy: 'mouse'});

    $("#form-order-id input").focus(function () {
         $(this).css('border','1px solid #ff0000');
    });
    $("#form-order-id input").blur(function () {
         $(this).css('border','1px solid #cccccc');
    });
    $("#form-order-id select").focus(function () {
         $(this).css('border','1px solid #ff0000');
    });
    $("#form-order-id select").blur(function () {
         $(this).css('border','1px solid #cccccc');
    });
    $("#form-order-id textarea").focus(function () {
         $(this).css('border','1px solid #ff0000');
    });
    $("#form-order-id textarea").blur(function () {
         $(this).css('border','1px solid #cccccc');
    });

    var elem_class = window.location.hash.replace('#', '');
    if (elem_class) {
        // FAQ
        $("div." + elem_class).toggle();
        $("span." + elem_class).css('display', 'none');

        // Productpage
        switchEff(elem_class);
    }
    
    $("#functions .func_body:first").css("display", "block");

    $("#ul_functions li").hover(
        function () {
            $(this).addClass("hover");
        },
        function () {
            $(this).removeClass("hover");
        }
    );

	$('#TB_window').addClass("vegas_baby");
	
	$('#helpdesk_form input').focus(function() {
        $(this).val('');
    });
});

function toggleElem(el) {
    $("#ful_"+el).toggle();
}

function hovEff(el) {
    var $curr = $(el);
    $curr.toggleClass("hover");
}

function switchEff(el) {
    if (document.getElementById("fb_"+el)) {
        $("#functions div.func_body").hide();
        $("#fb_"+el).show();
        $("#functions li.ln_item").removeClass("active");
        $(".ln_"+el).addClass("active");
    }
}

