//PNG Transparency Function - WIN IE 5.5 or Higher
	
function fixPNG(myImage) {

	//Detect IE5.5+
	version = 0;

	if (navigator.appVersion.indexOf("MSIE") != -1){
		temp = navigator.appVersion.split("MSIE");
		version = parseFloat(temp[1]);
	}

	if (version >= 4) {
		var imgID = (myImage.id) ? "id='" + myImage.id + "' " : ""
		var imgClass = (myImage.className) ? "class='" + myImage.className + "' " : ""
		var imgTitle = (myImage.title) ? "title='" + myImage.title + "' " : "title='" + myImage.alt + "' "
		var imgStyle = "display:inline-block;" + myImage.style.cssText 
		var strNewHTML = "<span " + imgID + imgClass + imgTitle
		
		strNewHTML += " style=\"" + "width:" + myImage.width + "px; height:" + myImage.height + "px;" + imgStyle + ";"
		strNewHTML += "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
		strNewHTML += "(src=\'" + myImage.src + "\', sizingMethod='scale');\"></span>" 
		
		myImage.outerHTML = strNewHTML
		
		//alert("MSIE");
	}

}//End PNG Transparency Function

function ecMenu(itemID){
	var mi;
	mi = document.getElementById(itemID).getElementsByTagName("li");
	for(i=0; i<mi.length; i++){
		if(mi[i].className == "subC"){
			si = mi[i].nextSibling.nextSibling;
			si.style.display = "block";
			mi[i].onclick = function(){
				if(this.className == "subC"){
					this.nextSibling.nextSibling.style.display = "none";
					this.className = "subE";
				}else{
					this.nextSibling.nextSibling.style.display = "block";
					this.className = "subC";
				}
			}			
		}else if(mi[i].className == "subE"){
			si = mi[i].nextSibling.nextSibling;
			si.style.display = "none";
			mi[i].onclick = function(){
				if(this.className == "subC"){
					this.nextSibling.nextSibling.style.display = "none";
					this.className = "subE";
				}else{
					this.nextSibling.nextSibling.style.display = "block";
					this.className = "subC";
				}
			}	
		}
	}
}

/* SHOW SUBMENUS - Created By Shawn Her */
function show(box){
	if(document.getElementById(box).parentNode.getElementsByTagName("ul")[0].style.display == 'block'){
		var hidesub;
	}
	m = document.getElementById(box).parentNode.parentNode.getElementsByTagName('ul');
	for(i=0;i<m.length;i++){
		m[i].style.display = "none";
	}
	if(!hidesub){
		document.getElementById(box).parentNode.getElementsByTagName("ul")[0].style.display = 'block';
		clearTimeout(document.getElementById(box).tto);
	}
	clearTimeout(document.getElementById(box).tto);
}
function hide(eID){
	eID.parentNode.getElementsByTagName("ul")[0].style.display = "none";
}
function timeout(tohide){
	tohide.tto = setTimeout(function(){tohide.parentNode.getElementsByTagName("ul")[0].style.display = "none"}, 500);
}
function menu(menuID){
	if (document.getElementById(menuID))
	{	
		m = document.getElementById(menuID).getElementsByTagName('ul');
		for(i=0;i<m.length;i++){
			s = m[i].parentNode.getElementsByTagName('a')[0];
			s.onmouseover = function(){if(typeof show == 'function'){show(this.id);}};
			s.onmouseout = function(){if(typeof timeout == 'function'){timeout(this);}}
			m[i].onmouseover = function(){clearTimeout(this.parentNode.getElementsByTagName('a')[0].tto);}
			m[i].onmouseout = function(){if(typeof timeout == 'function'){timeout(this.parentNode.getElementsByTagName('a')[0]);}}
		}
	}
}

/* TABS - Created By Shawn Her*/
function tabs(tabID){
	var p, l, id;
	p = document.getElementById(tabID).getElementsByTagName("li"); //get all list item(li) tags in specified element
	for(i=0; i<p.length; i++){ //loop through list items
		if(p[i].title == ""){ //if list items has no title attribute then do nothing
			//do nothing
		}else{ // if list items contains a title...
			l = p[i].getElementsByTagName("a")[0]; //get all first anchor(a) tags in list items
			l.onclick = function(){ //when link is clicked...
				//if element displayed is currently active:
				//false - will hide if clicked twice
				//active - will keep element active unless different element with the specified parent(tabID) is clicked
				var active;
				if(this.parentNode.className == "active"){var active = true;}
				id = this.parentNode.title; //set parent list item title attributes as id
				for(i=0; i<p.length; i++){ //loop through all first anchor tags 
					if(p[i].title == ""){ //if anchor tag does not consist of a title attribute then do nothing
						//do nothing
					}else{ //if list item tag contains a title attribute...
						l = p[i].getElementsByTagName("a")[0];
						//selects parent list item title attribute as the ID and displays the corresponding element of that ID
						document.getElementById(l.parentNode.title).style.display = "none"; 
						l.parentNode.className = "inactive"; //remove parent list item class
					}
				}// end for loop
				
				if(!active){
					if(this.parentNode.title == ""){
						//nothing
					}else{
						document.getElementById(this.parentNode.title).style.display = "";
						this.parentNode.className = "active";
					}
				}
			}//end onclick
		}// end if
	}//end for loop
	return false;
}
