
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)
        {
        		if (document.getElementById("Quote1"))
            	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()
{
		if (document.getElementById("Quote1"))
    	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);
*/

function showhide(id){
if (document.getElementById){
obj = document.getElementById(id);
if (obj.style.display == "none"){
obj.style.display = "";
} else {
obj.style.display = "none";
}
}
} 