
function MM_reloadPage(init) 
{  //reloads the window if Nav4 resized
    if (init==true) with (navigator) {
        if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
            document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
     else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH)
        location.reload();
}
MM_reloadPage(true);


function MM_openBrWindow(theURL,winName,features) 
{ //v2.0
  window.open(theURL,winName,features);
}



function sfHover() 
{ 
//Added 2007-05-24, unknown need DMac
    var sfEls = document.getElementById("nav").getElementsByTagName("LI");
    for (var i=0; i<sfEls.length; i++)
    {
        sfEls[i].onmouseover=function() {this.className+=" sfhover";}
        sfEls[i].onmouseout=function() {this.className=this.className.replace(new RegExp(" sfhover\\b"), "");}
    }
}
//if (window.attachEvent) window.attachEvent("onload", sfHover);

function setBookmark(url,str)
{
    if(str=='')str=url;
    if (document.all)window.external.AddFavorite(url,str);
    else alert('Press CTRL and D to add a bookmark to:\n"'+url+'".');
}

function calcHeight(name) {
//find the height of the internal page
    document.getElementById(name).height = 0;
    var the_height = document.getElementById(name).contentWindow.document.body.scrollHeight;
//change the height of the iframe
    document.getElementById(name).height = the_height;
}


var xmlFile = "/rss/rssQuotes.aspx";
var xmlDoc;
function loadQuotes()
{
//Original Load Quotes + wsa_include_tracking piggybacked.  Remove this after migration to jsInitPage
//load xml file
// code for IE
    if (window.ActiveXObject)
    {
        xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
        xmlDoc.async=false;
        xmlDoc.load(xmlFile);
        MakeQuotes()
    }
// code for Mozilla, etc.
    else if (document.implementation && document.implementation.createDocument)
    {
        xmlDoc= document.implementation.createDocument("","",null);
        xmlDoc.load(xmlFile);
        xmlDoc.onload=MakeQuotes
    }
    else
    {
//        alert('Your browser cannot handle this script');
    }
    jswebsitealivetracking();
}

function jsloadQuotes()
{
//Load Quotes
    if (window.ActiveXObject)
    {
        xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
        xmlDoc.async=false;
        xmlDoc.load(xmlFile);
        MakeQuotes();
    }
    else if (document.implementation && document.implementation.createDocument)
    {
        try{
            xmlDoc= document.implementation.createDocument("","",null);
            xmlDoc.load(xmlFile);
            xmlDoc.onload=MakeQuotes();
        } catch (e)
        {
            document.getElementById("Quote1").innerHTML = "I am completely in love with your services!<br /><strong>Arthel - Washington</strong>";
        }
    }
    else
    {
//        alert('Your browser cannot handle this script');
    }
}

function MakeQuotes()
{
    document.getElementById("Quote1").innerHTML= MakeQuote(0);
}

function MakeQuote(QuoteID)
{
    var rv = "";

    rv = rv + "\"" + xmlDoc.getElementsByTagName("Quote")[QuoteID].firstChild.nodeValue + "\"<br />";
    rv = rv +"<strong>"+ xmlDoc.getElementsByTagName("Author")[QuoteID].firstChild.nodeValue + " - ";
    rv = rv + xmlDoc.getElementsByTagName("Location")[QuoteID].firstChild.nodeValue + "</strong>";
    return rv;
}

menu_status = new Array();
function showHide(theid){
//Menu Hide/Show
    if (document.getElementById) {
    var switch_id = document.getElementById(theid);

        if(menu_status[theid] != 'show') {
           switch_id.className = 'show';
           menu_status[theid] = 'show';
        }else{
           switch_id.className = 'hide';
           menu_status[theid] = 'hide';
        }
    }
}

function jswebsitealivetracking(){
	var js = document.createElement('script');
	js.setAttribute('language', 'javascript');
	js.setAttribute('type', 'text/javascript');
	js.setAttribute('src',document.location.protocol + '//www.websitealive7.com/27/Visitor/vTracker_v2.asp?websiteid=0&groupid=27');
	document.getElementsByTagName('head').item(0).appendChild(js);
}
	
function jsInitPage(PageFlags){
//Added 2007-05-24, DMac
//PageFlags do nothing right now.  
//0 is passed by default, which enables all default functions.  
//bitwise array page inits 
//bit 1 - Do Nothing - Useful it no action is wanted
//bit 2 - Quotes
//bit 4 - jswebsitealivetracking

//Examples
//if you Just want Quotes, Pass 2
//if you Just want jswebsitealivetracking, Pass 4
//If You want Quotes and jswebtracking, nothing else, Pass 6 (for 2+4)

    if (typeof PageFlags == 'undefined')
    {
        PageFlags=0;
    }
    if(PageFlags===null){ //=== without type casting
        PageFlags=0;
    }
    
    if(PageFlags==0)
    {
        jsloadQuotes();
        jswebsitealivetracking();
    }else
    {
        if((PageFlags & 1)==1){}
        if((PageFlags & 2)==2){jsloadQuotes();}
        if((PageFlags & 4)==4){jswebsitealivetracking();}
    }
}

sfHover = function() {
    var sfEls = document.getElementById("nav").getElementsByTagName("LI");
    for (var i=0; i<sfEls.length; i++) {
        sfEls[i].onmouseover=function() {
            this.className+=" sfhover";
        }
        sfEls[i].onmouseout=function() {
            this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
        }
    }
}
if (window.attachEvent) window.attachEvent("onload", sfHover);


//Added 2007-10-22, Rob for Movies
/*	if (AC_FL_RunContent == 0) {
		alert("This page requires flash/swf/AC_RunActiveContent.js.");
	} else {
		AC_FL_RunContent(
			'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0',
			'width', '780',
			'height', '250',
			'src', 'Accu_Demo',
			'quality', 'high',
			'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
			'align', 'middle',
			'play', 'true',
			'loop', 'true',
			'scale', 'showall',
			'wmode', 'window',
			'devicefont', 'false',
			'id', 'Accu_Demo',
			'bgcolor', '#ffffff',
			'name', 'Accu_Demo',
			'menu', 'true',
			'allowFullScreen', 'false',
			'allowScriptAccess','sameDomain',
			'movie', 'Accu_Demo',
			'salign', ''
			); //end AC code
	}
*/

//Added 2007-10-31, Rob for Hide Show on conference call page
function showhide(id){
if (document.getElementById){
obj = document.getElementById(id);
if (obj.style.display == "none"){
obj.style.display = "";
} else {
obj.style.display = "none";
}
}
} 