﻿jQuery(document).ready(function($) {
    $("input[focusthis='true']:last").focus();
    $("div.signinitem[inline!='true'] >label").after("<br/>");
    $(".infotable tr.infocontent:odd").css("background-color", "#FFFED0");
    $(".grouplicenseitem").hover(function() {
        $(this).animate({ backgroundColor: "#ffff00" }, 500).animate({ backgroundColor: "#ffff00" }, 1500).animate({ backgroundColor: "#ffffff" }, 500);
    }, function() {
    });
    $(".clicktest").click(function() {
        if (!$(this).attr("clicked")) {
            $(this).attr("clicked", "true");
            return false;
        }
    });
    $(".cancelclick").click(function() {
        $(this).closest(".clicktest").removeAttr("clicked");
        return false;
    });
    $(".numberedflow .numberedflowitem:not(:last)").after(" &gt; ");

    $(".confirmclick").click(function() {
        var message = $(this).attr("confirmclicktext");
        if (message === undefined)
            message = "Continue?";
        return confirm(message);
    });
});

function evalAuthenticationScript() {
    /*$("#AuthenticationPanel script").each(function(scr) { alert(this.text); });*/
    $("#AuthenticationPanel script").each(function(scr) { eval(this.text); });
    $("#AuthenticationPanel input[focusthis='true']:last").focus();
    $("#AuthenticationPanel div.signinitem >label").after("<br/>");
    $("#AuthenticationPanel .infotable tr.infocontent:odd").css("background-color", "#FFFED0");
    /*
    var div = document.getElementById('AuthenticationPanel');
    var x = div.getElementsByTagName('script');
    alert('found ' + x.length + ' scripts');
    for (var i = 0; i < x.length; i++) {
    eval(x[i].text);
    }
    */
};

/*
* jQuery Disable On Submit Plugin
* http://www.evanbot.com/article/jquery-disable-on-submit-plugin/13
*
* Copyright (c) 2009 Evan Byrne (http://www.evanbot.com)     
*/
jQuery.fn.disableOnSubmit = function(disableList) {

    if (disableList == null) { var $list = 'input[type=submit],input[type=button],input[type=reset],button'; }
    else { var $list = disableList; }

    // Makes sure button is enabled at start
    $(this).find($list).removeAttr('disabled');

    $(this).submit(function() { $(this).find($list).attr('disabled', 'disabled'); });
    return this;
};