// site wide javascript
function init_ie6_fixes(){
	if (!/MSIE (5\.5|6\.)/.test(navigator.userAgent)) return;
	else if (document.all && document.getElementById && document.styleSheets && document.styleSheets[0] && document.styleSheets[0].addRule){
		// add hover pseudo class to <li>
		navRoot = document.getElementById("navigation");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					curCname = this.className;
					this.className="over";
				}
				node.onmouseout=function() {
					if(!curCname) {
							this.className=this.className.replace("over","");
					}
					else {
						//alert(curCname);
						this.className=this.className.replace("over",curCname);
					}
				}
			}
		}
		// add png transparency fix
		document.styleSheets[0].addRule('img', 'behavior: url(../../includes/js/iepngfix.htc)');
		// add fixed position fix
		include_dom('../../includes/js/ie6.js');
	}
}

function include_dom(script_filename) {
    var html_doc = document.getElementsByTagName('head').item(0);
    var js = document.createElement('script');
    js.setAttribute('language', 'javascript');
    js.setAttribute('type', 'text/javascript');
    js.setAttribute('src', script_filename);
    html_doc.appendChild(js);
    return false;
}

function toggle_thru(id,togglename,toggleno,linkname){
	if (id){
		for (i = 1; i <= toggleno; i++){
			if (linkname){
				var linkid = linkname+i;
				document.getElementById(linkid).className='null';
			}
			var toggleid = togglename+i;
			document.getElementById(toggleid).className = 'hide';
		}
		document.getElementById(togglename+id).className = 'show';
		if (linkname){
			document.getElementById(linkname+id).className='active';
		}
	}
	else {
		return false;
	}
}

function playAF(swfName, targetID, width, height, version) {
	var so = new SWFObject(swfName, "flash", width, height, version, "#677b8f");
	so.addParam("quality", "high");
	so.addParam("wmode", "transparent");
	so.write(targetID);
}

function openPopup(flg){
	if(!flg){
		include_dom('../../includes/js/jquery.js');
		setTimeout("openPopup(1)",200);
	}
	else{
		$('#legal').show('slow');
	}
}

function fadePopup(){
	$('#legal').hide('slow');
}

function set_plos() {
	window.onload = plos_go;
}

function plos_go() {
	for(var i = 0;i < plos.length;i++)
		eval(plos[i]);
}

function plo_add(jso) {
	plos[plos.length] = jso;
}

var plos = new Array();
plo_add("init_ie6_fixes()");
