// saves document.getElementById() function to getId() shorthand - checks for existance first

if (typeof getId != 'function') getId = function(value) {	return document.getElementById(value) }



// adds function to onload event without removing old events - checks for existance first

if (typeof addLoadEvent != 'function') {

	addLoadEvent = function (func) {

		var oldOnload = window.onload;

		if (typeof window.onload != 'function') {

			window.onload = func;

		} else {

			window.onload = function() {

				oldOnload();

				func();

			}

		}

	}

}



// Fix PNGs in IE6

function pngFix() {

	var arVersion = navigator.appVersion.split("MSIE")

	var version = parseFloat(arVersion[1])

	

	if ((version >= 5.5) && (version < 7.0) && (document.body.filters)) 

	{

		 for(var i=0; i<document.images.length; i++)

		 {

				var img = document.images[i]

				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='IE6PNG " + img.className + "' " : "class='IE6PNG'"

					 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='crop');\"></span>" 

					 img.outerHTML = strNewHTML

					 i = i-1

				}

		 }

	}

}

addLoadEvent (pngFix);



// Fix dropouts in IE6

function iehover() {

	var arVersion = navigator.appVersion.split("MSIE")

	var version = parseFloat(arVersion[1])

	

	if ((version >= 5.5) && (version < 7.0) && (document.body.filters)) 

	{

		var TagName = document.getElementsByTagName("li"); 

		for (var Status=0; Status<TagName.length; Status++)

		{

			TagName[Status].onmouseover=function()

				{this.className+=" iehover";}

			TagName[Status].onmouseout=function()

				{this.className=this.className.replace(new RegExp(" iehover\\b"), "");} 

		}

	}

}

addLoadEvent (iehover);
