function findPosY(b) { var a = 0; if (b.offsetParent) { while (1) { a += b.offsetTop; if (!b.offsetParent) { break } b = b.offsetParent } } else { if (b.y) { a += b.y } } return a } function findPosX(b) { var a = 0; if (b.offsetParent) { while (1) { a += b.offsetLeft; if (!b.offsetParent) { break } b = b.offsetParent } } else { if (b.x) { a += b.x } } return a } function setNotifications() { $("#shortcut_notifications span").each(function () { if ($(this).attr("rel") != "") { target = $(this).attr("rel"); if ($("#" + target).length > 0) { var a = findPosY(document.getElementById(target)); var b = findPosX(document.getElementById(target)); $(this).css("top", a - 24 + "px"); $(this).css("left", b + 60 + "px") } } }); $("#shortcut_notifications").css("display", "block") } $(function () {
    $.preloadCssImages(); $('input[title!=""]').hint(); $("#wysiwyg").wysiwyg({ css: "css/wysiwyg.css" }); $("#hide_menu").click(function () { $("#left_menu").hide(); $("#show_menu").show(); $("body").addClass("nobg"); $("#content").css("marginLeft", 30); $("#wysiwyg").css("width", "97%"); setNotifications() }); $("#show_menu").click(function () { $("#left_menu").show(); $(this).hide(); $("body").removeClass("nobg"); $("#content").css("marginLeft", 240); $("#wysiwyg").css("width", "97%"); setNotifications() }); $(".sidebar_content").hide(); $("ul.sidemenu li:first-child").addClass("active").show(); $(".block").find(".sidebar_content:first").show(); $("ul.sidemenu li").click(function () { $(".sidebar_content").hide(); $(this).parent().find("li").removeClass("active"); $(this).addClass("active"); $(this).parents(".block").find(".sidebar_content").hide(); var a = $(this).find("a").attr("href"); $(a).show(); return false }); $("ul.sidemenu li:first").click(); $(".alert_warning").click(function () { $(this).fadeOut("fast") }); $(".alert_info").click(function () { $(this).fadeOut("fast") }); $(".alert_success").click(function () { $(this).fadeOut("fast") }); $(".alert_error").click(function () { $(this).fadeOut("fast") });
    $(".media_photos li a[rel=slide]").fancybox({ padding: 0, transitionIn: "elastic", transitionOut: "elastic", titlePosition: "outside", overlayColor: "#333333", overlayOpacity: 0.2 });
    $(".firma_photos a[rel=slide]").fancybox({ padding: 0, transitionIn: "elastic", transitionOut: "elastic", titlePosition: "outside", overlayColor: "#333333", overlayOpacity: 0.2 });
    $(".firma_logo a[rel=slide]").fancybox({ padding: 0, transitionIn: "elastic", transitionOut: "elastic", titlePosition: "outside", overlayColor: "#333333", overlayOpacity: 0.2 });
    $(".firma_urun a[rel=slide]").fancybox({ padding: 0, transitionIn: "elastic", transitionOut: "elastic", titlePosition: "outside", overlayColor: "#333333", overlayOpacity: 0.2 });
    $("#stats_bar").click(function () { $(this).addClass("active"); $("#stats_line").removeClass("active") }); $("#stats_line").click(function () { $(this).addClass("active"); $("#stats_bar").removeClass("active") }); $("table.stats").each(function () { var a; if ($(this).attr("rel")) { a = $(this).attr("rel") } else { a = "bar" } $(this).hide().visualize({ type: a, width: "650px", height: "240px", colors: ["#7EC421", "#9FBAD4"] }).appendTo("#" + a) }); $("#line").hide(); $("#stats_bar").click(function () { $("table.stats").each(function () { $("#bar").show(); $("#line").hide() }) }); $("#stats_line").click(function () { $("table.stats").each(function () { $("#bar").hide(); $("#line").show() }) }); $("#calendar").datepicker({ nextText: "&raquo;", prevText: "&laquo;" }); $("#datepicker").datepicker({ nextText: "&raquo;", prevText: "&laquo;", showAnim: "slideDown" });
    /*
    $(".onecolumn .header span").click(function () {
    if ($(this).parent().parent().children(".content").css("display") == "block") {
    $(this).css("cursor", "s-resize")
    }
    else {
    $(this).css("cursor", "n-resize")
    }
    $(this).parent().parent().children(".content").slideToggle("fast")
    });
    */
    $(".twocolumn .header span").click(function () { if ($(this).parent().parent().children(".content").css("display") == "block") { $(this).css("cursor", "s-resize") } else { $(this).css("cursor", "n-resize") } $(this).parent().parent().children(".content").slideToggle("fast") }); $("#check_all").click(function () { if ($(this).is(":checked")) { $("form#form_data input:checkbox").attr("checked", true) } else { $("form#form_data input:checkbox").attr("checked", false) } }); setNotifications()
});
