addLoadEvent(function() {
	var anchors = document.getElementsByTagName("a"); 
	for (var i=0; i<anchors.length; i++) { 
		var anchor = anchors[i]; 
		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") {
			anchor.target = "_blank"; 
		}
	} 
})

addLoadEvent(function() {
	if (typeof sIFR == "function") {
		sIFR.replaceElement("#textWrap h2", named({sFlashSrc:"/flash/trajanPro.swf", sColor:"#ffffff", sWmode:"transparent", sFlashVars:"offsetLeft=20"}));
	};
	
	if(document.getElementById("flashWrap")){
		var so = new SWFObject("/flash/avlogFlash.swf", "avlogFlash", "492", "221", "8", "#ffffff"); 
		so.addParam("loop", "false");   				
		so.write("flashWrap");  
	}
})

/**** NAV MENU DROPDOWNS ***/
addLoadEvent(function() {
	var navLIs = document.getElementById("navWrap").getElementsByTagName("LI");
	for (var i=0; i<navLIs.length; i++) {
		navLIs[i].onmouseover = function() {
			if (this.className.match("parent") != null) {
				this.className += " both";
			} 
			this.className += " active";
		}
		navLIs[i].onmouseout = function() {
			this.className = this.className.replace(/active/g,"");
			this.className = this.className.replace(/both/g,"");
		}
	}
})

addLoadEvent(function() {
	var agt=navigator.userAgent.toLowerCase();
	var appVer = navigator.appVersion.toLowerCase();
	var is_minor = parseFloat(appVer);
	var is_major = parseInt(is_minor);
	var iePos = appVer.indexOf('msie');
	if (iePos !=-1) {
		is_minor = parseFloat(appVer.substring(iePos+5,appVer.indexOf(';',iePos)))
		is_major = parseInt(is_minor);
	}
	var is_ie = ((iePos!=-1));
	var is_ie6 = (is_ie && is_major == 6);
	if (is_ie6) {
		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;
			}
		}
	}
})

