adminjs.js?1.4.8

                  var $sup = jQuery.noConflict();

$sup(document).ready(function (e) {
    $sup("input[type=checkbox]").tzCheckbox({
        labels: ["Enabled", "Disabled"]
    });
    $sup('.field_help').append('<span class="triangle"></span>');
    $sup(".field_help").hide();
    $sup(".field_help").append('<i>X</i>');
    $sup('.help i').click(function(){
       $sup('.field_help').fadeOut();
    });
    $sup(".Shelp").click(function () {
        $sup(this).next().stop('true','true').fadeToggle()
    });   
    $sup("#one, #two, #three, #four,#six, #five, #eight").hide();
    $sup("#tab_one").click(function () {
        ID = "#" + $sup(this).attr("id");
        $sup(".tab_content").stop(true, true).hide();
        $sup("#one").stop(true, true).fadeIn('fast');
        $sup('.image_size_notice').hide();
        document.cookie = "tab_one"
    });
    $sup("#tab_two").click(function () {
        $sup(".tab_content").stop(true, true).hide();
        $sup("#two").stop(true, true).fadeIn('fast');
        $sup('.image_size_notice').hide();
        document.cookie = "tab_two"
    });
    $sup("#tab_three").click(function () {
        $sup(".tab_content").stop(true, true).hide();
        $sup("#three").stop(true, true).fadeIn('fast');
        $sup('.image_size_notice').hide();
        document.cookie = "tab_three"
    });
    $sup("#tab_four").click(function () {
        $sup(".tab_content").stop(true, true).hide();
        $sup("#four").stop(true, true).fadeIn('fast');
        $sup('.image_size_notice').delay('1000').fadeIn();
        document.cookie = "tab_four"
    });
    $sup("#tab_five").click(function () {
        $sup(".tab_content").stop(true, true).hide();
        $sup("#five").stop(true, true).fadeIn('fast');
        $sup('.image_size_notice').hide();
        document.cookie = "tab_five"
    });
    $sup("#tab_six").click(function () {
        $sup(".tab_content").stop(true, true).hide();
        $sup("#six").stop(true, true).fadeIn('fast');
        $sup('.image_size_notice').hide();
        document.cookie = "tab_six"
    });
    $sup("#tab_seven").click(function () {
        $sup(".tab_content").stop(true, true).hide();
        $sup("#seven").stop(true, true).fadeIn('fast');
        $sup('.image_size_notice').hide();
        document.cookie = "tab_seven"
    });
    $sup("#tab_eight").click(function () {
        $sup(".tab_content").stop(true, true).hide();
        $sup("#eight").stop(true, true).fadeIn('fast');
        $sup('.image_size_notice').hide();
        document.cookie = "tab_eight"
    });
    var t = "";
    var t = document.cookie;
    t = t.split(";")[0];
    if (t == "tab_one") {
        $sup(".tab_content").hide();
        $sup("#one").show();
        $sup("#tab_one").addClass("supernova_current")
    } else if (t == "tab_two") {
        $sup(".tab_content").hide();
        $sup("#two").show();
        $sup("#tab_two").addClass("supernova_current")
    } else if (t == "tab_three") {
        $sup(".tab_content").hide();
        $sup("#three").show();
        $sup("#tab_three").addClass("supernova_current")
    } else if (t == "tab_four") {
        $sup(".tab_content").hide();
        $sup("#four").show();
        $sup('.image_size_notice').fadeIn();
        $sup("#tab_four").addClass("supernova_current")
    } else if (t == "tab_five") {
        $sup(".tab_content").hide();
        $sup("#five").show();
        $sup("#tab_five").addClass("supernova_current")
    } else if (t == "tab_six") {
        $sup(".tab_content").hide();
        $sup("#six").show();
        $sup("#tab_six").addClass("supernova_current")
    } else if (t == "tab_seven") {
        $sup(".tab_content").hide();
        $sup("#seven").show();
        $sup("#tab_seven").addClass("supernova_current")
    } else if (t == "tab_eight") {
        $sup(".tab_content").hide();
        $sup("#eight").show();
        $sup("#tab_eight").addClass("supernova_current")
    } else if (t == "tab_nine") {
        $sup(".tab_content").hide();
        $sup("#nine").show();
        $sup("#tab_nine").addClass("supernova_current")
    } else if (t = "") {
        $sup(".tab_content").hide();
        $sup("#one").show()
    }
    $sup(".supernova_tabs").click(function () {
        $sup("#message").fadeOut();
    });
    $sup(".supernova_tabs").on("click", "li", function () {
        $sup(".supernova_tabs .supernova_current").removeClass("supernova_current");
        $sup(this).addClass("supernova_current")
    });
    $sup("#more_images1").hide();
    $sup("#more_images2").hide();
    $sup(".loader").show();
    $sup(".new-button-primary, .submit").click(function () {
        $sup(".loader").show();
        $sup("saving_settings").show()
    });
    $sup(".supernova_saved").delay(400).fadeOut(500)
});
$sup(window).load(function () {
    $sup(".loader").hide();
    $sup("#supernova_options_page").css({
        display: "block"
    })
});
$sup.fn.tzCheckbox = function (e) {
    e = $sup.extend({
        labels: ["ON", "OFF"]
    }, e);
    return this.each(function () {
        var t = $sup(this),
            n = [];
        if (t.data("on")) {
            n[0] = t.data("on");
            n[1] = t.data("off")
        } else n = e.labels;
        var r = $sup("<span>", {
            "class": "tzCheckBox " + (this.checked ? "checked" : ""),
            html: '<span class="tzCBContent">' + n[this.checked ? 0 : 1] + '</span><span class="tzCBPart"></span>'
        });
        r.insertAfter(t.hide());
        r.click(function () {
            r.toggleClass("checked");
            var e = r.hasClass("checked");
            t.attr("checked", e);
            r.find(".tzCBContent").html(n[e ? 0 : 1])
        });
        t.bind("change", function () {
            r.click()
        })
    })
};
$sup(document).ready(function (e) {
    
    //Handles remove buttons
    $sup('.remove-button').click(function(){
        var Ptd = $sup(this).parent().parent();
        Ptd.find('.supernova_links').val('');
        var imgDiv = Ptd.find('.imgpre_ref');
        if(imgDiv){
            imgDiv.find('img').remove();
        }      
    });
    
    //changes slider image when a different one selected
    $sup('.sup_slider_link').each(function(){     
        var This = $sup(this);
        
        $sup('.sup_slider_link').hover(function(){
        var Slider_link = This.find('.supernova_links');
        var thumb_link  = This.find('.imgpre_loaded');
            
                link = Slider_link.val(); //the input value                                
                if(link.length > 0 ){ //If input has link 
                    if(thumb_link.length > 0 ){
                        thumb_link.attr('src', link);                                                            
                    }else{                        
                         This.find('.imgpre_ref').html('<img class="imgpre_loaded" src="'+link+'" />');
                    }                    
                }else{ //if input doesn't have link
                    This.find('.imgpre_ref').html(' ');
                }
        });
    });
    
    //Handles Let me slected in for popular posts
    $sup(".letmeselect").hide();    
    $sup("#letmeselect").click(function(){$sup(".letmeselect").fadeIn()});$sup(".popular_post_selection span:first-child, .oncomments").click(function(){$sup(".letmeselect").fadeOut()});
    
    //Handles reset Button
    $sup(".reset_button").click(function () {
        if (confirm("Just making sure you didn't hit me by mistake, click ok to reset settings?")) {
            return true;
        } else {
            return false;
        }
    });
    $sup(".new-button-primary").on("click", function (e) {
        ContentWidth = $sup("#content-width").val();
        SidebarWidth = $sup("#sidebar-width").val();
        var t = +ContentWidth + +SidebarWidth;
        Diff = 100 - (+ContentWidth + +SidebarWidth);
        if (t !== 100) {
            $sup(".loader").hide();
            alert("The total of 'Content Width' and 'Sidbar Width' should be 100%, there still a difference of " + Diff + "%. Please adjust values");
            return false
        } else {
            return true
        }
    });
    $sup(".supernova_links").blur(function () {
        var e = $sup(this);
        var t = e.val();
        if (t && !t.match(/^http([s]?):\/\/.*/)) {
            e.val("http://" + t)
        }
    });
    var t;
    setInterval(function () {
        if (t == 0) {
            $sup("#menu_right sup").removeClass("blink");
            t = 1
        } else {
            if (t = 1) {
                $sup("#menu_right sup").addClass("blink");
                t = 0
            }
        }
    }, 500)
});

$sup(document).ready(function () {
    $sup('.scheme_one').each(function () {
        var checkInput = $sup(this).find('input');
        if (checkInput.is('[checked]')) {
            checkInput.parent().find('.checkedyes').show();
        }
    })

    $sup('.sidebar_left, .sidebar_right').click(function () {
        $sup(this).find('#sidebar-pos').attr('checked', 'checked');
    });
    $sup('.scheme_two').click(function () {
        $sup(this).find('input').attr('checked', 'checked');
    });
    $sup('.scheme_color').click(function () {
        $sup(this).next().attr('checked', 'checked');
        $sup(this).next().addClass('checkchecker');
        $sup('.scheme_one').each(function () {
            $sup('.scheme_one').find('.checkedyes').fadeOut();
        })

        if ($sup(this).next().hasClass('checkchecker')) {
            $sup(this).find('.checkedyes').fadeIn();
        } else {
            $sup(this).find('.checkedyes').fadeOut();
        }


    });
    
    $sup('tr label').click(function () {
        var CheckTarget = $sup(this).parent().parent().find('.tzCheckBox');
        var ContentTarget = $sup(this).parent().parent().find('.tzCBContent');
        var InputTarget = $sup(this).parent().parent().find('input');
        if (!CheckTarget)
            return false;
        if (CheckTarget.hasClass('checked')) {
            CheckTarget.removeClass('checked');
            ContentTarget.html('Disabled');
            InputTarget.removeAttr('checked', 'checked');
        } else {
            CheckTarget.addClass('checked');
            ContentTarget.html('Enabled');
            InputTarget.attr('checked', 'checked');
        }
    });
    
    $sup('.supernova_slider-from-page').click(function(){
        $sup('#supernova_admin_form').submit();
    })
    
})

$sup(document).ready(function(){var e;$sup(".supernova-upload-button").click(function(){e=$sup(this).prev("input");tb_show("","media-upload.php?TB_iframe=true");return false});window.old_tb_remove=window.tb_remove;window.tb_remove=function(){window.old_tb_remove();e=null};window.original_send_to_editor=window.send_to_editor;window.send_to_editor=function(t){if(e){fileurl=$sup("img",t).attr("src");$sup(e).val(fileurl);tb_remove()}else{window.original_send_to_editor(t)}}})