// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
// Browser Detect code from: http://www.quirksmode.org/js/detect.html
// Returns:
// Browser name:    BrowserDetect.browser 
// Browser version: BrowserDetect.version 
// OS name:         BrowserDetect.OS

/* Example code:
    var BrowserName = BrowserDetect.browser;
    var BrowserVersion = BrowserDetect.version;
*/


function SetUniqueRadioButton(nameregex, current)
{
   re = new RegExp(nameregex);
   for(i = 0; i < document.forms[0].elements.length; i++)
   {
      elm = document.forms[0].elements[i]
      if (elm.type == 'radio')
      {
         if (re.test(elm.name))
         {
            elm.checked = false;
         }
      }
   }
   current.checked = true;
}

var BrowserDetect = {
    init: function () {
        this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
        this.version = this.searchVersion(navigator.userAgent)
            || this.searchVersion(navigator.appVersion)
            || "an unknown version";
        this.OS = this.searchString(this.dataOS) || "an unknown OS";
    },
    searchString: function (data) {
        for (var i=0;i<data.length;i++) {
            var dataString = data[i].string;
            var dataProp = data[i].prop;
            this.versionSearchString = data[i].versionSearch || data[i].identity;
            if (dataString) {
                if (dataString.indexOf(data[i].subString) != -1)
                    return data[i].identity;
            }
            else if (dataProp)
                return data[i].identity;
        }
    },
    searchVersion: function (dataString) {
        var index = dataString.indexOf(this.versionSearchString);
        if (index == -1) return;
        return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
    },
    dataBrowser: [
        {   string: navigator.userAgent,
            subString: "OmniWeb",
            versionSearch: "OmniWeb/",
            identity: "OmniWeb"
        },
        {
            string: navigator.vendor,
            subString: "Apple",
            identity: "Safari"
        },
        {
            prop: window.opera,
            identity: "Opera"
        },
        {
            string: navigator.vendor,
            subString: "iCab",
            identity: "iCab"
        },
        {
            string: navigator.vendor,
            subString: "KDE",
            identity: "Konqueror"
        },
        {
            string: navigator.userAgent,
            subString: "Firefox",
            identity: "Firefox"
        },
        {
            string: navigator.vendor,
            subString: "Camino",
            identity: "Camino"
        },
        {       // for newer Netscapes (6+)
            string: navigator.userAgent,
            subString: "Netscape",
            identity: "Netscape"
        },
        {
            string: navigator.userAgent,
            subString: "MSIE",
            identity: "Explorer",
            versionSearch: "MSIE"
        },
        {
            string: navigator.userAgent,
            subString: "Gecko",
            identity: "Mozilla",
            versionSearch: "rv"
        },
        {       // for older Netscapes (4-)
            string: navigator.userAgent,
            subString: "Mozilla",
            identity: "Netscape",
            versionSearch: "Mozilla"
        }
    ],
    dataOS : [
        {
            string: navigator.platform,
            subString: "Win",
            identity: "Windows"
        },
        {
            string: navigator.platform,
            subString: "Mac",
            identity: "Mac"
        },
        {
            string: navigator.platform,
            subString: "Linux",
            identity: "Linux"
        }
    ]

};
BrowserDetect.init();

// END BrowserDetect
// ---------------------------------------------------------------------------------------


if(document.all && !document.getElementById) {
    document.getElementById = function(id) {
         return document.all[id];
    }
}

// element rotation

rotationNum = 3; //number of elements
// generate random number 0-2
//randomnumber=Math.floor(Math.random()*rotationNum);
theCount = 1; //randomnumber + 1;
function timedCount(isDelay){
    if (theCount > rotationNum ) { theCount = 1; }
    
    if (!isDelay) {
        tabSwitch('tab' + theCount,'content' + theCount);
        theCount++;
    }
    t=setTimeout("timedCount()",5000);
}

function stopTimer(countNum) { clearTimeout(t);
    if (countNum) theCount = countNum+1;
}

// end element rotation


//id.innerhtml = id.title
function titleToHtml (html, title){
    //find IDs
    if (html) var htmlID = findId(html);
    if (title) var titleID = findId(title);
    //Text switching
    if (htmlID && titleID) htmlID.innerHTML = titleID.title;
    return false;
}
function blankToHtml (blankID){
    if (blankID) {
        var blankID = findId(blankID);
        blankID.innerHTML = "";
    }
    return false;
}


//START dhtml tabs
function tabSwitch(link_id, content_id) {
//tabStart = 'default-link-on'
//tabTextStart= 'default-text-on'
//Link = onclick="tabSwitch('tab_link_1','tab_text_1');

    //find IDs
    var tabLinkStartID = findId(tabStart);
    var tabLinkNewID = findId(link_id);

    var tabTextStartID = findId(tabTextStart);
    var tabTextNewID = findId(content_id);
    
    //Link switching
    if (tabLinkStartID) tabLinkStartID.className = tabLinkStartID.className ==''?'on':'';
    if (tabLinkNewID) tabLinkNewID.className =  tabLinkNewID.className ==''?'on':'';
    tabStart = link_id;
    
    //Text switching
    if (content_id) HideShow(content_id);
    if (tabTextStart) HideShow(tabTextStart);
    tabTextStart = content_id;

    return false;
}

//END dhtml tabs

function value_remove_focus(el) {
    if(el.V) {
        if (el.value == el.V) {
        el.value = '';
        }
    } else {
        el.V = el.value;
        el.value = '';
    }
}

function DR_SwapClass (id, classString) {
    theClass = findId(id);
    theClassName = theClass.className;
    if (!theClassName.match(classString)) {
        theClassName_on = theClassName + classString;
        theClass.className = theClassName_on;
        //alert( "theClass.className: " + theClass.className )
    }
}


function DR_SwapClassRestore () {
    theClass.className = theClassName
}

function ExpandCollapse(id, theClass) { 
// find all divs
    var divs = document.getElementsByTagName('div');
    if (divs) {
        // loop through all
        for (var i=0;i<divs.length;i++) { 
            // hide all with class passed
            if (divs[i].className == theClass) {
                // if id then hide all
                if (id) { divs[i].style.display = 'none'; } 
                // if no id then show all
                else { divs[i].style.display = ''; }
            }
        }
    }
    
    // if id passed, show the one   
    if (id) {
        if (document.getElementById(id)) { document.getElementById(id).style.display="";}
    }
}


function position(thediv, theanchor,X,Y ) {
    
    if (X) { xOffset = X  } else ( xOffset = 10 )
    if (Y) { yOffset = Y  } else ( yOffset = 10 )
    
    lyr = findId(thediv);
    theimage = findId(theanchor)
    if (lyr){
        if (theimage) {
            locY = findPosY(theimage) + yOffset;
            locX = findPosX(theimage) + xOffset;
            lyr.style.left = locX + 'px';
            lyr.style.top = locY + 'px';
        }
    }
}


function getoffset(theTable, theDiv) {
    var Div = new getObj(theDiv);
    if (Div) {
        tableWidth = theTable.offsetWidth;
        offset = tableWidth - Div.obj.offsetWidth;
        return offset;
    }
}

function HideShow(id) {
    theElement = findId(id);
    if (theElement) { theElement.style.display=theElement.style.display==''?'none':''};
}

function HideShowMult() {
    for (i=0; i<= arguments.length; i++) {
        theElement = findId(arguments[i]);
        if (theElement) { theElement.style.display=theElement.style.display==''?'none':''};
    }
}

//** Drop Nav Centered on Site **//
// IE and Mozilla friendly way to get id's
function findId(id) {
    if (document.getElementById) {
        return document.getElementById(id);
    } else if (document.all) {
        return document.all.id;
    }
}
//  END IE and Mozilla friendly way to get id's

tdLastId = "";
tdCurrentId = "";
waiting = 0;
waitTime = 50;
timeoutId = "";

function navFlip(id, that, xOffset, yPos) {
    //alert(xOffset)
    if (!xOffset) xOffset = 0;
    if (!yPos) yPos = 0; 
    if (waiting) {
        if (id != tdLastId) {
            clearTimeout(timeoutId);
            that_saved = that;
            timeoutId = setTimeout('clearWait(' + xOffset + ', ' + yPos + ')', waitTime);
        }
        tdLastId = id;
        return;
    }

if (tdCurrentId != id) {
        if (id) {
            lyr = findId(id);
            if (lyr) { //Error fix 4/20/04
                if (that) {
                    lyr.style.left = findPosX(that) + xOffset + 'px';
                    if (yPos != 0) {
                        lyr.style.top = findPosY(that) + yPos + 'px';
                    }
                }   
    
                lyr.style.visibility = "visible";
    
                waiting = id;
            }// end lyr
        }

        if (tdCurrentId) {
            //alert('dis: ' + tdCurrentId + ' waiting:' + waiting);

            lyr = findId(tdCurrentId);
            if (lyr) { //Error fix 4/20/04
                lyr.style.visibility = "hidden";
            }// end if
        }
        tdCurrentId = id;
    }
    tdLastId = id;
}

function clearWait(xOffset, yPos) {
    //alert('clearing: ' + waiting);
    waiting = 0;
    navFlip(tdLastId, that_saved, xOffset, yPos);
}

// Functions to find positions of static images
function findPosX(obj) {
    var curleft = 0;
    if(obj.offsetParent)
        while(1) {
          curleft += obj.offsetLeft;
          if(!obj.offsetParent) break;
          obj = obj.offsetParent;
        }
    else if(obj.x)
        curleft += obj.x;
    return curleft;
  }

function findPosY(obj) {
    var curtop = 0;
    if(obj.offsetParent)
        while(1) {
          curtop += obj.offsetTop;
          if(!obj.offsetParent) break;
          obj = obj.offsetParent;
        }
    else if(obj.y)
        curtop += obj.y;
    return curtop;
  }
// END ** Drop Nav Centered on Site **//

function getObj(name)
{
  if (document.getElementById)
  {
    this.obj = document.getElementById(name);
    this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
    this.obj = document.all[name];
    this.style = document.all[name].style;
  }
  else if (document.layers)
  {
    this.obj = document.layers[name];
    this.style = document.layers[name];
  }
}

//Mouseover Script
<!--

function MM_openBrWindow(theURL,winName,features) { //v2.0
  w = window.open(theURL,winName,features);
  w.focus();
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

browser = navigator.appName;
ie = "Microsoft Internet Explorer";
netscape = "Netscape";

function SetFormValue(formStr,field,value) {
    
    form=(MM_findObj(formStr))
    
    if (form) {
        if (null != (form.elements[field])) {
            if ((browser == netscape)&&(form.elements[field].type=='select-one')){
                sellength=form.elements[field].length;
                for (i=0; i< sellength; i++) {
                    if (form.elements[field].options[i].value==value)
                        form.elements[field].options[i].selected=true;
                }
            } 
            else 
                form.elements[field].value=value;
        }       
    }
}

function SubmitForm(formStr) {
    form=(MM_findObj(formStr))
    if(form) form.submit();
}
//-->


/*! SWFObject v2.0 <http://code.google.com/p/swfobject/>
    Copyright (c) 2007 Geoff Stearns, Michael Williams, and Bobby van der Sluis
    This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
*/

var swfobject = function() {
    
    var UNDEF = "undefined",
        OBJECT = "object",
        SHOCKWAVE_FLASH = "Shockwave Flash",
        SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash",
        FLASH_MIME_TYPE = "application/x-shockwave-flash",
        EXPRESS_INSTALL_ID = "SWFObjectExprInst",
        
        win = window,
        doc = document,
        nav = navigator,
        
        domLoadFnArr = [],
        regObjArr = [],
        timer = null,
        storedAltContent = null,
        storedAltContentId = null,
        isDomLoaded = false,
        isExpressInstallActive = false;
    
    /* Centralized function for browser feature detection
        - Proprietary feature detection (conditional compiling) is used to detect Internet Explorer's features
        - User agent string detection is only used when no alternative is possible
        - Is executed directly for optimal performance
    */  
    var ua = function() {
        var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF && typeof doc.appendChild != UNDEF && typeof doc.replaceChild != UNDEF && typeof doc.removeChild != UNDEF && typeof doc.cloneNode != UNDEF,
            playerVersion = [0,0,0],
            d = null;
        if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) {
            d = nav.plugins[SHOCKWAVE_FLASH].description;
            if (d) {
                d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
                playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10);
                playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
                playerVersion[2] = /r/.test(d) ? parseInt(d.replace(/^.*r(.*)$/, "$1"), 10) : 0;
            }
        }
        else if (typeof win.ActiveXObject != UNDEF) {
            var a = null, fp6Crash = false;
            try {
                a = new ActiveXObject(SHOCKWAVE_FLASH_AX + ".7");
            }
            catch(e) {
                try { 
                    a = new ActiveXObject(SHOCKWAVE_FLASH_AX + ".6");
                    playerVersion = [6,0,21];
                    a.AllowScriptAccess = "always";  // Introduced in fp6.0.47
                }
                catch(e) {
                    if (playerVersion[0] == 6) {
                        fp6Crash = true;
                    }
                }
                if (!fp6Crash) {
                    try {
                        a = new ActiveXObject(SHOCKWAVE_FLASH_AX);
                    }
                    catch(e) {}
                }
            }
            if (!fp6Crash && a) { // a will return null when ActiveX is disabled
                try {
                    d = a.GetVariable("$version");  // Will crash fp6.0.21/23/29
                    if (d) {
                        d = d.split(" ")[1].split(",");
                        playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
                    }
                }
                catch(e) {}
            }
        }
        var u = nav.userAgent.toLowerCase(),
            p = nav.platform.toLowerCase(),
            webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, // returns either the webkit version or false if not webkit
            ie = false,
            windows = p ? /win/.test(p) : /win/.test(u),
            mac = p ? /mac/.test(p) : /mac/.test(u);
        /*@cc_on
            ie = true;
            @if (@_win32)
                windows = true;
            @elif (@_mac)
                mac = true;
            @end
        @*/
        return { w3cdom:w3cdom, pv:playerVersion, webkit:webkit, ie:ie, win:windows, mac:mac };
    }();

    /* Cross-browser onDomLoad
        - Based on Dean Edwards' solution: http://dean.edwards.name/weblog/2006/06/again/
        - Will fire an event as soon as the DOM of a page is loaded (supported by Gecko based browsers - like Firefox -, IE, Opera9+, Safari)
    */ 
    var onDomLoad = function() {
        if (!ua.w3cdom) {
            return;
        }
        addDomLoadEvent(main);
        if (ua.ie && ua.win) {
            try {  // Avoid a possible Operation Aborted error
                doc.write("<scr" + "ipt id=__ie_ondomload defer=true src=//:></scr" + "ipt>"); // String is split into pieces to avoid Norton AV to add code that can cause errors 
                var s = getElementById("__ie_ondomload");
                if (s) {
                    s.onreadystatechange = function() {
                        if (this.readyState == "complete") {
                            this.parentNode.removeChild(this);
                            callDomLoadFunctions();
                        }
                    };
                }
            }
            catch(e) {}
        }
        if (ua.webkit && typeof doc.readyState != UNDEF) {
            timer = setInterval(function() { if (/loaded|complete/.test(doc.readyState)) { callDomLoadFunctions(); }}, 10);
        }
        if (typeof doc.addEventListener != UNDEF) {
            doc.addEventListener("DOMContentLoaded", callDomLoadFunctions, null);
        }
        addLoadEvent(callDomLoadFunctions);
    }();
    
    function callDomLoadFunctions() {
        if (isDomLoaded) {
            return;
        }
        if (ua.ie && ua.win) { // Test if we can really add elements to the DOM; we don't want to fire it too early
            var s = createElement("span");
            try { // Avoid a possible Operation Aborted error
                var t = doc.getElementsByTagName("body")[0].appendChild(s);
                t.parentNode.removeChild(t);
            }
            catch (e) {
                return;
            }
        }
        isDomLoaded = true;
        if (timer) {
            clearInterval(timer);
            timer = null;
        }
        var dl = domLoadFnArr.length;
        for (var i = 0; i < dl; i++) {
            domLoadFnArr[i]();
        }
    }
    
    function addDomLoadEvent(fn) {
        if (isDomLoaded) {
            fn();
        }
        else { 
            domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+
        }
    }
    
    /* Cross-browser onload
        - Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/
        - Will fire an event as soon as a web page including all of its assets are loaded 
     */
    function addLoadEvent(fn) {
        if (typeof win.addEventListener != UNDEF) {
            win.addEventListener("load", fn, false);
        }
        else if (typeof doc.addEventListener != UNDEF) {
            doc.addEventListener("load", fn, false);
        }
        else if (typeof win.attachEvent != UNDEF) {
            win.attachEvent("onload", fn);
        }
        else if (typeof win.onload == "function") {
            var fnOld = win.onload;
            win.onload = function() {
                fnOld();
                fn();
            };
        }
        else {
            win.onload = fn;
        }
    }
    
    /* Main function
        - Will preferably execute onDomLoad, otherwise onload (as a fallback)
    */
    function main() { // Static publishing only
        var rl = regObjArr.length;
        for (var i = 0; i < rl; i++) { // For each registered object element
            var id = regObjArr[i].id;
            if (ua.pv[0] > 0) {
                var obj = getElementById(id);
                if (obj) {
                    regObjArr[i].width = obj.getAttribute("width") ? obj.getAttribute("width") : "0";
                    regObjArr[i].height = obj.getAttribute("height") ? obj.getAttribute("height") : "0";
                    if (hasPlayerVersion(regObjArr[i].swfVersion)) { // Flash plug-in version >= Flash content version: Houston, we have a match!
                        if (ua.webkit && ua.webkit < 312) { // Older webkit engines ignore the object element's nested param elements
                            fixParams(obj);
                        }
                        setVisibility(id, true);
                    }
                    else if (regObjArr[i].expressInstall && !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac)) { // Show the Adobe Express Install dialog if set by the web page author and if supported (fp6.0.65+ on Win/Mac OS only)
                        showExpressInstall(regObjArr[i]);
                    }
                    else { // Flash plug-in and Flash content version mismatch: display alternative content instead of Flash content
                        displayAltContent(obj);
                    }
                }
            }
            else {  // If no fp is installed, we let the object element do its job (show alternative content)
                setVisibility(id, true);
            }
        }
    }
    
    /* Fix nested param elements, which are ignored by older webkit engines
        - This includes Safari up to and including version 1.2.2 on Mac OS 10.3
        - Fall back to the proprietary embed element
    */
    function fixParams(obj) {
        var nestedObj = obj.getElementsByTagName(OBJECT)[0];
        if (nestedObj) {
            var e = createElement("embed"), a = nestedObj.attributes;
            if (a) {
                var al = a.length;
                for (var i = 0; i < al; i++) {
                    if (a[i].nodeName.toLowerCase() == "data") {
                        e.setAttribute("src", a[i].nodeValue);
                    }
                    else {
                        e.setAttribute(a[i].nodeName, a[i].nodeValue);
                    }
                }
            }
            var c = nestedObj.childNodes;
            if (c) {
                var cl = c.length;
                for (var j = 0; j < cl; j++) {
                    if (c[j].nodeType == 1 && c[j].nodeName.toLowerCase() == "param") {
                        e.setAttribute(c[j].getAttribute("name"), c[j].getAttribute("value"));
                    }
                }
            }
            obj.parentNode.replaceChild(e, obj);
        }
    }
    
    /* Fix hanging audio/video threads and force open sockets and NetConnections to disconnect
        - Occurs when unloading a web page in IE using fp8+ and innerHTML/outerHTML
        - Dynamic publishing only
    */
    function fixObjectLeaks(id) {
        if (ua.ie && ua.win && hasPlayerVersion("8.0.0")) {
            win.attachEvent("onunload", function () {


                var obj = getElementById(id);
                if (obj) {
                    for (var i in obj) {
                        if (typeof obj[i] == "function") {
                            obj[i] = function() {};
                        }
                    }
                    obj.parentNode.removeChild(obj);
                }
            });
        }
    }
    
    /* Show the Adobe Express Install dialog
        - Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75
    */
    function showExpressInstall(regObj) {
        isExpressInstallActive = true;
        var obj = getElementById(regObj.id);
        if (obj) {
            if (regObj.altContentId) {
                var ac = getElementById(regObj.altContentId);
                if (ac) {
                    storedAltContent = ac;
                    storedAltContentId = regObj.altContentId;
                }
            }
            else {
                storedAltContent = abstractAltContent(obj);
            }
            if (!(/%$/.test(regObj.width)) && parseInt(regObj.width, 10) < 310) {
                regObj.width = "310";
            }
            if (!(/%$/.test(regObj.height)) && parseInt(regObj.height, 10) < 137) {
                regObj.height = "137";
            }
            doc.title = doc.title.slice(0, 47) + " - Flash Player Installation";
            var pt = ua.ie && ua.win ? "ActiveX" : "PlugIn",
                dt = doc.title,
                fv = "MMredirectURL=" + win.location + "&MMplayerType=" + pt + "&MMdoctitle=" + dt,
                replaceId = regObj.id;
            // For IE when a SWF is loading (AND: not available in cache) wait for the onload event to fire to remove the original object element
            // In IE you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
            if (ua.ie && ua.win && obj.readyState != 4) {
                var newObj = createElement("div");
                replaceId += "SWFObjectNew";
                newObj.setAttribute("id", replaceId);
                obj.parentNode.insertBefore(newObj, obj); // Insert placeholder div that will be replaced by the object element that loads expressinstall.swf
                obj.style.display = "none";
                win.attachEvent("onload", function() { obj.parentNode.removeChild(obj); });
            }
            createSWF({ data:regObj.expressInstall, id:EXPRESS_INSTALL_ID, width:regObj.width, height:regObj.height }, { flashvars:fv }, replaceId);
        }
    }
    
    /* Functions to abstract and display alternative content
    */
    function displayAltContent(obj) {
        if (ua.ie && ua.win && obj.readyState != 4) {
            // For IE when a SWF is loading (AND: not available in cache) wait for the onload event to fire to remove the original object element
            // In IE you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
            var el = createElement("div");
            obj.parentNode.insertBefore(el, obj); // Insert placeholder div that will be replaced by the alternative content
            el.parentNode.replaceChild(abstractAltContent(obj), el);
            obj.style.display = "none";
            win.attachEvent("onload", function() { obj.parentNode.removeChild(obj); });
        }
        else {
            obj.parentNode.replaceChild(abstractAltContent(obj), obj);
        }
    }   

    function abstractAltContent(obj) {
        var ac = createElement("div");
        if (ua.win && ua.ie) {
            ac.innerHTML = obj.innerHTML;
        }
        else {
            var nestedObj = obj.getElementsByTagName(OBJECT)[0];
            if (nestedObj) {
                var c = nestedObj.childNodes;
                if (c) {
                    var cl = c.length;
                    for (var i = 0; i < cl; i++) {
                        if (!(c[i].nodeType == 1 && c[i].nodeName.toLowerCase() == "param") && !(c[i].nodeType == 8)) {
                            ac.appendChild(c[i].cloneNode(true));
                        }
                    }
                }
            }
        }
        return ac;
    }
    
    /* Cross-browser dynamic SWF creation
    */
    function createSWF(attObj, parObj, id) {
        var r, el = getElementById(id);
        if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content
            attObj.id = id;
        }
        if (ua.ie && ua.win) { // IE, the object element and W3C DOM methods do not combine: fall back to outerHTML
            var att = "";
            for (var i in attObj) {
                if (attObj[i] != Object.prototype[i]) { // Filter out prototype additions from other potential libraries, like Object.prototype.toJSONString = function() {}
                    if (i == "data") {
                        parObj.movie = attObj[i];
                    }
                    else if (i.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
                        att += ' class="' + attObj[i] + '"';
                    }
                    else if (i != "classid") {
                        att += ' ' + i + '="' + attObj[i] + '"';
                    }
                }
            }
            var par = "";
            for (var j in parObj) {
                if (parObj[j] != Object.prototype[j]) { // Filter out prototype additions from other potential libraries
                    par += '<param name="' + j + '" value="' + parObj[j] + '" />';
                }
            }
            el.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + att + '>' + par + '</object>';
            fixObjectLeaks(attObj.id); // This bug affects dynamic publishing only
            r = getElementById(attObj.id);  
        }
        else if (ua.webkit && ua.webkit < 312) { // Older webkit engines ignore the object element's nested param elements: fall back to the proprietary embed element
            var e = createElement("embed");
            e.setAttribute("type", FLASH_MIME_TYPE);
            for (var k in attObj) {
                if (attObj[k] != Object.prototype[k]) { // Filter out prototype additions from other potential libraries
                    if (k == "data") {
                        e.setAttribute("src", attObj[k]);
                    }
                    else if (k.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
                        e.setAttribute("class", attObj[k]);
                    }
                    else if (k != "classid") { // Filter out IE specific attribute
                        e.setAttribute(k, attObj[k]);
                    }
                }
            }
            for (var l in parObj) {
                if (parObj[l] != Object.prototype[l]) { // Filter out prototype additions from other potential libraries
                    if (l != "movie") { // Filter out IE specific param element
                        e.setAttribute(l, parObj[l]);
                    }
                }
            }
            el.parentNode.replaceChild(e, el);
            r = e;
        }
        else { // Well-behaving browsers
            var o = createElement(OBJECT);
            o.setAttribute("type", FLASH_MIME_TYPE);
            for (var m in attObj) {
                if (attObj[m] != Object.prototype[m]) { // Filter out prototype additions from other potential libraries
                    if (m.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
                        o.setAttribute("class", attObj[m]);
                    }
                    else if (m != "classid") { // Filter out IE specific attribute
                        o.setAttribute(m, attObj[m]);
                    }
                }
            }
            for (var n in parObj) {
                if (parObj[n] != Object.prototype[n] && n != "movie") { // Filter out prototype additions from other potential libraries and IE specific param element
                    createObjParam(o, n, parObj[n]);
                }
            }
            el.parentNode.replaceChild(o, el);
            r = o;
        }
        return r;
    }
    
    function createObjParam(el, pName, pValue) {
        var p = createElement("param");
        p.setAttribute("name", pName);  
        p.setAttribute("value", pValue);
        el.appendChild(p);
    }
    
    function getElementById(id) {
        return doc.getElementById(id);
    }
    
    function createElement(el) {
        return doc.createElement(el);
    }
    
    function hasPlayerVersion(rv) {
        var pv = ua.pv, v = rv.split(".");
        v[0] = parseInt(v[0], 10);
        v[1] = parseInt(v[1], 10);
        v[2] = parseInt(v[2], 10);
        return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false;
    }
    
    /* Cross-browser dynamic CSS creation
        - Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php
    */  
    function createCSS(sel, decl) {
        if (ua.ie && ua.mac) {
            return;
        }
        var h = doc.getElementsByTagName("head")[0], s = createElement("style");
        s.setAttribute("type", "text/css");
        s.setAttribute("media", "screen");
        if (!(ua.ie && ua.win) && typeof doc.createTextNode != UNDEF) {
            s.appendChild(doc.createTextNode(sel + " {" + decl + "}"));
        }
        h.appendChild(s);
        if (ua.ie && ua.win && typeof doc.styleSheets != UNDEF && doc.styleSheets.length > 0) {
            var ls = doc.styleSheets[doc.styleSheets.length - 1];
            if (typeof ls.addRule == OBJECT) {
                ls.addRule(sel, decl);
            }
        }
    }
    
    function setVisibility(id, isVisible) {
        var v = isVisible ? "visible" : "hidden";
        if (isDomLoaded) {
            getElementById(id).style.visibility = v;
        }
        else {
            createCSS("#" + id, "visibility:" + v);
        }
    }
    
    return {
        /* Public API
            - Reference: http://code.google.com/p/swfobject/wiki/SWFObject_2_0_documentation
        */ 
        registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr) {
            if (!ua.w3cdom || !objectIdStr || !swfVersionStr) {
                return;
            }
            var regObj = {};
            regObj.id = objectIdStr;
            regObj.swfVersion = swfVersionStr;
            regObj.expressInstall = xiSwfUrlStr ? xiSwfUrlStr : false;
            regObjArr[regObjArr.length] = regObj;
            setVisibility(objectIdStr, false);
        },
        
        getObjectById: function(objectIdStr) {
            var r = null;
            if (ua.w3cdom && isDomLoaded) {
                var o = getElementById(objectIdStr);
                if (o) {
                    var n = o.getElementsByTagName(OBJECT)[0];
                    if (!n || (n && typeof o.SetVariable != UNDEF)) {
                        r = o;
                    }
                    else if (typeof n.SetVariable != UNDEF) {
                        r = n;
                    }
                }
            }
            return r;
        },
        
        embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj) {
            if (!ua.w3cdom || !swfUrlStr || !replaceElemIdStr || !widthStr || !heightStr || !swfVersionStr) {
                return;
            }
            widthStr += ""; // Auto-convert to string to make it idiot proof
            heightStr += "";
            if (hasPlayerVersion(swfVersionStr)) {
                setVisibility(replaceElemIdStr, false);
                var att = (typeof attObj == OBJECT) ? attObj : {};
                att.data = swfUrlStr;
                att.width = widthStr;
                att.height = heightStr;
                var par = (typeof parObj == OBJECT) ? parObj : {};
                if (typeof flashvarsObj == OBJECT) {
                    for (var i in flashvarsObj) {
                        if (flashvarsObj[i] != Object.prototype[i]) { // Filter out prototype additions from other potential libraries
                            if (typeof par.flashvars != UNDEF) {
                                par.flashvars += "&" + i + "=" + flashvarsObj[i];
                            }
                            else {
                                par.flashvars = i + "=" + flashvarsObj[i];
                            }
                        }
                    }
                }
                addDomLoadEvent(function() {
                    createSWF(att, par, replaceElemIdStr);
                    if (att.id == replaceElemIdStr) {
                        setVisibility(replaceElemIdStr, true);
                    }
                });
            }
            else if (xiSwfUrlStr && !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac)) {
                setVisibility(replaceElemIdStr, false);
                addDomLoadEvent(function() {
                    var regObj = {};
                    regObj.id = regObj.altContentId = replaceElemIdStr;
                    regObj.width = widthStr;
                    regObj.height = heightStr;
                    regObj.expressInstall = xiSwfUrlStr;
                    showExpressInstall(regObj);
                });
            }
        },
        
        getFlashPlayerVersion: function() {
            return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] };
        },
        
        hasFlashPlayerVersion:hasPlayerVersion,
        
        createSWF: function(attObj, parObj, replaceElemIdStr) {
            if (ua.w3cdom && isDomLoaded) {
                return createSWF(attObj, parObj, replaceElemIdStr);
            }
            else {
                return undefined;
            }
        },
        
        createCSS: function(sel, decl) {
            if (ua.w3cdom) {
                createCSS(sel, decl);
            }
        },
        
        addDomLoadEvent:addDomLoadEvent,
        
        addLoadEvent:addLoadEvent,
        
        getQueryParamValue: function(param) {
            var q = doc.location.search || doc.location.hash;
            if (param == null) {
                return q;
            }
            if(q) {
                var pairs = q.substring(1).split("&");
                for (var i = 0; i < pairs.length; i++) {
                    if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
                        return pairs[i].substring((pairs[i].indexOf("=") + 1));
                    }
                }
            }
            return "";
        },
        
        // For internal usage only
        expressInstallCallback: function() {
            if (isExpressInstallActive && storedAltContent) {
                var obj = getElementById(EXPRESS_INSTALL_ID);
                if (obj) {
                    obj.parentNode.replaceChild(storedAltContent, obj);
                    if (storedAltContentId) {
                        setVisibility(storedAltContentId, true);
                        if (ua.ie && ua.win) {
                            storedAltContent.style.display = "block";
                        }
                    }
                    storedAltContent = null;
                    storedAltContentId = null;
                    isExpressInstallActive = false;
                }
            } 
        }
        
    };

}();
/*! SWFObject v2.0 <http://code.google.com/p/swfobject/>

    END
*/


//-- Urchin Tracking Module II (UTM II),$Revision: 1.6 $,
//-- Copyright 2003 Urchin Software Corporation, All Rights Reserved.

/*--------------------------------------------------
   UTM II User Settings
--------------------------------------------------*/
var __utmfsc=1;                 /*-- set client info flag (1=on|0=off) --*/
var __utmdn="auto";             /*-- (auto|none|domain) set the domain name for cookies --*/
var __utmhash="on";             /*-- (on|off) unique domain hash for cookies --*/
var __utmgifpath="/Images/CommonImages/__utm.gif";  /*-- set the web path to the __utm.gif file --*/
var __utmtimeout="1800";        /*-- set the inactive session timeout in seconds --*/

/*--------------------------------------------------
   UTM II Campaign Tracking Settings
--------------------------------------------------*/
var __utmctm=1;                 /*-- set campaign tracking module (1=on|0=off) --*/
var __utmcto="15768000";        /*-- set the campaign timeout in seconds (6 month default) --*/

var __utmccn="utm_campaign";    /*-- campaign name --*/
var __utmcpr="utm_program";     /*-- campaign program --*/
var __utmcrs="utm_refsite";     /*-- campaign referral site --*/
var __utmcrl="utm_refloc";      /*-- campaign referral location --*/
var __utmctr="utm_term";        /*-- campaign term/keyword --*/
var __utmcct="utm_content";     /*-- campaign content --*/

var __utmcui="utm_userid";      /*-- campaign userid --*/
var __utmccu="utm_custom";      /*-- campaign custom field --*/

/*--------------------------------------------------
   Don't modify below this point
--------------------------------------------------*/
var __utmf,__utmdh,__utmd,__utmdom="",__utmu,__utmjv="-",__utmfns;

if (!__utmf) {
   var __utma,__utmb,__utmc;
   var __utmexp="",__utms="",__utmst=0,__utmlf=0;

   /*--------------------------------------------------
      get useful information
   --------------------------------------------------*/
   __utmdh = __utmSetDomain();                               /*--- set the domain and get the domain hash ---*/
   __utma  = document.cookie.indexOf("__utma="+__utmdh);     /*--- cookie a ---*/
   __utmb  = document.cookie.indexOf("__utmb="+__utmdh);     /*--- cookie b ---*/
   __utmc  = document.cookie.indexOf("__utmc="+__utmdh);     /*--- cookie c ---*/
   __utmu  = Math.round(Math.random() * 4294967295);         /*--- unique number ---*/
   __utmd  = new Date();                                     /*--- current date/time epoch ---*/
   __utmst = Math.round(__utmd.getTime()/1000);              /*--- session time ---*/

   if (__utmdn && __utmdn != "") { __utmdom = " domain="+__utmdn+";"; } /*--- domain ---*/
   /*--- timeout ---*/
   if (__utmtimeout && __utmtimeout != "") {
      __utmexp = new Date(__utmd.getTime()+(__utmtimeout*1000));
      __utmexp = " expires="+__utmexp.toGMTString()+";";
   }

   /*--------------------------------------------------
      grab cookies from the commandline
   --------------------------------------------------*/
   __utms = document.location.search;
   if (__utms && __utms != "" && __utms.indexOf("__utma=") >= 0) {
      __utma = __utmGetCookie(__utms,"__utma=","&");
      __utmb = __utmGetCookie(__utms,"__utmb=","&");
      __utmc = __utmGetCookie(__utms,"__utmc=","&");
      if (__utma != "-" && __utmb != "-" && __utmc != "-") __utmlf = 1;
      else if (__utma != "-")                              __utmlf = 2;
   }

   /*--------------------------------------------------
      based on the logic set cookies
   --------------------------------------------------*/
   if (__utmlf == 1) { 
      document.cookie="__utma="+__utma+"; path=/; expires=Sun, 18 Jan 2038 00:00:00 GMT;";
      document.cookie="__utmb="+__utmb+"; path=/;"+__utmexp;
      document.cookie="__utmc="+__utmc+"; path=/;";
      __utmfns=1;
   } else if (__utmlf == 2) { 
      __utma = __utmFixA(__utms,"&",__utmst); 
      document.cookie="__utma="+__utma+"; path=/; expires=Sun, 18 Jan 2038 00:00:00 GMT;";
      document.cookie="__utmb="+__utmdh+"; path=/;"+__utmexp;
      document.cookie="__utmc="+__utmdh+"; path=/;"
      __utmfns=1;
   } else if (__utma >= 0 && __utmb >= 0 && __utmc >= 0) { 
      document.cookie="__utmb="+__utmdh+"; path=/;"+__utmexp+__utmdom;
   } else if (__utma >=0) { 
      __utma = __utmFixA(document.cookie,";",__utmst); 
      document.cookie="__utma="+__utma+"; path=/; expires=Sun, 18 Jan 2038 00:00:00 GMT;"+__utmdom;
      document.cookie="__utmb="+__utmdh+"; path=/;"+__utmexp+__utmdom;
      document.cookie="__utmc="+__utmdh+"; path=/;"+__utmdom;
      __utmfns=1;
   } else if (__utma < 0 && __utmb < 0 && __utmc < 0) { 
      __utma = __utmCheckUTMI(__utmd); 
      if (__utma == "-")  __utma = __utmdh+"."+__utmu+"."+__utmst+"."+__utmst+"."+__utmst+".1"; 
      else                __utma = __utmdh+"."+__utma;
      document.cookie="__utma="+__utma+"; path=/; expires=Sun, 18 Jan 2038 00:00:00 GMT;"+__utmdom;
      document.cookie="__utmb="+__utmdh+"; path=/;"+__utmexp+__utmdom;
      document.cookie="__utmc="+__utmdh+"; path=/;"+__utmdom;
      __utmfns=1;
   } else {
      __utma = __utmdh+"."+__utmu+"."+__utmst+"."+__utmst+"."+__utmst+".1";
      document.cookie="__utma="+__utma+"; path=/; expires=Sun, 18 Jan 2038 00:00:00 GMT;"+__utmdom;
      document.cookie="__utmb="+__utmdh+"; path=/;"+__utmexp+__utmdom;
      document.cookie="__utmc="+__utmdh+"; path=/;"+__utmdom;
      __utmfns=1;
   }
   __utmSetInfo();
   __utmf = 1;
}

function __utmSetInfo() {
   var __utmr="-",__utmp;
   var __utmi = new Image(1,1);
   var __utmsrc = __utmgifpath+"?";
   var loc = document.location;
   __utmr = document.referrer;
   if (!__utmr || __utmr == "") { __utmr = "-"; } 
   else { 
      __utmp = __utmr.indexOf(document.domain); 
      if ((__utmp >= 0) && (__utmp <= 8)) { __utmr = "0"; }
      if (__utmr.indexOf("[") == 0 && __utmr.lastIndexOf("]") == (__utmr.length-1)) { __utmr = "-"; }
   }
   __utmsrc += "utmn="+__utmu;
   if (__utmfsc && __utmfns) {__utmsrc += __utmGetClientInfo(); }
   if (__utmctm)             {__utmsrc += __utmSetCampaignInfo(); }
   __utmsrc += "&utmr="+__utmr+"&utmp="+loc.pathname+loc.search;
   __utmi.src = __utmsrc;
   return 0;
}

function __utmSetCampaignInfo() {
    var __utmcc = "";
    var __utmtmp = "-";
    var __utmcnew = "&utmcn=1";
    var __utmx = document.location.search;
    var __utmz = document.cookie.indexOf("__utmz="+__utmdh);
    if (__utmz > -1) {
       __utmz = __utmGetCookie(document.cookie,"__utmz=",";");
    } else { __utmz = "-"; }

    /*--- check for campaign info ---*/
    __utmtmp = __utmGetCookie(__utmx,__utmccn+"=","&");
    if (__utmtmp == "-" || __utmtmp == "") { return ""; }
    __utmcc += "utmccn="+__utmtmp;
    __utmtmp = __utmGetCookie(__utmx,__utmcpr+"=","&"); if (__utmtmp != "-" && __utmtmp != "") __utmcc += "|utmcpr="+__utmtmp;
    __utmtmp = __utmGetCookie(__utmx,__utmcrs+"=","&"); if (__utmtmp != "-" && __utmtmp != "") __utmcc += "|utmcrs="+__utmtmp;
    __utmtmp = __utmGetCookie(__utmx,__utmcrl+"=","&"); if (__utmtmp != "-" && __utmtmp != "") __utmcc += "|utmcrl="+__utmtmp;
    __utmtmp = __utmGetCookie(__utmx,__utmctr+"=","&"); if (__utmtmp != "-" && __utmtmp != "") __utmcc += "|utmctr="+__utmtmp;
    __utmtmp = __utmGetCookie(__utmx,__utmcct+"=","&"); if (__utmtmp != "-" && __utmtmp != "") __utmcc += "|utmcct="+__utmtmp;

    /*--- check if campaign is already set ---*/
    if (!__utmfns && __utmz.indexOf(__utmcc) != -1) __utmcnew = "";


    /*--- check for userid in cookie ---*/
    __utmtmp = __utmGetCookie(__utmx,__utmcui+"=","&"); 
    if (__utmtmp != "-" && __utmtmp != "") { 
       __utmcc += "|utmcui="+__utmtmp;
    } else {
       __utmtmp = __utmGetCookie(__utmz,"utmcui=","|"); 
       if (__utmtmp != "-" && __utmtmp != "") { __utmcc += "|utmcui="+__utmtmp; } 
    }

    /*--- check for email in cookie ---*/
    __utmtmp = __utmGetCookie(__utmx,__utmccu+"=","&"); 
    if (__utmtmp != "-" && __utmtmp != "") { 
       __utmcc += "|utmccu="+__utmtmp;
    } else {
       __utmtmp = __utmGetCookie(__utmz,"utmccu=","|"); 
       if (__utmtmp != "-" && __utmtmp != "") { __utmcc += "|utmccu="+__utmtmp; } 
    }

    /*--- set the cookie ---*/
    if (!__utmcto || __utmcto == "") { __utmcto = "15768000"; }
    var __utmcx = new Date(__utmd.getTime()+(__utmcto*1000));
    __utmcx = " expires="+__utmcx.toGMTString()+";";
    document.cookie="__utmz="+__utmdh+"."+__utmst+"."+__utmcc+"; path=/; "+__utmcx+__utmdom;

    /*--- set the new campaign flag  ---*/
    return __utmcnew;
}

function __utmGetClientInfo() {
   var __utmtmp="-",__utmsr="-",__utmsa="-",__utmsc="-",__utmbs="-",__utmul="-";
   var __utmje=1,__utmce=1,__utmtz=0;
   if (self.screen) { 
      __utmsr = screen.width+"x"+screen.height;
      __utmsa = screen.availWidth+"x"+screen.availHeight;
      __utmsc = screen.colorDepth+"-bit";
   } else if (self.java) {
      var __utmjk = java.awt.Toolkit.getDefaultToolkit();
      var __utmjksize = __utmjk.getScreenSize();       
      __utmsr = __utmjksize.width+"x"+__utmjksize.height;
   } 
   if( typeof( window.innerWidth ) == 'number' ) {
      __utmbs = window.innerWidth+"x"+window.innerHeight;
   } else { 
     if (document.documentElement && 
       (document.documentElement.offsetHeight || document.documentElement.offsetWidth ) ) {
        __utmbs = document.documentElement.offsetWidth+"x"+document.documentElement.offsetHeight;
     } else if (document.body && (document.body.offsetWidth || document.body.offsetHeight) ) {
        __utmbs = document.body.offsetWidth+"x"+document.body.offsetHeight;
     } 
   }
   for (var i=5;i>=0;i--) {
      var __utmtmp = "<script language='JavaScript1."+i+"'>__utmjv='1."+i+"';</script>"; 
      document.write(__utmtmp);
      if (__utmjv != "-") break;
   }
   if (navigator.language) { __utmul = navigator.language.toLowerCase(); }
   else if (navigator.browserLanguage) { __utmul = navigator.browserLanguage.toLowerCase(); }
   __utmje = navigator.javaEnabled()?1:0;
   if (document.cookie.indexOf("__utmb=") < 0) { __utmce = "0"; }
   if (document.cookie.indexOf("__utmc=") < 0) { __utmce = "0"; }
   __utmtz = __utmd.getTimezoneOffset();
   __utmtz = __utmTZConvert(__utmtz);
   __utmtmp ="";
   __utmtmp += "&utmsr="+__utmsr+"&utmsa="+__utmsa+"&utmsc="+__utmsc+"&utmbs="+__utmbs;
   __utmtmp += "&utmul="+__utmul+"&utmje="+__utmje+"&utmce="+__utmce+"&utmtz="+__utmtz+"&utmjv="+__utmjv;
   return __utmtmp;
}
function __utmLinker(__utmlink) {
   var __utmlp,__utmi,__utmi2,__utmta="-",__utmtb="-",__utmtc="-",__utmtz="-";

   if (__utmlink && __utmlink != "") { 
      if (document.cookie) {
         __utmta = __utmGetCookie(document.cookie,"__utma="+__utmdh,";");
         __utmtb = __utmGetCookie(document.cookie,"__utmb="+__utmdh,";");
         __utmtc = __utmGetCookie(document.cookie,"__utmc="+__utmdh,";");
         __utmtz = __utmGetCookie(document.cookie,"__utmz="+__utmdh,";");
         __utmlp = "__utma="+__utmta+"&__utmb="+__utmtb+"&__utmc="+__utmtc+"&__utmz="+__utmtz;
      }
      if (__utmlp) {
         if (__utmlink.indexOf("?") <= -1) { document.location = __utmlink+"?"+__utmlp; }
         else { document.location = __utmlink+"&"+__utmlp; }
      } else { document.location = __utmlink; }
   }
}
function __utmGetCookie(__utmclist,__utmcname,__utmcsep) {
   if (!__utmclist || __utmclist == "") return "-";
   if (!__utmcname || __utmcname == "") return "-";
   if (!__utmcsep  || __utmcsep  == "") return "-";
   var __utmi, __utmi2, __utmi3, __utmtc="-";

   __utmi = __utmclist.indexOf(__utmcname);
   __utmi3 = __utmcname.indexOf("=")+1;
   if (__utmi > -1) { 
      __utmi2 = __utmclist.indexOf(__utmcsep,__utmi); if (__utmi2 < 0) { __utmi2 = __utmclist.length; }
      __utmtc = __utmclist.substring((__utmi+__utmi3),__utmi2); 
   }
   return __utmtc;
}
function __utmSetDomain() {
   if (!__utmdn || __utmdn == "" || __utmdn == "none") { __utmdn = ""; return 1; }
   if (__utmdn == "auto") {
      var __utmdomain = document.domain;
      if (__utmdomain.substring(0,4) == "www.") {
         __utmdomain = __utmdomain.substring(4,__utmdomain.length);
      }
      __utmdn = __utmdomain;
   }
   if (__utmhash == "off") return 1;
   return __utmHash(__utmdn);
}
function __utmHash(__utmd) {
   if (!__utmd || __utmd == "") return 1;
   var __utmhash=0, __utmg=0;
   for (var i=__utmd.length-1;i>=0;i--) {
      var __utmc = parseInt(__utmd.charCodeAt(i)); 
      __utmhash = ((__utmhash << 6) & 0xfffffff) + __utmc + (__utmc << 14);
      if ((__utmg = __utmhash & 0xfe00000) != 0) __utmhash = (__utmhash ^ (__utmg >> 21));
   }
   return __utmhash;
}
function __utmFixA(__utmcs,__utmsp, __utmst) {
   if (!__utmcs || __utmcs == "") return "-";
   if (!__utmsp || __utmsp == "") return "-";
   if (!__utmst || __utmst == "") return "-";
   var __utmt = __utmGetCookie(__utmcs,"__utma=",__utmsp);
   var __utmlt=0;
   var __utmns=0;
   var __utmi=0;

   if ((__utmi=__utmt.lastIndexOf(".")) > 9) {
      __utmns = __utmt.substring(__utmi+1,__utmt.length);
      __utmns = (__utmns*1)+1;
      __utmt = __utmt.substring(0,(__utmi));

      if ((__utmi = __utmt.lastIndexOf(".")) > 7) {
         __utmlt = __utmt.substring(__utmi+1,__utmt.length);
         __utmt = __utmt.substring(0,(__utmi));
      }

      if ((__utmi = __utmt.lastIndexOf(".")) > 5) {
         __utmt = __utmt.substring(0,(__utmi));
      }
      __utmt += "."+__utmlt+"."+__utmst+"."+__utmns;
   }
   return __utmt;
}

function __utmCheckUTMI(__utmd) {
   var __utm1A = new Array();
   var __utmlst=0,__utmpst=0,__utmlvt=0,__utmlu=0,__utmi=0,__utmpi=0;
   var __utmap = "-";
   var __utmld = "";
   var __utmt2;
   var __utmt = document.cookie;

   while((__utmi = __utmt.indexOf("__utm1=")) >= 0) {
      __utm1A[__utm1A.length] = __utmGetCookie(__utmt,"__utm1=",";");
      __utmt = __utmt.substring(__utmi+7,__utmt.length);
   }
   if (__utm1A.length) {
      var __utmcts = Math.round(__utmd.getTime()/1000);
      var __utmlex = " expires="+__utmd.toGMTString()+";";
      __utmt = document.cookie; 
      if ((__utmi = __utmt.lastIndexOf("__utm3=")) >= 0) {
         __utmlst = __utmt.substring(__utmi,__utmt.length);
         __utmlst = __utmGetCookie(__utmlst,"__utm3=",";");
      }
      if ((__utmi = __utmt.lastIndexOf("__utm2=")) >= 0) {
         __utmpst = __utmt.substring(__utmi,__utmt.length);
         __utmpst = __utmGetCookie(__utmpst,"__utm2=",";");
      }
      for (var i=0;i<__utm1A.length;i++) {
         __utmt = __utm1A[i];
         if ((__utmi = __utmt.lastIndexOf(".")) >= 0) {
            __utmt2 = (__utmt.substring(0,__utmi))*1;
            __utmt  = (__utmt.substring(__utmi+1,__utmt.length))*1;
            if (__utmlvt == 0 || __utmt < __utmlvt) { 
               __utmlvt = __utmt;
               __utmlu  = __utmt2;
            }
         }
      }
      if (__utmlvt && __utmlst) { 
         if (!__utmpst ||  __utmpst > __utmlst) __utmpst = __utmlst;
         __utmap = __utmlu+"."+__utmlvt+"."+__utmpst+"."+__utmlst+".2"; 
      } else if (__utmlvt) { 
         if (!__utmpst || __utmpst > __utmcts) __utmpst = __utmcts;
         __utmap = __utmlu+"."+__utmlvt+"."+__utmpst+"."+__utmcts+".2";
      }
      __utmld = __utmt = document.domain;
      __utmi=__utmpi=0;
      while((__utmi = __utmt.indexOf(".",__utmpi+1)) >= 0) {
         if (__utmpi>0) __utmld = __utmt.substring(__utmpi+1,__utmt.length);
         __utmld = " domain="+__utmld+";"; 
         document.cookie="__utm1=1; path=/;"+__utmlex+__utmld;
         document.cookie="__utm2=1; path=/;"+__utmlex+__utmld;
         document.cookie="__utm3=1; path=/;"+__utmlex+__utmld;
         __utmpi=__utmi;
      }
      document.cookie="__utm1=1; path=/;"+__utmlex;
      document.cookie="__utm2=1; path=/;"+__utmlex;
      document.cookie="__utm3=1; path=/;"+__utmlex;
   }
   return __utmap;
}

function __utmTZConvert(__utmmz) {
   var __utmhr=0,__utmmn=0,__utmsg='+';
   if (__utmmz && __utmmz != "") {
      if (__utmmz <= 0) {__utmsg='+'; __utmmz*=-1; }
      else {__utmsg='-'; __utmmz*=1; }
      __utmhr = Math.floor((__utmmz/60)); 
      __utmmn = Math.floor((__utmmz%60)); 
   }
   if (__utmhr < 10) __utmhr = "0"+__utmhr;
   if (__utmmn < 10) __utmmn = "0"+__utmmn;
   return __utmsg+__utmhr+__utmmn;
}

// jquery modules

/**
* hoverIntent r5 // 2007.03.27 // jQuery 1.1.2+
* <http://cherne.net/brian/resources/jquery.hoverIntent.html>
* 
* @param  f  onMouseOver function || An object with configuration options
* @param  g  onMouseOut function  || Nothing (use configuration options object)
* @author    Brian Cherne <brian@cherne.net>
*/
(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev]);}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev]);};var handleHover=function(e){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;}var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);}if(e.type=="mouseover"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob);},cfg.timeout);}}};return this.mouseover(handleHover).mouseout(handleHover);};})(jQuery);


/* Copyright (c) 2006 Brandon Aaron (http://brandonaaron.net)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * $LastChangedDate: 2007-07-21 18:44:59 -0500 (Sat, 21 Jul 2007) $
 * $Rev: 2446 $
 *
 * Version 2.1.1
 */
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(b($){$.m.E=$.m.g=b(s){h($.x.10&&/6.0/.I(D.B)){s=$.w({c:\'3\',5:\'3\',8:\'3\',d:\'3\',k:M,e:\'F:i;\'},s||{});C a=b(n){f n&&n.t==r?n+\'4\':n},p=\'<o Y="g"W="0"R="-1"e="\'+s.e+\'"\'+\'Q="P:O;N:L;z-H:-1;\'+(s.k!==i?\'G:J(K=\\\'0\\\');\':\'\')+\'c:\'+(s.c==\'3\'?\'7(((l(2.9.j.A)||0)*-1)+\\\'4\\\')\':a(s.c))+\';\'+\'5:\'+(s.5==\'3\'?\'7(((l(2.9.j.y)||0)*-1)+\\\'4\\\')\':a(s.5))+\';\'+\'8:\'+(s.8==\'3\'?\'7(2.9.S+\\\'4\\\')\':a(s.8))+\';\'+\'d:\'+(s.d==\'3\'?\'7(2.9.v+\\\'4\\\')\':a(s.d))+\';\'+\'"/>\';f 2.T(b(){h($(\'> o.g\',2).U==0)2.V(q.X(p),2.u)})}f 2}})(Z);',62,63,'||this|auto|px|left||expression|width|parentNode||function|top|height|src|return|bgiframe|if|false|currentStyle|opacity|parseInt|fn||iframe|html|document|Number||constructor|firstChild|offsetHeight|extend|browser|borderLeftWidth||borderTopWidth|userAgent|var|navigator|bgIframe|javascript|filter|index|test|Alpha|Opacity|absolute|true|position|block|display|style|tabindex|offsetWidth|each|length|insertBefore|frameborder|createElement|class|jQuery|msie'.split('|'),0,{}))

var HeaderDropdownMouseOver = false;
var DropdownIsOpen = false;

// ------------------------------------------------------------------------------
// BEGIN: PrimaryNavOver/PrimaryNavOut
// Variable used to fix IE bug where select/option dropdown is making nav header hide
function isReal() {
    var evt = window.event;
    if (!evt) {
        return true;
    }

    var el;
    if (evt.type === "mouseout") {
        el = evt.toElement;
    } else if (evt.type === "mouseover") {
        el = evt.fromElement;
    }
    if (!el) {
        return false;
    }
    while (el) {
        if (el === evt.srcElement) {
                return false;
        }
        el = el.parentNode;
    }
    return true;
}

var selectMenuOver = false;
function PrimaryNavOver() {
    if (isReal()) {
        selectMenuOver = true;
    }
}
function PrimaryNavOut() {
    if (isReal()) {
        selectMenuOver = false;
    }
}
// END: PrimaryNavOver/PrimaryNavOut


// Jquery
$(document).ready(function() {
    
    $('a.hasHover img').each(function() {
        // Set the original src
        rollsrc = $(this).attr('src');
        
        if(rollsrc.indexOf('.gif') >= 0)
            rollON = rollsrc.replace(/.gif$/ig,'_on.gif'); // strip off extension
        else if(rollsrc.indexOf('.ashx') >= 0)
            rollON = rollsrc.replace(/.ashx$/ig,'_on.ashx'); // strip off extension for ashx too (Chait)
        $('<img>').attr('src', rollON);
    });
    
    // rollovers (if links)
    var imgsrc; 
    $('a.hasHover').mouseover(function(){
        imgsrc = $(this).children('img').attr('src');
        matches = imgsrc.match(/_on/);
        // don't do the rollover if state is already ON
        if (!matches) {
            if(imgsrc.indexOf('.gif') >= 0)
                imgsrcON = imgsrc.replace(/.gif$/ig,'_on.gif'); // strip off extension
            else if(imgsrc.indexOf('.ashx') >= 0)
                imgsrcON = imgsrc.replace(/.ashx$/ig,'_on.ashx'); // strip off extension for ashx too (Chait)

        $(this).children('img').attr('src', imgsrcON);
        }
    });
    $('a.hasHover').mouseout(function(){
        $(this).children('img').attr('src', imgsrc);
    });
    // rollovers (if links)
    $('input.hasHover').mouseover(function(){
        imgsrc = $(this).attr('src');
        matches = imgsrc.match(/_on/);
        // don't do the rollover if state is already ON
        if (!matches) {
        imgsrcON = imgsrc.replace(/.gif$/ig,'_on.gif'); // strip off extension
        $(this).attr('src', imgsrcON);
        }
    });
    $('input.hasHover').mouseout(function(){
        $(this).attr('src', imgsrc);
    });
    
    
    // ------------------------------------------------------------------------------
    // BEGIN: Primary Nav jQuery
    var $overlay = $("#overlayBkgd").fadeTo(200, 0).hide();
    var quickSearchOpen = false;
    
    window.HidePanel = function() {
        if(quickSearchOpen == false) {
            if ($overlay.is(':animated')) {
                $overlay.stop().fadeTo(500, 0).hide();
            } else {
                $overlay.fadeTo(500, 0).hide();
            }
        }
        $($('.header a.tabOn').attr('rel')).fadeOut(500, 0);
        $('a.tabOn').removeClass('tabOn');
    }
    
    window.DelayHidePanel = function(t) {
        switch(t) {
            case 1:
                nav1timer = setTimeout("HidePanel()", 600);
                break;
            case 2:
                nav2timer = setTimeout("HidePanel()", 600);
                break;
            case 3:
                nav3timer = setTimeout("HidePanel()", 600);
                break;
            case 4:
                nav4timer = setTimeout("HidePanel()", 600);
                break;
            case 5:
                nav5timer = setTimeout("HidePanel()", 600);
                break;
            case 6:
                nav6timer = setTimeout("HidePanel()", 600);
                break;
            case 7:
                nav7timer = setTimeout("HidePanel()", 600);
                break;
        }
    }
    window.ClearPanelTimeout = function(t) {
        switch(t) {
            case 1:
                clearTimeout(nav1timer);
                break;
            case 2:
                clearTimeout(nav2timer);
                break;
            case 3:
                clearTimeout(nav3timer);
                break;
            case 4:
                clearTimeout(nav4timer);
                break;
            case 5:
                clearTimeout(nav5timer);
                break;
            case 6:
                clearTimeout(nav6timer);
                break;
            case 7:
                clearTimeout(nav7timer);
                break;
        }
    }
    window.clearTimeoutAll = function() {
        clearTimeout(nav1timer);
        clearTimeout(nav2timer);
        clearTimeout(nav3timer);
        clearTimeout(nav4timer);
        clearTimeout(nav5timer);
        clearTimeout(nav6timer);
        clearTimeout(nav7timer);
    }
    
    function NavFunctions(LinkId, PanelId, t) {
        /* On click - Show Primary Panel */
        $('#'+LinkId).click(function() {
            // Hide Any open Dropdown Menus
            $('div.linkselectContainer:visible').hide();
            clearTimeoutAll();
            /*alert (!$('#'+PanelId+':visible').length);*/
            if ($('#'+PanelId).is(':visible')) {
                /*alert ("Panel Not Open");*/
                HidePanel();
            }
            
            // Show Overlay BG
            /*$overlay
                .width( Math.max($(window).width(), $(document).width()) )
                .height( Math.max($(window).height(), $(document).height()) )
                .stop().fadeTo(500, 0.33).show();*/
            overlayInit();
            $overlay.stop().fadeTo(500, 0.33).show();
            
            // Hide Search results menu
            $('.instantsearchdropdown').fadeOut(200);
            quickSearchOpen = false;
            
            // Turn on Panel
            $("#"+PanelId).fadeIn(500);
            
            // Keeps arrow Blue and sets tab to On
            $(this).addClass('tabOn');
        });
        
        // Arrow mouseover/mouseout
        $("#"+LinkId).hover( function(){
            ClearPanelTimeout(t);
            /* Force quick Panel Hide if another Nav item is hovered */
            /*$(".navPanel").each(function(){
                if ($(this) != $("#"+PanelId)) {
                    HidePanel();
                }
            });*/
            /*$("#"+PanelId).show();*/
        },function() {
            if ($('#'+PanelId).is(':visible')) {
                DelayHidePanel(t); /*;alert('Arrow out');*/
            }
        });
        // Panel mouseover/mouseout
        $("#"+PanelId).hover( function(){
            ClearPanelTimeout(t);
        },function() {
            /* Only hide if there are no Dropdown Menus open inside the Panel */
            /*if (!$('div.linkselectContainer:visible').length) {
                DelayHidePanel(t);
            }*/
            /* above function Modified since now, we're using real dropdowns */
            if (selectMenuOver == false) {
                DelayHidePanel(t);
            }
        });
        // END: Primary Nav jQuery
    }
    
    // Initialize Primary Nav Functions Here:
    var nav1timer;
    NavFunctions("navArrowPeople", "navPeopleMenu", 1);
    var nav2timer;
    NavFunctions("navArrowPractices", "navPracticesMenu", 2);
    var nav3timer;
    NavFunctions("navArrowOffices", "navOfficesMenu", 3);
    var nav4timer;
    NavFunctions("navArrowOurFirm", "navOurFirmMenu", 4);
    var nav5timer;
    NavFunctions("navArrowNews", "navNewsMenu", 5);
    var nav6timer;
    NavFunctions("navArrowPublications", "navPublicationsMenu", 6);
    var nav7timer;
    NavFunctions("navArrowCareers", "navCareersMenu", 7);
    
    
    
    // Get window width and page height
    function getDimensions() {
              winWidth = $(window).width();
              pageHeight = $(document).height()
    }
    // set the size of the overlay
    function sizeOverlay() {
              $("#overlayBkgd").width( winWidth );
              $("#overlayBkgd").height( pageHeight );
    }
    // resize the overlay
    function overlayInit () {
              getDimensions();
              sizeOverlay();
    }
    // run on resize
    $(window).resize(function(){
        if ($("#overlayBkgd:visible").length) {
            overlayInit ();
        }
    });
    
    // ------------------------------------------------------------------------------
    // hover spacer
    $('#subNav ul li.selected').prev().addClass('spacingHover');
    $('#subNav ul li.selected').next().addClass('spacingHover');
    $('#subNav ul li a').hover(function(){ 
        if ($(this).parent('li').hasClass('selected')){
            $(this).parent('li').removeClass('selected').addClass('selectedHover');
            $(this).parent('li').prev().addClass('spacingHover');
            $(this).parent('li').next().addClass('spacingHover');
        } else {
            $(this).parent('li').addClass('selected');
            $(this).parent('li').prev().addClass('spacingHover');
            $(this).parent('li').next().addClass('spacingHover');
        }
    }, function(){ 
        if ($(this).parent('li').hasClass('selectedHover')) {
            $(this).parent('li').removeClass('selectedHover').addClass('selected');
            $(this).parent('li').prev().addClass('spacingHover');
            $(this).parent('li').next().addClass('spacingHover');
        } else {
            $(this).parent('li').removeClass('selected');
            $(this).parent('li').prev().removeClass('spacingHover');
            $(this).parent('li').next().removeClass('spacingHover');
            if ($(this).parent('li').siblings('li.selected')){
                var now = $(this).parent('li').siblings('li.selected');
                $(now).prev().addClass('spacingHover');
                $(now).next().addClass('spacingHover');
            }
        }
    });
     
    // expand and contract practices menus
    // initialize practice settings on page load, this keeps a clean version when js is disabled
    $('a.showSub').show();
    $('a.showNav').show();
    $('ul.listing li ul').hide();
    $('ul.listing li ul li a.selected').parents("ul:first").show();
    $('ul.listing li.active').find("a.showSub").hide();//html("&#8211;");
    $('ul.listing li.active ul').show();
    $('ul.listing li ul li a.on').parents("ul:first").show();
    
    $('ol.listing li ol').hide();
    $('ol.listing li ol li a.selected').parents("ol:first").show();
    $('ol.listing li.active').find("a.showSub").hide();//html("&#8211;");
    $('ol.listing li.active ol').show();
    $('ol.listing li ol li a.on').parents("ol:first").show();   
    $('a.showSub').click(function()
    {
        $($(this).siblings('ul')).toggle();
        $($(this).siblings('ol')).toggle();
    //  $('ul.listing li.active').removeAttr("class");
        return false;
    });

    $('a.showSub').toggle( function()
        {
            $(this).parent(".practiceCol ul li").find("a.showSub").html("&#8211;");
        }, function()
        {
            $(this).parent(".practiceCol ul li").find("a.showSub").html("+");
        });         
        
    // ---------------------------------------------------------
    // BEGIN: alternative expand and contract for navPanel
    /* Show/Hide Level 2 */
    $('a.showNav').toggle( function()
    {
        $(this).html("&#8211;"); // changes to " - "
        
        // If any 1 column item is "on" turn it off
        $(this).parents("ul").find(".showNav_on").click();
        // Hide all 2nd column items
        $($(this).attr("href")).siblings().hide();
        
        $(this).addClass("showNav_on");
        $($(this).attr("href")).show();
        return false;
    }, function()
    {
        // Check if 2nd column has any items "on" If so, click on it again so 3rd column boxes will hide.
        $($(this).attr("href")).find(".showNav_on").click();
        
        $(this).html("+");
        $(this).removeClass("showNav_on");
        $($(this).attr("href")).hide();
        
        return false;
    }); 
    // END: alternative expand and contract for navPanel
    
    $('#advancedSearchLink').click(function()
    {
        $('fieldset#advanced_search').show();
        $('#advancedSearchLink').hide();
        return false;
    });
    
    $('.searchwithintxt').click(function()
    {
        value_remove_focus(this);
        return false;
    });
    
    bindEmailDisclaimerPopup();
    
    //start:dropnav reset button
    $('a.navReset').click(function(){
        $(this).parent().parent().find('select').each(function(){
            $(this).find('option:first').attr('selected', 'selected').parent('select');
        });
        $(this).parent().parent().find('input').val('');
    });
    //end:dropnav reset button

    // ---------------------------------------------------------------------------------------
    //start: printPage
    $('#aPrintPage').click(function(){
        window.print();
    });
    //end:printPage    
    
    function bindEmailDisclaimerPopup()
    {
        $('.emailDisclaimer').live('click', function(){
    
            var path = '/popup-pages/email-disclaimer.aspx?type=disclaimer';
                
            var email = $(this).find(".emailInfo").html();
            if(email != null)
                path += '&email=' + email;
            
            var guid = $(this).find(".guidInfo").html();
            if(guid != null)
                path += '&guid=' + guid;
            
            window.open(path,'disclaimer','toolbar=no,resizable=yes,scrollbars=yes,width=530,height=600');
        });
    }  
    
    //pdf icon options
    /*$('.toolPDF').click(function(){$('.pdf_option').show();})*/
    $('.pdf_option').click(function(){ $('.pdf_option').hide();})
    $('.pdf_tool').mouseover(function(){ $('.pdf_option').show();})
    $('.pdf_tool').mouseout(function(){ $('.pdf_option').hide();})
    
//      $('#aFullBio').click(function(){
//          window.location = "/Non-Sitecore/bioPDF.asp?id=" + $('#employeeGuid').val() + "&type=full&file=" + $('#pdfFileName').val();
//          return false;
//      });
//      $('#aExecutiveBio').click(function(){
//       window.location = "/Non-Sitecore/bioPDF.asp?id=" + $('#employeeGuid').val() + "&type=exec&file=" + $('#pdfFileName').val();
//       return false;
//      });
    
//      $('.pubPDF').click(function(){
//          window.location = "/Non-Sitecore/NewsletterPDF.asp?id=" + $('#issueGuid').val()+ "&file=" + $('#pdfFileName').val();
//          return false;
//      });
        
    // ---------------------------------------------------------------------------------------
    // BEGIN: Font Resizing
    // Reset Font Size
    $('.font_sizing').show();
    
    var fontSizeLevels;//how many levels fonts can increase/decrease
    var fontSizeVariation;//how many PX/EM points to increase/decrease  
    
    //Defaults setings
    fontSizeLevels = 2;//how many levels fonts can increase/decrease
    fontSizeVariation = 1;//how many PX/EM points to increase/decrease

    //Which items to effect
    //Make all elements sizeable in array 'originalFontItems'//

    effectedItems = [];
    // Increase Font Size
    var defaultIncreaseFontNum = 0;
    var increaseFontNum = fontSizeLevels;
    $(".increaseFont").click(function(){
	    
        if (defaultIncreaseFontNum < increaseFontNum){
			if (effectedItems.length == 0) {
				effectedItems = $(".main_content *");
			}
			for(var i=0; i<effectedItems.length; i++) {
				var item = $(effectedItems[i]);
				var currentFontSize = item.css('font-size');
				var currentFontSizeNum = parseFloat(currentFontSize, 10);
                var newFontSize = currentFontSizeNum+fontSizeVariation;
				item.css('font-size', newFontSize);	
			}			
			
			// this is slower
            /*$.each(effectedItems, function(i){
                var currentFontSize = $(this).css('font-size');
                currentFontSizeNum = parseFloat(currentFontSize, 10);
                var newFontSize = currentFontSizeNum+fontSizeVariation;
                $(this).css('font-size', newFontSize);
            }); */
            defaultIncreaseFontNum = defaultIncreaseFontNum+fontSizeVariation;
            defaultDecreaseFontNum = defaultDecreaseFontNum-fontSizeVariation;
        }
        return false;
    });
    
    // Decrease Font Size
    var defaultDecreaseFontNum = 0;
    var decreaseFontNum = fontSizeLevels;
    $(".decreaseFont").click(function(){
        if (defaultDecreaseFontNum < (decreaseFontNum)){
			if (effectedItems.length == 0) {
				effectedItems = $(".main_content *");
			}
			for(var i=0; i<effectedItems.length; i++) {
				var item = $(effectedItems[i]);
				var currentFontSize = item.css('font-size');
				var currentFontSizeNum = parseFloat(currentFontSize, 10);
                var newFontSize = currentFontSizeNum-fontSizeVariation;
				item.css('font-size', newFontSize);	
			}		
		
		
            /*$.each(effectedItems, function(i){
                var currentFontSize = $(this).css('font-size');
                currentFontSizeNum = parseFloat(currentFontSize, 10);
                var newFontSize = currentFontSizeNum-fontSizeVariation;
                $(this).css('font-size', newFontSize);
            }); */
            defaultIncreaseFontNum = defaultIncreaseFontNum-fontSizeVariation;
            defaultDecreaseFontNum = defaultDecreaseFontNum+fontSizeVariation;
        }
        return false;
    });
    // END: Font Resizing   
});

/**
 * jQuery.labelify - Display in-textbox hints
 * Stuart Langridge, http://www.kryogenix.org/
 * Released into the public domain
 * Date: 25th June 2008
 * @author Stuart Langridge
 * @version 1.3
 *
 *
 * Basic calling syntax: $("input").labelify();
 * Defaults to taking the in-field label from the field's title attribute
 *
 * You can also pass an options object with the following keys:
 *   text
 *     "title" to get the in-field label from the field's title attribute 
 *      (this is the default)
 *     "label" to get the in-field label from the inner text of the field's label
 *      (note that the label must be attached to the field with for="fieldid")
 *     a function which takes one parameter, the input field, and returns
 *      whatever text it likes
 *
 *   labelledClass
 *     a class that will be applied to the input field when it contains the
 *      label and removed when it contains user input. Defaults to blank.
 *  
 */
jQuery.fn.labelify=function(a){a=jQuery.extend({text:"title",labelledClass:""},a);var b={title:function(e){return $(e).attr("title")},label:function(e){return $("label[for="+e.id+"]").text()}};var d;var c=$(this);return $(this).each(function(){if(typeof a.text==="string"){d=b[a.text]}else{d=a.text}if(typeof d!=="function"){return}var f=d(this);if(!f){return}$(this).data("label",d(this).replace(/\n/g,""));$(this).focus(function(){if(this.value===$(this).data("label")){this.value=this.defaultValue;$(this).removeClass(a.labelledClass)}}).blur(function(){if(this.value===this.defaultValue){this.value=$(this).data("label");$(this).addClass(a.labelledClass)}});var e=function(){c.each(function(){if(this.value===$(this).data("label")){this.value=this.defaultValue;$(this).removeClass(a.labelledClass)}})};$(this).parents("form").submit(e);$(window).unload(e);if(this.value!==this.defaultValue){return}this.value=$(this).data("label");$(this).addClass(a.labelledClass)})};

$(function(){
    $("input").labelify();

    $('a.reset').click(function(){
        //console.log($(this).parent());
        var fieldset = $(this).parents('fieldset')[0];
        
        // This clears any input elements of type text
        $(fieldset).find(':text').val('');
        
        // Clear the hidden select elements to the default value
        $(fieldset).find('select').each(function(){
            this.selectedIndex=0
        });
        return false;
    });
});

function toggleSymbol(e) {
    if (e.innerHTML == "+")
        e.innerHTML = "&#8211;"
    else
        e.innerHTML = "+";
}

function popUp(URL) {
    day = new Date();
    id = day.getTime();
    eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=1,resizable=1,width=985,height=850');");
}        

function isValidDateMMddyyyy(strDate)
{
    var bIsValid = false;
    
    var reDateFormat = /^\d{1,2}\/\d{1,2}\/\d{4}$/
    var d = Date.parse(strDate);
    
    // does the string resemble a MM/dd/yyyy date?
    if(!isNaN(d) && strDate.match(reDateFormat))
    {
        var aryDate = strDate.split('/');
        
        // convert to int and remove any leading zeros
        for(var i = 0; i < aryDate.length; i++)
            aryDate[i] = parseInt(aryDate[i].replace(/^0/, ""));
        
        // do the date parts match up?
        bIsValid = aryDate[0] == d.getMonth() + 1 && aryDate[1] == d.getDate() && aryDate[2] == d.getFullYear();
        
        delete aryDate;
        aryDate = null;
    }
    
    return bIsValid;
}

function isValidDateDDmmyyyy(strDate)
{
    var bIsValid = false;
    
    var reDateFormat = /^\d{1,2}\/\d{1,2}\/\d{4}$/
    
    // does the string resemble a DD/mm/yyyy date?
    if(strDate.match(reDateFormat))
    {
        var aryDateString = strDate.split('/');
        var aryDateStringNew = new Array();
        var aryDateParts = new Array();
        
        // convert to int and remove any leading zeros
        for(var i = 0; i < aryDateString.length; i++)
        {
            switch(i)
            {
                case 0:
                    aryDateStringNew[1] = aryDateString[i] + "/";
                    aryDateParts[1] = parseInt(aryDateString[i]);
                break;
                
                case 1:
                    aryDateStringNew[0] = aryDateString[i] + "/";
                    aryDateParts[0] = parseInt(aryDateString[i]);
                break;
                
                default:
                    aryDateStringNew[i] = aryDateString[i];
                    aryDateParts[i] = parseInt(aryDateString[i]);
                break;
            }
        }
        
        var d = new Date(Date.parse(aryDateStringNew.join("")));
        bIsValid = aryDateParts[0] == d.getMonth() + 1 && aryDateParts[1] == d.getDate() && aryDateParts[2] == d.getFullYear();
        
        delete aryDateString
        delete aryDateStringNew;
        delete aryDateParts;
        
        aryDateString = null;
        aryDateStringNew = null;
        aryDateParts = null;
    }
    
    return bIsValid;
}

function isValidEmailAddress(strEmail)
{
    var reEmail = /^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
    return reEmail.test(strEmail);
}
