// JavaScript Document
<!--

function init(){
	addEvent(window, "load", alterAnchors);
	addEvent(window, "load", correctPNG);
}

function addEvent(obj, evType, fn){
	if (obj.addEventListener){
   		obj.addEventListener(evType, fn, false);
   		return true;
	}else if (obj.attachEvent){
   		var r = obj.attachEvent("on"+evType, fn);
   		return r;
 	}else{
   		return false;
 	}
}
	
function alterAnchors(){
	as = document.getElementsByTagName('a');
	var returnstr;
	if(as.length>0){
		for(var i = 0; i<as.length;i++){
			atitle = String(as[i].title);
			if(atitle.indexOf("New Window: ")==0){
				returnstr = returnstr + "\n"+as[i].href+" (new window)";
				as[i].target="_blank";
			}
		}
	}
	//alert(returnstr);
}

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 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='" + 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
            i = i-1
         }
      }
   }
}

function writeflash(inobj, inmov,width,height){
	d = document.getElementById(inobj);
	flashhtml = "<object data=\""+inmov+"\" width=\""+width+"\" height=\""+height+"\" type=\"application/x-shockwave-flash\"><param name=\"type\" value=\"application/x-shockwave-flash\" /><param name=\"src\" value=\""+inmov+"\" /><param name=\"data\" value=\""+inmov+"\" /><param name=\"codebase\" value=\""+inmov+"\" /><param name=\"movie\" value=\""+inmov+"\" /><param name=\"quality\" value=\"high\" /><param name=\"bgcolor\" value=\"#ffffff\" /><param value=\"transparent\" name=\"wmode\" /><param name=\"pluginurl\" value=\"http://www.macromedia.com/go/getflashplayer\" /><img src=\"resources/layout_02.jpg\" class=\"rightphoto\" width=\"634\" height=\"162\" alt=\"Banner photo\" /></object>";
	//alert(flashhtml);
	d.innerHTML = flashhtml;
}
	
function CreateControl(DivID, CLSID, ObjectID, width, height, inmov){
	var d = document.getElementById(DivID);
	d.innerHTML = "<object data=\""+inmov+"\" id=\""+ObjectID+"\" width=\""+width+"\" height=\""+height+"\" classid=\""+CLSID+"\" type=\"application/x-shockwave-flash\"><param name=\"type\" value=\"application/x-shockwave-flash\" /><param name=\"src\" value=\""+inmov+"\" /><param name=\"data\" value=\""+inmov+"\" /><param name=\"codebase\" value=\""+inmov+"\" /><param name=\"movie\" value=\""+inmov+"\" /><param name=\"quality\" value=\"high\" /><param name=\"bgcolor\" value=\"#ffffff\" /><param value=\"transparent\" name=\"wmode\" /><param name=\"pluginurl\" value=\"http://www.macromedia.com/go/getflashplayer\" /></object>";
	//<img src=\"resources/layout_02.jpg\" class=\"rightphoto\" width=\"634\" height=\"162\" alt=\"Banner photo\" />
}

function expandItemAll(group) {
	//target_objs = document.getElementsById(indexOf(group)==0);
	target_objs = document.getElementById("content").getElementsByTagName("div");
	for(var i = 0; i<target_objs.length;i++){
		current_obj = target_objs[i];
		current_obj_id = String(current_obj.id);
		if(current_obj_id.indexOf(group)==0){
			target_obj = current_obj;
			target_obj_children = target_obj.getElementsByTagName("div");
			for(var i_sub = 0; i_sub<target_obj_children.length;i_sub++){
				current_obj2 = target_obj_children[i_sub];
				if(current_obj2.className=='content'){
					current_obj2.style.display = 'block';
					
				}
				if(current_obj2.className=='controlbar'){
					for(var ic = 0; ic<current_obj2.childNodes.length;ic++){
						if(current_obj2.childNodes[ic].className=='controls'){
							as = current_obj2.childNodes[ic].getElementsByTagName("a");
							as[1].style.display = "none";
							as[0].style.display = "inline";
						}
					}
				}
			}
		}
	}
}
function expandItem(group,item_num) {
	//target_obj = inobj.parentNode.parentNode.parentNode;
	target_obj = document.getElementById(group+item_num);
	target_obj_children = target_obj.getElementsByTagName("div");
	for(var i = 0; i<target_obj_children.length;i++){
		current_obj = target_obj_children[i];
		if(current_obj.className=='content'){
			current_obj.style.display = 'block';
		}
		if(current_obj.className=='controlbar'){
			for(var ic = 0; ic<current_obj.childNodes.length;ic++){
				if(current_obj.childNodes[ic].className=='controls'){
					as = current_obj.childNodes[ic].getElementsByTagName("a");
					as[1].style.display = "none";
					as[0].style.display = "inline";
				}
			}
		}
	}
}

function collapseItemAll(group) {
	//target_objs = document.getElementsById(indexOf(group)==0);
	target_objs = document.getElementById("content").getElementsByTagName("div");
	for(var i = 0; i<target_objs.length;i++){
		current_obj = target_objs[i];
		current_obj_id = String(current_obj.id);
		if(current_obj_id.indexOf(group)==0){
			target_obj = current_obj;
			target_obj_children = target_obj.getElementsByTagName("div");
			for(var i_sub = 0; i_sub<target_obj_children.length;i_sub++){
				current_obj2 = target_obj_children[i_sub];
				if(current_obj2.className=='content'){
					current_obj2.style.display = 'none';
				}
				if(current_obj2.className=='controlbar'){
					for(var ic = 0; ic<current_obj2.childNodes.length;ic++){
						if(current_obj2.childNodes[ic].className=='controls'){
							as = current_obj2.childNodes[ic].getElementsByTagName("a");
							as[0].style.display = "none";
							as[1].style.display = "inline";
						}
					}
				}
			}
		}
	}
}
function collapseItem(group,item_num){
	target_obj = document.getElementById(group+item_num);
	target_obj_children = target_obj.getElementsByTagName("div");
	for(var i = 0; i<target_obj_children.length;i++){
		current_obj = target_obj_children[i];
		if(current_obj.className=='content'){
			current_obj.style.display = 'none';
		}
		if(current_obj.className=='controlbar'){
			for(var ic = 0; ic<current_obj.childNodes.length;ic++){
				if(current_obj.childNodes[ic].className=='controls'){
					as = current_obj.childNodes[ic].getElementsByTagName("a");
					as[0].style.display = "none";
					as[1].style.display = "inline";
				}
			}
		}
	}
}

init()
-->