﻿// -------------------------------------------
// (jQuery) open top links in parent window
// -------------------------------------------
//$('#xmwx_header a').attr('target', '_parent');

// -------------------------------------------
// load event
// -------------------------------------------
function addLoadEvent(func) {
    var oldonload = window.onload;
    if (typeof window.onload != 'function') {
        window.onload = func;
    } else {
        window.onload = function() {
            oldonload();
            func();
        }
    }
}

// -------------------------------------------
// stripe tables function
// -------------------------------------------
function stripeTables() {
    if(!document.getElementsByTagName) return false;
    var tables = document.getElementsByTagName("table");
    for (var i=0; i<tables.length; i++) {
        var odd = false;
        var rows = tables[i].getElementsByTagName("tr");
        for (var j=0; j<rows.length; j++) {
            if (odd == true) {
                rows[j].style.backgroundColor = "#dddddd";
                odd = false;
            } else {
                odd = true;
            }
        }
    }
}
addLoadEvent(stripeTables);

// -------------------------------------------
// fly-out menu fix for IE
// -------------------------------------------
// Show only to Win IE...
if (document.all && window.print){
// IE menu code from A List Apart
// http://www.alistapart.com/articles/horizdropdowns
startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("xmwx_nav");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
  }
  node.onmouseout=function() {
  this.className=this.className.replace(" over", "");
   }
   }
  }
 }
}
window.onload=startList;
}