// this file contains all the generic functions used throughout
// the web site.
//
// other "components" that required specialized functions will
// have their own javascript source files.

// this will give us a GLOBAL "IE" and "iWIN" vars....
// these will be true or false to let you know if we're using
// IE and/or we're on Windoze
var IE   = checkBrowser("msie");
var iWIN = checkBrowser("win");
function checkBrowser( b )
{
    var ua = navigator.userAgent.toLowerCase();
    if( ua.indexOf(b) > -1 ) { return true; }
    return false;
}

// reload on resize...
function resize_it() { page.center(); }
////////////////////////////////////////////////////////////

// now we'll begin the custom js for this site
// some global vars
var page         = dojo.byId("page");           page.center      = Object.prototype.center;
var main_body    = dojo.byId("main");           main_body.center = Object.prototype.center;
var loader       = dojo.byId("loader");         //loader.center    = Object.prototype.center;
var messenger    = dojo.byId("messenger");      //messenger.center = Object.prototype.center;
var messenger_bg = dojo.byId("messenger_bg");
var msg_text     = dojo.byId("msg_text");

dojo.addOnLoad(function() {
    dojo.html.setOpacity(messenger_bg, 0.55);       // we want the messenger bg to be 65% opacity
    loading(false);                                 // close the loader
    close_message();                                // close the message
    Nifty("div#logo_header","top");                 // round the corners of the logo header div
});


// funcs

// this will change the classname of the given div/object
// to the classname provided in arg 2
function hilite()
{
    var args = hilite.arguments;
    var obj  = (args[0] && dojo.byId(args[0])) ? dojo.byId(args[0]) : false;
    var cn   = (args[1]) ? args[1] : "";

    // make sure we have something
    if( !obj ) { return; }

    // continue!
    obj.className = cn;
}