function initStart() {    labelInput($(".search .input"));    $(".search .submit").closest("form").bind("submit", function() {        var s = $("#search");        if($.trim(s.val()) == "") {            s.val("").focus();            return false;        }    });}function startHome() {    $("#search").focus();}function startCompany() {    var table = $("#table-splits");    prepareTable(table);    var c = ".calculation";    $(c, table).bind("keyup", function() {        var closest = $(this).closest("tr");        var num = this.value;        var ratio = 1/getVal(closest.get(0));        closest.nextAll().each(function() {            $(c, this).val(getRound(num*ratio));            ratio /= parseFloat(getVal(this));        });        ratio = 1;        closest.prevAll().each(function() {            ratio /= parseFloat(getVal(this));            $(c, this).val(getRound(num/ratio));        });    });    $("#disclaimer").html("Information is provided 'as is' and solely for informational purposes.");    function getRound(val) {        if(isNaN(val)) return '-';        return val == val.toFixed(2) ? val : val.toFixed(2);    }    function getVal($obj) {        var val = $obj.className;        if(val.indexOf(' ') > 0) val = val.substr(0, val.indexOf(' '));        return val;    }}function startSearch() {    var table = $("#table-search");    prepareTable(table);}function labelInput($input) {    $input.bind("focus blur change keyup keydown", function(e) {        $(this).prev().toggle( this.value == "" && e.type != "keydown" ); // don't use trim because of password input showing dot when space is typed    }).bind("focus blur", function(e) {        $(this).prev().toggleClass("over", e.type == "focus");    }).each(function() {        $(this).blur();    });}function prepareTable(table) {    if(table[0] && table[0].tBodies.length && table[0].tBodies[0].rows.length) zebraTable(table[0]);}function zebraTable(table) {    $(" > tr:visible", table.tBodies).hover(        function() { $(this).addClass("over"); },        function() { $(this).removeClass("over"); }    )    .removeClass("even odd").filter(":even").addClass("odd")    .end().filter(":odd").addClass("even");}
