var Browser = {
  Version: function() {
    var version = 999; // we assume a sane browser
    if (navigator.appVersion.indexOf("MSIE") != -1)
      // bah, IE again, lets downgrade version number
      version = parseFloat(navigator.appVersion.split("MSIE")[1]);
    return version;
  }
}

document.observe("dom:loaded", function() {
    if (Browser.Version() <= 7 ) {
        var reqs = $$('div.required label');
        var l;
        for(l=0;l<reqs.length;l++) {
            reqs[l].insert('<font color="#990000">*</font>');
        }
    }
});

var sdsa = {
    checkAvailability: function(url) {
        newwindow = window.open(url, 'Availability', 'height=400, width=400');
        if( window.focus ) {
            newwindow.focus();
        }
    }
}

var html_cache = null;

function doIE5Print() {
    if( !html_cache ) {
        var el = $('toPrint');
        var tag = el.tagName;
        var html = '<'+tag+' border="1">'+el.innerHTML+'</'+tag+'>';
        html_cache = html;
    }

    window.setTimeout(function() {
        $('toPrint_data').setValue(html_cache);
        $('toPrint_form').submit();
    }, 1000);
}

function doPrint() {
    if( Browser.Version() < 7 ) {
        doIE5Print();
    } else {
        window.print();
    }
}

