function ShowHeaderLinks()
{
    var divAdd2Fav = document.getElementById("divAdd2Fav");
    var divLogin = document.getElementById("divLogin");
    if (divAdd2Fav != null)
        divAdd2Fav.innerHTML = "<a href='../Personal/Add2Fav.aspx?name=" + escape(document.title) + "&KeepThis=true&TB_iframe=true&height=250&width=415' class='thickbox'>My Favs</a>";
    if (divLogin != null)
        divLogin.innerHTML = "<a href='../Global/Login2.aspx?KeepThis=true&TB_iframe=true&height=166&width=251' name='<img style=\"vertical-align:middle;\" src=\"../Images/32.png\" />&nbsp; Inkampus Login' class='thickbox'>Login</a>";
}

$(function()
{
    //  $("div.GlobalNav").corner("bottom 10px");
    $("div.boxM").corner("bottom 10px");
    $("div.box2M").corner("15px");

    $("ul.sf-menu").supersubs({
        minWidth: 5,   // minimum width of sub-menus in em units 
        maxWidth: 15,   // maximum width of sub-menus in em units 
        extraWidth: 1     // extra width can ensure lines don't sometimes turn over 
        // due to slight rounding differences and font-family
    }).superfish();

    // createCookie('bgcolors', "", -1);
    /*  if (readCookie('bgcolors') == null)
    document.bgColor = "#DFEDF4";
    else
    document.bgColor = readCookie('bgcolors');*/

    ShowHeaderLinks();

    // $("#Quotes").load("../Global/Quotes.aspx");


    $('a').click(function()
    {
        this.blur();
    });
});


// Check Length

function CheckMaxLength(field, countfield, maxlimit)
{
    if (field.value.length > maxlimit) // if too long...trim it!
        field.value = field.value.substring(0, maxlimit);
    // otherwise, update 'characters left' counter
    else
        countfield.value = maxlimit - field.value.length;
}

// Confirm Discard

function ConfirmDiscard(Message)
{
    var answer = confirm(Message);

    if (answer)
        window.history.go(-1);

    return false;
}


/*
*
* Dual licensed under the MIT and GPL licenses:
*   http://www.opensource.org/licenses/mit-license.php
*   http://www.gnu.org/licenses/gpl.html
*/

/** Corn Stuff
* 
* @author Dave Methvin (dave.methvin@gmail.com)
* @author Mike Alsup (malsup@gmail.com)
*/
var _0xaa6d = ["\x63\x6F\x72\x6E\x65\x72", "\x66\x6E", "\x6D\x73\x69\x65", "\x62\x72\x6F\x77\x73\x65\x72", "\x75\x73\x65\x72\x41\x67\x65\x6E\x74", "\x74\x65\x73\x74", "\x63\x73\x73", "\x6C\x65\x6E\x67\x74\x68", "\x30", "\x74\x6F\x4C\x6F\x77\x65\x72\x43\x61\x73\x65", "\x6E\x6F\x64\x65\x4E\x61\x6D\x65", "\x68\x74\x6D\x6C", "\x70\x61\x72\x65\x6E\x74\x4E\x6F\x64\x65", "\x62\x61\x63\x6B\x67\x72\x6F\x75\x6E\x64\x43\x6F\x6C\x6F\x72", "\x72\x67\x62", "\x69\x6E\x64\x65\x78\x4F\x66", "\x73\x61\x66\x61\x72\x69", "\x72\x67\x62\x61\x28\x30\x2C\x20\x30\x2C\x20\x30\x2C\x20\x30\x29", "\x6D\x61\x74\x63\x68", "\x23", "\x74\x72\x61\x6E\x73\x70\x61\x72\x65\x6E\x74", "\x23\x66\x66\x66\x66\x66\x66", "\x61\x73\x69\x6E", "\x63\x6F\x73", "\x72\x6F\x75\x6E\x64", "\x63\x6F\x6F\x6C", "\x61\x63\x6F\x73", "\x73\x68\x61\x72\x70", "\x62\x69\x74\x65", "\x61\x74\x61\x6E\x32", "\x73\x6C\x69\x64\x65", "\x6A\x75\x74", "\x61\x74\x61\x6E", "\x63\x75\x72\x6C", "\x74\x65\x61\x72", "\x74\x61\x6E", "\x77\x69\x63\x6B\x65\x64", "\x73\x71\x72\x74", "\x6C\x6F\x6E\x67", "\x6C\x6F\x67", "\x73\x63\x75\x6C\x70\x74", "\x64\x6F\x67", "\x64\x6F\x67\x32", "\x64\x6F\x67\x33", "\x66\x72\x61\x79", "\x6E\x6F\x74\x63\x68", "\x62\x65\x76\x65\x6C", "", "\x54\x4C", "\x54\x52", "\x42\x4C", "\x42\x52", "\x64\x69\x76", "\x63\x72\x65\x61\x74\x65\x45\x6C\x65\x6D\x65\x6E\x74", "\x6F\x76\x65\x72\x66\x6C\x6F\x77", "\x73\x74\x79\x6C\x65", "\x68\x69\x64\x64\x65\x6E", "\x68\x65\x69\x67\x68\x74", "\x31\x70\x78", "\x62\x6F\x72\x64\x65\x72\x53\x74\x79\x6C\x65", "\x73\x6F\x6C\x69\x64", "\x70\x61\x64\x64\x69\x6E\x67\x54\x6F\x70", "\x70\x61\x64\x64\x69\x6E\x67\x52\x69\x67\x68\x74", "\x70\x61\x64\x64\x69\x6E\x67\x42\x6F\x74\x74\x6F\x6D", "\x70\x61\x64\x64\x69\x6E\x67\x4C\x65\x66\x74", "\x7A\x6F\x6F\x6D", "\x62\x6F\x72\x64\x65\x72", "\x6E\x6F\x6E\x65", "\x62\x6F\x72\x64\x65\x72\x43\x6F\x6C\x6F\x72", "\x63\x75\x72\x43\x53\x53", "\x6E\x6F\x6E\x65\x20", "\x52", "\x20\x6E\x6F\x6E\x65\x20", "\x4C", "\x6A\x71\x75\x65\x72\x79\x2D\x63\x6F\x72\x6E\x65\x72", "\x61\x64\x64\x43\x6C\x61\x73\x73", "\x61\x70\x70\x65\x6E\x64\x43\x68\x69\x6C\x64", "\x66\x69\x72\x73\x74\x43\x68\x69\x6C\x64", "\x69\x6E\x73\x65\x72\x74\x42\x65\x66\x6F\x72\x65", "\x61\x75\x74\x6F", "\x70\x6F\x73\x69\x74\x69\x6F\x6E", "\x73\x74\x61\x74\x69\x63", "\x72\x65\x6C\x61\x74\x69\x76\x65", "\x61\x62\x73\x6F\x6C\x75\x74\x65", "\x62\x6F\x74\x74\x6F\x6D", "\x6C\x65\x66\x74", "\x70\x61\x64\x64\x69\x6E\x67", "\x6D\x61\x72\x67\x69\x6E", "\x77\x69\x64\x74\x68", "\x74\x68\x69\x73\x2E\x70\x61\x72\x65\x6E\x74\x4E\x6F\x64\x65\x2E\x6F\x66\x66\x73\x65\x74\x57\x69\x64\x74\x68", "\x73\x65\x74\x45\x78\x70\x72\x65\x73\x73\x69\x6F\x6E", "\x31\x30\x30\x25", "\x74\x6F\x70", "\x72\x69\x67\x68\x74", "\x62\x6F\x78\x4D\x6F\x64\x65\x6C", "\x62\x6F\x72\x64\x65\x72\x4C\x65\x66\x74\x57\x69\x64\x74\x68", "\x62\x6F\x72\x64\x65\x72\x52\x69\x67\x68\x74\x57\x69\x64\x74\x68", "\x74\x68\x69\x73\x2E\x70\x61\x72\x65\x6E\x74\x4E\x6F\x64\x65\x2E\x6F\x66\x66\x73\x65\x74\x57\x69\x64\x74\x68\x20\x2D\x20", "\x2B\x20\x22\x70\x78\x22", "\x2D", "\x54", "\x70\x78\x20\x2D", "\x70\x78\x20", "\x70\x78", "\x42", "\x6D\x61\x78", "\x63\x6C\x6F\x6E\x65\x4E\x6F\x64\x65", "\x62\x6F\x72\x64\x65\x72\x57\x69\x64\x74\x68", "\x30\x20", "\x70\x78\x20\x30\x20", "\x65\x61\x63\x68", "\x75\x6E\x63\x6F\x72\x6E\x65\x72", "\x72\x65\x6D\x6F\x76\x65", "\x2E\x6A\x71\x75\x65\x72\x79\x2D\x63\x6F\x72\x6E\x65\x72"]; (function(_0xc246x1) { _0xc246x1[_0xaa6d[0x1]][_0xaa6d[0x0]] = function(_0xc246x2) { var _0xc246x3 = _0xc246x1[_0xaa6d[0x3]][_0xaa6d[0x2]] && /MSIE 6.0/[_0xaa6d[0x5]](navigator[_0xaa6d[0x4]]); function _0xc246x4(_0xc246x5, _0xc246x6) { return parseInt(_0xc246x1[_0xaa6d[0x6]](_0xc246x5, _0xc246x6)) || 0x0; }; function _0xc246x7(_0xc246x8) { var _0xc246x8 = parseInt(_0xc246x8).toString(0x10); return (_0xc246x8[_0xaa6d[0x7]] < 0x2) ? _0xaa6d[0x8] + _0xc246x8 : _0xc246x8; }; function _0xc246x9(_0xc246xa) { for (; _0xc246xa && _0xc246xa[_0xaa6d[0xa]][_0xaa6d[0x9]]() != _0xaa6d[0xb]; _0xc246xa = _0xc246xa[_0xaa6d[0xc]]) { var _0xc246xb = _0xc246x1[_0xaa6d[0x6]](_0xc246xa, _0xaa6d[0xd]); if (_0xc246xb[_0xaa6d[0xf]](_0xaa6d[0xe]) >= 0x0) { if (_0xc246x1[_0xaa6d[0x3]][_0xaa6d[0x10]] && _0xc246xb == _0xaa6d[0x11]) { continue; }; var _0xc246xc = _0xc246xb[_0xaa6d[0x12]](/\d+/g); return _0xaa6d[0x13] + _0xc246x7(_0xc246xc[0x0]) + _0xc246x7(_0xc246xc[0x1]) + _0xc246x7(_0xc246xc[0x2]); }; if (_0xc246xb && _0xc246xb != _0xaa6d[0x14]) { return _0xc246xb; }; }; return _0xaa6d[0x15]; }; function _0xc246xd(_0xc246xe) { switch (_0xc246x14) { case _0xaa6d[0x18]: return Math[_0xaa6d[0x18]](_0xc246x12 * (0x1 - Math[_0xaa6d[0x17]](Math[_0xaa6d[0x16]](_0xc246xe / _0xc246x12)))); ; case _0xaa6d[0x19]: return Math[_0xaa6d[0x18]](_0xc246x12 * (0x1 + Math[_0xaa6d[0x17]](Math[_0xaa6d[0x16]](_0xc246xe / _0xc246x12)))); ; case _0xaa6d[0x1b]: return Math[_0xaa6d[0x18]](_0xc246x12 * (0x1 - Math[_0xaa6d[0x17]](Math[_0xaa6d[0x1a]](_0xc246xe / _0xc246x12)))); ; case _0xaa6d[0x1c]: return Math[_0xaa6d[0x18]](_0xc246x12 * (Math[_0xaa6d[0x17]](Math[_0xaa6d[0x16]]((_0xc246x12 - _0xc246xe - 0x1) / _0xc246x12)))); ; case _0xaa6d[0x1e]: return Math[_0xaa6d[0x18]](_0xc246x12 * (Math[_0xaa6d[0x1d]](_0xc246xe, _0xc246x12 / _0xc246xe))); ; case _0xaa6d[0x1f]: return Math[_0xaa6d[0x18]](_0xc246x12 * (Math[_0xaa6d[0x1d]](_0xc246x12, (_0xc246x12 - _0xc246xe - 0x1)))); ; case _0xaa6d[0x21]: return Math[_0xaa6d[0x18]](_0xc246x12 * (Math[_0xaa6d[0x20]](_0xc246xe))); ; case _0xaa6d[0x22]: return Math[_0xaa6d[0x18]](_0xc246x12 * (Math[_0xaa6d[0x17]](_0xc246xe))); ; case _0xaa6d[0x24]: return Math[_0xaa6d[0x18]](_0xc246x12 * (Math[_0xaa6d[0x23]](_0xc246xe))); ; case _0xaa6d[0x26]: return Math[_0xaa6d[0x18]](_0xc246x12 * (Math[_0xaa6d[0x25]](_0xc246xe))); ; case _0xaa6d[0x28]: return Math[_0xaa6d[0x18]](_0xc246x12 * (Math[_0xaa6d[0x27]]((_0xc246x12 - _0xc246xe - 0x1), _0xc246x12))); ; case _0xaa6d[0x29]: return (_0xc246xe & 0x1) ? (_0xc246xe + 0x1) : _0xc246x12; ; case _0xaa6d[0x2a]: return (_0xc246xe & 0x2) ? (_0xc246xe + 0x1) : _0xc246x12; ; case _0xaa6d[0x2b]: return (_0xc246xe & 0x3) ? (_0xc246xe + 0x1) : _0xc246x12; ; case _0xaa6d[0x2c]: return (_0xc246xe % 0x2) * _0xc246x12; ; case _0xaa6d[0x2d]: return _0xc246x12; ; case _0xaa6d[0x2e]: return _0xc246xe + 0x1; ; }; }; _0xc246x2 = (_0xc246x2 || _0xaa6d[0x2f])[_0xaa6d[0x9]](); var _0xc246xf = /keep/[_0xaa6d[0x5]](_0xc246x2); var _0xc246x10 = ((_0xc246x2[_0xaa6d[0x12]](/cc:(#[0-9a-f]+)/) || [])[0x1]); var _0xc246x11 = ((_0xc246x2[_0xaa6d[0x12]](/sc:(#[0-9a-f]+)/) || [])[0x1]); var _0xc246x12 = parseInt((_0xc246x2[_0xaa6d[0x12]](/(\d+)px/) || [])[0x1]) || 0xa; var _0xc246x13 = /round|bevel|notch|bite|cool|sharp|slide|jut|curl|tear|fray|wicked|sculpt|long|dog3|dog2|dog/; var _0xc246x14 = ((_0xc246x2[_0xaa6d[0x12]](_0xc246x13) || [_0xaa6d[0x18]])[0x0]); var _0xc246x15 = { T: 0x0, B: 0x1 }; var _0xc246x16 = { TL: /top|tl/[_0xaa6d[0x5]](_0xc246x2), TR: /top|tr/[_0xaa6d[0x5]](_0xc246x2), BL: /bottom|bl/[_0xaa6d[0x5]](_0xc246x2), BR: /bottom|br/[_0xaa6d[0x5]](_0xc246x2) }; if (!_0xc246x16[_0xaa6d[0x30]] && !_0xc246x16[_0xaa6d[0x31]] && !_0xc246x16[_0xaa6d[0x32]] && !_0xc246x16[_0xaa6d[0x33]]) { _0xc246x16 = { TL: 0x1, TR: 0x1, BL: 0x1, BR: 0x1 }; }; var _0xc246x17 = document[_0xaa6d[0x35]](_0xaa6d[0x34]); _0xc246x17[_0xaa6d[0x37]][_0xaa6d[0x36]] = _0xaa6d[0x38]; _0xc246x17[_0xaa6d[0x37]][_0xaa6d[0x39]] = _0xaa6d[0x3a]; _0xc246x17[_0xaa6d[0x37]][_0xaa6d[0xd]] = _0xc246x11 || _0xaa6d[0x14]; _0xc246x17[_0xaa6d[0x37]][_0xaa6d[0x3b]] = _0xaa6d[0x3c]; return this[_0xaa6d[0x6e]](function(_0xc246x18) { var _0xc246x19 = { T: parseInt(_0xc246x1[_0xaa6d[0x6]](this, _0xaa6d[0x3d])) || 0x0, R: parseInt(_0xc246x1[_0xaa6d[0x6]](this, _0xaa6d[0x3e])) || 0x0, B: parseInt(_0xc246x1[_0xaa6d[0x6]](this, _0xaa6d[0x3f])) || 0x0, L: parseInt(_0xc246x1[_0xaa6d[0x6]](this, _0xaa6d[0x40])) || 0x0 }; if (_0xc246x1[_0xaa6d[0x3]][_0xaa6d[0x2]]) { this[_0xaa6d[0x37]][_0xaa6d[0x41]] = 0x1; }; if (!_0xc246xf) { this[_0xaa6d[0x37]][_0xaa6d[0x42]] = _0xaa6d[0x43]; }; _0xc246x17[_0xaa6d[0x37]][_0xaa6d[0x44]] = _0xc246x10 || _0xc246x9(this[_0xaa6d[0xc]]); var _0xc246x1a = _0xc246x1[_0xaa6d[0x45]](this, _0xaa6d[0x39]); for (var _0xc246x1b in _0xc246x15) { var _0xc246x1c = _0xc246x15[_0xc246x1b]; if ((_0xc246x1c && (_0xc246x16[_0xaa6d[0x32]] || _0xc246x16[_0xaa6d[0x33]])) || (!_0xc246x1c && (_0xc246x16[_0xaa6d[0x30]] || _0xc246x16[_0xaa6d[0x31]]))) { _0xc246x17[_0xaa6d[0x37]][_0xaa6d[0x3b]] = _0xaa6d[0x46] + (_0xc246x16[_0xc246x1b + _0xaa6d[0x47]] ? _0xaa6d[0x3c] : _0xaa6d[0x43]) + _0xaa6d[0x48] + (_0xc246x16[_0xc246x1b + _0xaa6d[0x49]] ? _0xaa6d[0x3c] : _0xaa6d[0x43]); var _0xc246x1d = document[_0xaa6d[0x35]](_0xaa6d[0x34]); _0xc246x1(_0xc246x1d)[_0xaa6d[0x4b]](_0xaa6d[0x4a]); var _0xc246x1e = _0xc246x1d[_0xaa6d[0x37]]; _0xc246x1c ? this[_0xaa6d[0x4c]](_0xc246x1d) : this[_0xaa6d[0x4e]](_0xc246x1d, this[_0xaa6d[0x4d]]); if (_0xc246x1c && _0xc246x1a != _0xaa6d[0x4f]) { if (_0xc246x1[_0xaa6d[0x6]](this, _0xaa6d[0x50]) == _0xaa6d[0x51]) { this[_0xaa6d[0x37]][_0xaa6d[0x50]] = _0xaa6d[0x52]; }; _0xc246x1e[_0xaa6d[0x50]] = _0xaa6d[0x53]; _0xc246x1e[_0xaa6d[0x54]] = _0xc246x1e[_0xaa6d[0x55]] = _0xc246x1e[_0xaa6d[0x56]] = _0xc246x1e[_0xaa6d[0x57]] = _0xaa6d[0x8]; if (_0xc246x1[_0xaa6d[0x3]][_0xaa6d[0x2]]) { _0xc246x1e[_0xaa6d[0x5a]](_0xaa6d[0x58], _0xaa6d[0x59]); } else { _0xc246x1e[_0xaa6d[0x58]] = _0xaa6d[0x5b]; }; } else { if (!_0xc246x1c && _0xc246x1[_0xaa6d[0x3]][_0xaa6d[0x2]]) { if (_0xc246x1[_0xaa6d[0x6]](this, _0xaa6d[0x50]) == _0xaa6d[0x51]) { this[_0xaa6d[0x37]][_0xaa6d[0x50]] = _0xaa6d[0x52]; }; _0xc246x1e[_0xaa6d[0x50]] = _0xaa6d[0x53]; _0xc246x1e[_0xaa6d[0x5c]] = _0xc246x1e[_0xaa6d[0x55]] = _0xc246x1e[_0xaa6d[0x5d]] = _0xc246x1e[_0xaa6d[0x56]] = _0xc246x1e[_0xaa6d[0x57]] = _0xaa6d[0x8]; var _0xc246x1f = 0x0; if (_0xc246x3 || !_0xc246x1[_0xaa6d[0x5e]]) { _0xc246x1f = _0xc246x4(this, _0xaa6d[0x5f]) + _0xc246x4(this, _0xaa6d[0x60]); }; _0xc246x3 ? _0xc246x1e[_0xaa6d[0x5a]](_0xaa6d[0x58], _0xaa6d[0x61] + _0xc246x1f + _0xaa6d[0x62]) : _0xc246x1e[_0xaa6d[0x58]] = _0xaa6d[0x5b]; } else { _0xc246x1e[_0xaa6d[0x57]] = !_0xc246x1c ? _0xaa6d[0x63] + _0xc246x19[_0xaa6d[0x64]] + _0xaa6d[0x65] + _0xc246x19[_0xaa6d[0x47]] + _0xaa6d[0x66] + (_0xc246x19[_0xaa6d[0x64]] - _0xc246x12) + _0xaa6d[0x65] + _0xc246x19[_0xaa6d[0x49]] + _0xaa6d[0x67] : (_0xc246x19[_0xaa6d[0x68]] - _0xc246x12) + _0xaa6d[0x65] + _0xc246x19[_0xaa6d[0x47]] + _0xaa6d[0x65] + _0xc246x19[_0xaa6d[0x68]] + _0xaa6d[0x65] + _0xc246x19[_0xaa6d[0x49]] + _0xaa6d[0x67]; }; }; for (var _0xc246xe = 0x0; _0xc246xe < _0xc246x12; _0xc246xe++) { var _0xc246x20 = Math[_0xaa6d[0x69]](0x0, _0xc246xd(_0xc246xe)); var _0xc246x21 = _0xc246x17[_0xaa6d[0x6a]](false); _0xc246x21[_0xaa6d[0x37]][_0xaa6d[0x6b]] = _0xaa6d[0x6c] + (_0xc246x16[_0xc246x1b + _0xaa6d[0x47]] ? _0xc246x20 : 0x0) + _0xaa6d[0x6d] + (_0xc246x16[_0xc246x1b + _0xaa6d[0x49]] ? _0xc246x20 : 0x0) + _0xaa6d[0x67]; _0xc246x1c ? _0xc246x1d[_0xaa6d[0x4c]](_0xc246x21) : _0xc246x1d[_0xaa6d[0x4e]](_0xc246x21, _0xc246x1d[_0xaa6d[0x4d]]); }; }; }; }); }; _0xc246x1[_0xaa6d[0x1]][_0xaa6d[0x6f]] = function(_0xc246x2) { return _0xc246x1(_0xaa6d[0x71], this)[_0xaa6d[0x70]](); }; })(jQuery);


/*
* Superfish v1.4.8 - jQuery menu widget
* Copyright (c) 2008 Joel Birch
*
* Dual licensed under the MIT and GPL licenses:
* 	http://www.opensource.org/licenses/mit-license.php
* 	http://www.gnu.org/licenses/gpl.html
*
* CHANGELOG: http://users.tpg.com.au/j_birch/plugins/superfish/changelog.txt
*/

; (function($)
{
    $.fn.superfish = function(op)
    {

        var sf = $.fn.superfish,
			c = sf.c,
			$arrow = $(['<span class="', c.arrowClass, '"> &#187;</span>'].join('')),
			over = function()
			{
			    var $$ = $(this), menu = getMenu($$);
			    clearTimeout(menu.sfTimer);
			    $$.showSuperfishUl().siblings().hideSuperfishUl();
			},
			out = function()
			{
			    var $$ = $(this), menu = getMenu($$), o = sf.op;
			    clearTimeout(menu.sfTimer);
			    menu.sfTimer = setTimeout(function()
			    {
			        o.retainPath = ($.inArray($$[0], o.$path) > -1);
			        $$.hideSuperfishUl();
			        if (o.$path.length && $$.parents(['li.', o.hoverClass].join('')).length < 1) { over.call(o.$path); }
			    }, o.delay);
			},
			getMenu = function($menu)
			{
			    var menu = $menu.parents(['ul.', c.menuClass, ':first'].join(''))[0];
			    sf.op = sf.o[menu.serial];
			    return menu;
			},
			addArrow = function($a) { $a.addClass(c.anchorClass).append($arrow.clone()); };

        return this.each(function()
        {
            var s = this.serial = sf.o.length;
            var o = $.extend({}, sf.defaults, op);
            o.$path = $('li.' + o.pathClass, this).slice(0, o.pathLevels).each(function()
            {
                $(this).addClass([o.hoverClass, c.bcClass].join(' '))
					.filter('li:has(ul)').removeClass(o.pathClass);
            });
            sf.o[s] = sf.op = o;

            $('li:has(ul)', this)[($.fn.hoverIntent && !o.disableHI) ? 'hoverIntent' : 'hover'](over, out).each(function()
            {
                if (o.autoArrows) addArrow($('>a:first-child', this));
            })
			.not('.' + c.bcClass)
				.hideSuperfishUl();

            var $a = $('a', this);
            $a.each(function(i)
            {
                var $li = $a.eq(i).parents('li');
                $a.eq(i).focus(function() { over.call($li); }).blur(function() { out.call($li); });
            });
            o.onInit.call(this);

        }).each(function()
        {
            var menuClasses = [c.menuClass];
            if (sf.op.dropShadows && !($.browser.msie && $.browser.version < 7)) menuClasses.push(c.shadowClass);
            $(this).addClass(menuClasses.join(' '));
        });
    };

    var sf = $.fn.superfish;
    sf.o = [];
    sf.op = {};
    sf.IE7fix = function()
    {
        var o = sf.op;
        if ($.browser.msie && $.browser.version > 6 && o.dropShadows && o.animation.opacity != undefined)
            this.toggleClass(sf.c.shadowClass + '-off');
    };
    sf.c = {
        bcClass: 'sf-breadcrumb',
        menuClass: 'sf-js-enabled',
        anchorClass: 'sf-with-ul',
        arrowClass: 'sf-sub-indicator',
        shadowClass: 'sf-shadow'
    };
    sf.defaults = {
        hoverClass: 'sfHover',
        pathClass: 'overideThisToUse',
        pathLevels: 1,
        delay: 200,
        animation: { opacity: 'show' },
        speed: 'fast', // fast
        autoArrows: true, //false
        dropShadows: true, //false
        disableHI: false, 	// true disables hoverIntent detection // true
        onInit: function() { }, // callback functions
        onBeforeShow: function() { },
        onShow: function() { },
        onHide: function() { }
    };
    $.fn.extend({
        hideSuperfishUl: function()
        {
            var o = sf.op,
				not = (o.retainPath === true) ? o.$path : '';
            o.retainPath = false;
            var $ul = $(['li.', o.hoverClass].join(''), this).add(this).not(not).removeClass(o.hoverClass)
					.find('>ul').hide().css('visibility', 'hidden');
            o.onHide.call($ul);
            return this;
        },
        showSuperfishUl: function()
        {
            var o = sf.op,
				sh = sf.c.shadowClass + '-off',
				$ul = this.addClass(o.hoverClass)
					.find('>ul:hidden').css('visibility', 'visible');
            sf.IE7fix.call($ul);
            o.onBeforeShow.call($ul);
            $ul.animate(o.animation, o.speed, function() { sf.IE7fix.call($ul); o.onShow.call($ul); });
            return this;
        }
    });

})(jQuery);




/* hoverIntent by Brian Cherne */
(function($)
{
    $.fn.hoverIntent = function(f, g)
    {
        // default configuration options
        var cfg = {
            sensitivity: 7,
            interval: 100,
            timeout: 0
        };
        // override configuration options with user supplied object
        cfg = $.extend(cfg, g ? { over: f, out: g} : f);

        // instantiate variables
        // cX, cY = current X and Y position of mouse, updated by mousemove event
        // pX, pY = previous X and Y position of mouse, set by mouseover and polling interval
        var cX, cY, pX, pY;

        // A private function for getting mouse position
        var track = function(ev)
        {
            cX = ev.pageX;
            cY = ev.pageY;
        };

        // A private function for comparing current and previous mouse position
        var compare = function(ev, ob)
        {
            ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
            // compare mouse positions to see if they've crossed the threshold
            if ((Math.abs(pX - cX) + Math.abs(pY - cY)) < cfg.sensitivity)
            {
                $(ob).unbind("mousemove", track);
                // set hoverIntent state to true (so mouseOut can be called)
                ob.hoverIntent_s = 1;
                return cfg.over.apply(ob, [ev]);
            } else
            {
                // set previous coordinates for next time
                pX = cX; pY = cY;
                // use self-calling timeout, guarantees intervals are spaced out properly (avoids JavaScript timer bugs)
                ob.hoverIntent_t = setTimeout(function() { compare(ev, ob); }, cfg.interval);
            }
        };

        // A private function for delaying the mouseOut function
        var delay = function(ev, ob)
        {
            ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
            ob.hoverIntent_s = 0;
            return cfg.out.apply(ob, [ev]);
        };

        // A private function for handling mouse 'hovering'
        var handleHover = function(e)
        {
            // next three lines copied from jQuery.hover, ignore children onMouseOver/onMouseOut
            var p = (e.type == "mouseover" ? e.fromElement : e.toElement) || e.relatedTarget;
            while (p && p != this) { try { p = p.parentNode; } catch (e) { p = this; } }
            if (p == this) { return false; }

            // copy objects to be passed into t (required for event object to be passed in IE)
            var ev = jQuery.extend({}, e);
            var ob = this;

            // cancel hoverIntent timer if it exists
            if (ob.hoverIntent_t) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); }

            // else e.type == "onmouseover"
            if (e.type == "mouseover")
            {
                // set "previous" X and Y position based on initial entry point
                pX = ev.pageX; pY = ev.pageY;
                // update "current" X and Y position based on mousemove
                $(ob).bind("mousemove", track);
                // start polling interval (self-calling timeout) to compare mouse coordinates over time
                if (ob.hoverIntent_s != 1) { ob.hoverIntent_t = setTimeout(function() { compare(ev, ob); }, cfg.interval); }

                // else e.type == "onmouseout"
            } else
            {
                // unbind expensive mousemove event
                $(ob).unbind("mousemove", track);
                // if hoverIntent state is true, then call the mouseOut function after the specified delay
                if (ob.hoverIntent_s == 1) { ob.hoverIntent_t = setTimeout(function() { delay(ev, ob); }, cfg.timeout); }
            }
        };

        // bind the function to the two event listeners
        return this.mouseover(handleHover).mouseout(handleHover);
    };

})(jQuery);



/*
* Supersubs v0.2b - jQuery plugin
* Copyright (c) 2008 Joel Birch
*
* Dual licensed under the MIT and GPL licenses:
* 	http://www.opensource.org/licenses/mit-license.php
* 	http://www.gnu.org/licenses/gpl.html
*
* This plugin automatically adjusts submenu widths of suckerfish-style menus to that of their longest list item children. 
*
*/

; (function($)
{ // $ will refer to jQuery within this closure

    $.fn.supersubs = function(options)
    {
        var opts = $.extend({}, $.fn.supersubs.defaults, options);
        // return original object to support chaining
        return this.each(function()
        {
            // cache selections
            var $$ = $(this);
            // support metadata
            var o = $.meta ? $.extend({}, opts, $$.data()) : opts;
            // get the font size of menu.
            // .css('fontSize') returns various results cross-browser, so measure an em dash instead
            var fontsize = $('<li id="menu-fontsize">&#8212;</li>').css({
                'padding': 0,
                'position': 'absolute',
                'top': '-999em',
                'width': 'auto'
            }).appendTo($$).width(); //clientWidth is faster, but was incorrect here
            // remove em dash
            $('#menu-fontsize').remove();
            // cache all ul elements
            $ULs = $$.find('ul');
            // loop through each ul in menu
            $ULs.each(function(i)
            {
                // cache this ul
                var $ul = $ULs.eq(i);
                // get all (li) children of this ul
                var $LIs = $ul.children();
                // get all anchor grand-children
                var $As = $LIs.children('a');
                // force content to one line and save current float property
                var liFloat = $LIs.css('white-space', 'nowrap').css('float');
                // remove width restrictions and floats so elements remain vertically stacked
                var emWidth = $ul.add($LIs).add($As).css({
                    'float': 'none',
                    'width': 'auto'
                })
                // this ul will now be shrink-wrapped to longest li due to position:absolute
                // so save its width as ems. Clientwidth is 2 times faster than .width() - thanks Dan Switzer
				.end().end()[0].clientWidth / fontsize;
                // add more width to ensure lines don't turn over at certain sizes in various browsers
                emWidth += o.extraWidth;
                // restrict to at least minWidth and at most maxWidth
                if (emWidth > o.maxWidth) { emWidth = o.maxWidth; }
                else if (emWidth < o.minWidth) { emWidth = o.minWidth; }
                emWidth += 'em';
                // set ul to width in ems
                $ul.css('width', emWidth);
                // restore li floats to avoid IE bugs
                // set li width to full width of this ul
                // revert white-space to normal
                $LIs.css({
                    'float': liFloat,
                    'width': '100%',
                    'white-space': 'normal'
                })
                // update offset position of descendant ul to reflect new width of parent
				.each(function()
				{
				    var $childUl = $('>ul', this);
				    var offsetDirection = $childUl.css('left') !== undefined ? 'left' : 'right';
				    $childUl.css(offsetDirection, emWidth);
				});
            });

        });
    };
    // expose defaults
    $.fn.supersubs.defaults = {
        minWidth: 9, 	// requires em unit.
        maxWidth: 25, 	// requires em unit.
        extraWidth: 0			// extra width can ensure lines don't sometimes turn over due to slight browser differences in how they round-off values
    };

})(jQuery); // plugin code ends


/*
* Thickbox 3 - One Box To Rule Them All.
* By Cody Lindley (http://www.codylindley.com)
* Copyright (c) 2007 cody lindley
* Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php
*/

var tb_pathToImage = "../images/loading2.gif";

/*!!!!!!!!!!!!!!!!! edit below this line at your own risk !!!!!!!!!!!!!!!!!!!!!!!*/

//on page load call tb_init
$(document).ready(function()
{
    tb_init('a.thickbox, area.thickbox, input.thickbox'); //pass where to apply thickbox
    imgLoader = new Image(); // preload image
    imgLoader.src = tb_pathToImage;
});

//add thickbox to href & area elements that have a class of .thickbox
function tb_init(domChunk)
{
    $(domChunk).click(function()
    {
        var t = this.title || this.name || null;
        var a = this.href || this.alt;
        var g = this.rel || false;
        tb_show(t, a, g);
        this.blur();
        return false;
    });
}

function tb_show(caption, url, imageGroup)
{//function called when the user clicks on a thickbox link

    try
    {
        if (typeof document.body.style.maxHeight === "undefined")
        {//if IE 6
            $("body", "html").css({ height: "100%", width: "100%" });
            $("html").css("overflow", "hidden");
            if (document.getElementById("TB_HideSelect") === null)
            {//iframe to hide select elements in ie6
                $("body").append("<iframe id='TB_HideSelect'></iframe><div id='TB_overlay'></div><div id='TB_window'></div>");
                $("#TB_overlay").click(tb_remove);
            }
        } else
        {//all others
            if (document.getElementById("TB_overlay") === null)
            {
                $("body").append("<div id='TB_overlay'></div><div id='TB_window'></div>");
                $("#TB_overlay").click(tb_remove);
            }
        }

        if (tb_detectMacXFF())
        {
            $("#TB_overlay").addClass("TB_overlayMacFFBGHack"); //use png overlay so hide flash
        } else
        {
            $("#TB_overlay").addClass("TB_overlayBG"); //use background and opacity
        }

        if (caption === null) { caption = ""; }
        $("body").append("<div id='TB_load'><img src='" + imgLoader.src + "' /></div>"); //add loader to the page
        $('#TB_load').show(); //show loader

        var baseURL;
        if (url.indexOf("?") !== -1)
        { //ff there is a query string involved
            baseURL = url.substr(0, url.indexOf("?"));
        } else
        {
            baseURL = url;
        }

        var urlString = /\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$/;
        var urlType = baseURL.toLowerCase().match(urlString);

        if (urlType == '.jpg' || urlType == '.jpeg' || urlType == '.png' || urlType == '.gif' || urlType == '.bmp')
        {//code to show images

            TB_PrevCaption = "";
            TB_PrevURL = "";
            TB_PrevHTML = "";
            TB_NextCaption = "";
            TB_NextURL = "";
            TB_NextHTML = "";
            TB_imageCount = "";
            TB_FoundURL = false;
            if (imageGroup)
            {
                TB_TempArray = $("a[@rel=" + imageGroup + "]").get();
                for (TB_Counter = 0; ((TB_Counter < TB_TempArray.length) && (TB_NextHTML === "")); TB_Counter++)
                {
                    var urlTypeTemp = TB_TempArray[TB_Counter].href.toLowerCase().match(urlString);
                    if (!(TB_TempArray[TB_Counter].href == url))
                    {
                        if (TB_FoundURL)
                        {
                            TB_NextCaption = TB_TempArray[TB_Counter].title;
                            TB_NextURL = TB_TempArray[TB_Counter].href;
                            TB_NextHTML = "<span id='TB_next'>&nbsp;&nbsp;<a href='#'>Next &gt;</a></span>";
                        } else
                        {
                            TB_PrevCaption = TB_TempArray[TB_Counter].title;
                            TB_PrevURL = TB_TempArray[TB_Counter].href;
                            TB_PrevHTML = "<span id='TB_prev'>&nbsp;&nbsp;<a href='#'>&lt; Prev</a></span>";
                        }
                    } else
                    {
                        TB_FoundURL = true;
                        TB_imageCount = "Image " + (TB_Counter + 1) + " of " + (TB_TempArray.length);
                    }
                }
            }

            imgPreloader = new Image();
            imgPreloader.onload = function()
            {
                imgPreloader.onload = null;

                // Resizing large images - orginal by Christian Montoya edited by me.
                var pagesize = tb_getPageSize();
                var x = pagesize[0] - 150;
                var y = pagesize[1] - 150;
                var imageWidth = imgPreloader.width;
                var imageHeight = imgPreloader.height;
                if (imageWidth > x)
                {
                    imageHeight = imageHeight * (x / imageWidth);
                    imageWidth = x;
                    if (imageHeight > y)
                    {
                        imageWidth = imageWidth * (y / imageHeight);
                        imageHeight = y;
                    }
                } else if (imageHeight > y)
                {
                    imageWidth = imageWidth * (y / imageHeight);
                    imageHeight = y;
                    if (imageWidth > x)
                    {
                        imageHeight = imageHeight * (x / imageWidth);
                        imageWidth = x;
                    }
                }
                // End Resizing

                TB_WIDTH = imageWidth + 30;
                TB_HEIGHT = imageHeight + 60;
                $("#TB_window").append("<a href='' id='TB_ImageOff' title='Close'><img id='TB_Image' src='" + url + "' width='" + imageWidth + "' height='" + imageHeight + "' alt='" + caption + "'/></a>" + "<div id='TB_caption'>" + caption + "<div id='TB_secondLine'>" + TB_imageCount + TB_PrevHTML + TB_NextHTML + "</div></div><div id='TB_closeWindow'><a href='#' id='TB_closeWindowButton' title='Close'><img src='../Images/Close.jpg' border='0' /></a></div>");

                $("#TB_closeWindowButton").click(tb_remove);

                if (!(TB_PrevHTML === ""))
                {
                    function goPrev()
                    {
                        if ($(document).unbind("click", goPrev)) { $(document).unbind("click", goPrev); }
                        $("#TB_window").remove();
                        $("body").append("<div id='TB_window'></div>");
                        tb_show(TB_PrevCaption, TB_PrevURL, imageGroup);
                        return false;
                    }
                    $("#TB_prev").click(goPrev);
                }

                if (!(TB_NextHTML === ""))
                {
                    function goNext()
                    {
                        $("#TB_window").remove();
                        $("body").append("<div id='TB_window'></div>");
                        tb_show(TB_NextCaption, TB_NextURL, imageGroup);
                        return false;
                    }
                    $("#TB_next").click(goNext);

                }

                document.onkeydown = function(e)
                {
                    if (e == null)
                    { // ie
                        keycode = event.keyCode;
                    } else
                    { // mozilla
                        keycode = e.which;
                    }
                    if (keycode == 27)
                    { // close
                        tb_remove();
                    } else if (keycode == 190)
                    { // display previous image
                        if (!(TB_NextHTML == ""))
                        {
                            document.onkeydown = "";
                            goNext();
                        }
                    } else if (keycode == 188)
                    { // display next image
                        if (!(TB_PrevHTML == ""))
                        {
                            document.onkeydown = "";
                            goPrev();
                        }
                    }
                };

                tb_position();
                $("#TB_load").remove();
                $("#TB_ImageOff").click(tb_remove);
                $("#TB_window").css({ display: "block" }); //for safari using css instead of show
            };

            imgPreloader.src = url;
        } else
        {//code to show html

            var queryString = url.replace(/^[^\?]+\??/, '');
            var params = tb_parseQuery(queryString);

            TB_WIDTH = (params['width'] * 1) + 30 || 630; //defaults to 630 if no paramaters were added to URL
            TB_HEIGHT = (params['height'] * 1) + 40 || 440; //defaults to 440 if no paramaters were added to URL
            ajaxContentW = TB_WIDTH - 30;
            ajaxContentH = TB_HEIGHT - 45;

            if (url.indexOf('TB_iframe') != -1)
            {// either iframe or ajax window		
                urlNoQuery = url.split('TB_');
                $("#TB_iframeContent").remove();
                if (params['modal'] != "true")
                {//iframe no modal
                    $("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>" + caption + "</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton' title='Close'><img src='../Images/Close.jpg' border='0' style='z-index:-1' /></a></div></div><iframe frameborder='0' hspace='0' src='" + urlNoQuery[0] + "' id='TB_iframeContent' name='TB_iframeContent" + Math.round(Math.random() * 1000) + "' onload='tb_showIframe()' style='width:" + (ajaxContentW + 29) + "px;height:" + (ajaxContentH + 17) + "px;' > </iframe>");
                } else
                {//iframe modal
                    $("#TB_overlay").unbind();
                    $("#TB_window").append("<iframe frameborder='0' hspace='0' src='" + urlNoQuery[0] + "' id='TB_iframeContent' name='TB_iframeContent" + Math.round(Math.random() * 1000) + "' onload='tb_showIframe()' style='width:" + (ajaxContentW + 29) + "px;height:" + (ajaxContentH + 17) + "px;'> </iframe>");
                }
            } else
            {// not an iframe, ajax
                if ($("#TB_window").css("display") != "block")
                {
                    if (params['modal'] != "true")
                    {//ajax no modal
                        $("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>" + caption + "</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton'><img src='../Images/Close.jpg' border='0' /></a></div></div><div id='TB_ajaxContent' style='width:" + ajaxContentW + "px;height:" + ajaxContentH + "px'></div>");
                    } else
                    {//ajax modal
                        $("#TB_overlay").unbind();
                        $("#TB_window").append("<div id='TB_ajaxContent' class='TB_modal' style='width:" + ajaxContentW + "px;height:" + ajaxContentH + "px;'></div>");
                    }
                } else
                {//this means the window is already up, we are just loading new content via ajax
                    $("#TB_ajaxContent")[0].style.width = ajaxContentW + "px";
                    $("#TB_ajaxContent")[0].style.height = ajaxContentH + "px";
                    $("#TB_ajaxContent")[0].scrollTop = 0;
                    $("#TB_ajaxWindowTitle").html(caption);
                }
            }

            $("#TB_closeWindowButton").click(tb_remove);

            if (url.indexOf('TB_inline') != -1)
            {
                $("#TB_ajaxContent").append($('#' + params['inlineId']).children());
                $("#TB_window").unload(function()
                {
                    $('#' + params['inlineId']).append($("#TB_ajaxContent").children()); // move elements back when you're finished
                });
                tb_position();
                $("#TB_load").remove();
                $("#TB_window").css({ display: "block" });
            } else if (url.indexOf('TB_iframe') != -1)
            {
                tb_position();
                if ($.browser.safari)
                {//safari needs help because it will not fire iframe onload
                    $("#TB_load").remove();
                    $("#TB_window").css({ display: "block" });
                }
            } else
            {
                $("#TB_ajaxContent").load(url += "&random=" + (new Date().getTime()), function()
                {//to do a post change this load method
                    tb_position();
                    $("#TB_load").remove();
                    tb_init("#TB_ajaxContent a.thickbox");
                    $("#TB_window").css({ display: "block" });
                });
            }

        }

        if (!params['modal'])
        {
            document.onkeyup = function(e)
            {
                if (e == null)
                { // ie
                    keycode = event.keyCode;
                } else
                { // mozilla
                    keycode = e.which;
                }
                if (keycode == 27)
                { // close
                    tb_remove();
                }
            };
        }

    } catch (e)
    {
        //nothing here
    }
}

//helper functions below
function tb_showIframe()
{
    $("#TB_load").remove();
    $("#TB_window").css({ display: "block" });
}

function tb_remove()
{
    $("#TB_imageOff").unbind("click");
    $("#TB_closeWindowButton").unbind("click");
    $("#TB_window").fadeOut("fast", function() { $('#TB_window,#TB_overlay,#TB_HideSelect').trigger("unload").unbind().remove(); });
    $("#TB_load").remove();
    if (typeof document.body.style.maxHeight == "undefined")
    {//if IE 6
        $("body", "html").css({ height: "auto", width: "auto" });
        $("html").css("overflow", "");
    }
    document.onkeydown = "";
    document.onkeyup = "";
    return false;
}

function tb_position()
{
    $("#TB_window").css({ marginLeft: '-' + parseInt((TB_WIDTH / 2), 10) + 'px', width: TB_WIDTH + 'px' });
    if (!(jQuery.browser.msie && jQuery.browser.version < 7))
    { // take away IE6
        $("#TB_window").css({ marginTop: '-' + parseInt((TB_HEIGHT / 2), 10) + 'px' });
    }
}

function tb_parseQuery(query)
{
    var Params = {};
    if (!query) { return Params; } // return empty object
    var Pairs = query.split(/[;&]/);
    for (var i = 0; i < Pairs.length; i++)
    {
        var KeyVal = Pairs[i].split('=');
        if (!KeyVal || KeyVal.length != 2) { continue; }
        var key = unescape(KeyVal[0]);
        var val = unescape(KeyVal[1]);
        val = val.replace(/\+/g, ' ');
        Params[key] = val;
    }
    return Params;
}

function tb_getPageSize()
{
    var de = document.documentElement;
    var w = window.innerWidth || self.innerWidth || (de && de.clientWidth) || document.body.clientWidth;
    var h = window.innerHeight || self.innerHeight || (de && de.clientHeight) || document.body.clientHeight;
    arrayPageSize = [w, h];
    return arrayPageSize;
}

function tb_detectMacXFF()
{
    var userAgent = navigator.userAgent.toLowerCase();
    if (userAgent.indexOf('mac') != -1 && userAgent.indexOf('firefox') != -1)
    {
        return true;
    }
}


