﻿// main navigation 
function yadm(){var l='isParent',O='isActive',c='nohover',I='dhtml',C='hiddenChild',V='shownChild',o='na',Z=document.getElementById('nav');
if(!document.getElementById&&!document.createTextNode){return}
if(Z){Z.className+=Z.className==''?I:' '+I;var v,z,i,X,x;v=Z.getElementsByTagName('li');for(z=0;z<v.length;z++){i=v[z].getElementsByTagName('ul')[0]
if(i){v[z].childNodes[0].onclick=function(){return true}
v[z].className+=v[z].className==''?l:' '+l;x=true;if(new RegExp('\\b'+o+'\\b').test(v[z].className)){x=false}
if(x){for(X=0;X<i.getElementsByTagName('li').length;X++){if(new RegExp('\\b'+o+'\\b').test(i.getElementsByTagName('li')[X].className)){x=false;break}}}
if(x){i.className+=i.className==''?C:' '+C;if(new RegExp('\\b'+c+'\\b').test(Z.className)){v[z].onclick=function(){w(this)}}else{v[z].onclick=function(){w(this)}
v[z].onmouseover=function(){w(this)}
v[z].onmouseout=function(){w(null)}}}else{v[z].keepopen=1;i.className+=i.className==''?V:' '+V;v[z].className=v[z].className.replace(l,O)}}}}
function w(x){var I,i,o;v=Z.getElementsByTagName('li');for(z=0;z<v.length;z++){i=v[z]==x;o=function(i,I,l){i.className=i.className.replace(I,l)}
if(!v[z].keepopen){I=v[z].getElementsByTagName('ul')[0];if(I){if(new RegExp('\\b'+c+'\\b').test(Z.className)){if(new RegExp('\\b'+O+'\\b').test(v[z].className)){o(I,i?V:C,i?C:V);o(v[z],i?O:l,i?l:O)}else{o(I,i?C:V,i?V:C);o(v[z],i?l:O,i?O:l)}}else{o(I,i?C:V,i?V:C);o(v[z],i?l:O,i?O:l)}}}}}}


var nextOnload = window.onload;
function myOnload()
{
yadm();
correctPNG();
}
window.onload = myOnload;


function correctPNG() // correctly handle PNG transparency in Win IE 5.5 & 6. 
{ 
    var arVersion = navigator.appVersion.split("MSIE") 
    var version = parseFloat(arVersion[1]) 
    if ((version >= 5.5) && (document.body.filters)) 
    { 
       for(var j=0; j<document.images.length; j++) 
       { 
          var img = document.images[j] 
          var imgName = img.src.toUpperCase() 
          if (imgName.substring(imgName.length-3, imgName.length) == "PNG") 
          { 
             var imgID = (img.id) ? "id='" + img.id + "' " : "" 
             var imgClass = (img.className) ? "class='" + img.className + "' " : "" 
             var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' " 
             var imgStyle = "display:inline-block;" + img.style.cssText 
             if (img.align == "left") imgStyle = "float:left;" + imgStyle 
             if (img.align == "right") imgStyle = "float:right;" + imgStyle 
             if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle 
             var strNewHTML = "<span " + imgID + imgClass + imgTitle 
             + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";" 
             + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader" 
             + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
             img.outerHTML = strNewHTML 
             j = j-1 
          } 
       } 
    }     
} 

