// Embeded function image Over
function menuOver() {	this.src = this.src.replace("_off.gif", "_on.gif");}
function menuOut() {	this.src = this.src.replace("_on.gif", "_off.gif");}
// Tabbed menu
function initTabMenu(menuElId) {
	var tabMenu = document.getElementById(menuElId).getElementsByTagName("a");
	if(tabMenu.length > 0){
		for(i=0; i<tabMenu.length; i++) {
			thismenu = tabMenu.item(i);
			thismenu.menuContainer = document.getElementById(menuElId);
			thismenu.targetEl = document.getElementById(tabMenu.item(i).href.split("#")[1]);
			thismenu.targetEl.style.display = "none";
			if(thismenu.getElementsByTagName("img").length>0)	{
				thismenu.getElementsByTagName("img").item(0).onmouseover = menuOver;
				thismenu.getElementsByTagName("img").item(0).onmouseout = menuOut;
			}
			thismenu.onclick = tabMenuClick;
		}
		initmenu = tabMenu.item(0);
		initmenu.menuContainer = document.getElementById(menuElId);
		initmenu.targetEl = document.getElementById(initmenu.href.split("#")[1]);
		initmenu.targetEl.style.display = "block";
		initmenu.className = "activate";
		if(initmenu.getElementsByTagName("img").length>0)	{
			initmenu.getElementsByTagName("img").item(0).onmouseover();
			initmenu.getElementsByTagName("img").item(0).onmouseover = null;
			initmenu.getElementsByTagName("img").item(0).onmouseout = null;
		}
		initmenu.menuContainer.current = initmenu;
	}
}
function tabMenuClick() {
	currentmenu = this.menuContainer.current;
	if (currentmenu != this) {
		currentmenu.targetEl.style.display = "none";
		currentmenu.className = null;
		if(currentmenu.getElementsByTagName("img").length>0)	{
			currentmenu.getElementsByTagName("img").item(0).onmouseover = menuOver;
			currentmenu.getElementsByTagName("img").item(0).onmouseout = menuOut;
			currentmenu.getElementsByTagName("img").item(0).onmouseout();
		}
		this.targetEl.style.display = "block";
		this.className = "activate";
		if(this.getElementsByTagName("img").length>0)	{
			this.getElementsByTagName("img").item(0).onmouseover = null;
			this.getElementsByTagName("img").item(0).onmouseout = null;
		}
		this.menuContainer.current = this;
	}
	return false;
}


// swf print
function swfprint(furl,xml,fwidth,fheight,transoption,id)	{
	id = id || "";
	if(id != ""){
		document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+ fwidth +'" height="' + fheight +'" id="' + id + '" align="middle" allowScriptAccess="always">');
	}else{
		document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+ fwidth +'" height="' + fheight +'" align="middle" allowScriptAccess="always">');
	}
	document.write('<param name="allowScriptAccess" value="sameDomain"/>');
	document.write('<param name="movie" value="'+ furl +'"/>');
	document.write('<param name="flashVars" value="'+ xml +'"/>');
	if (transoption == "t")	{
	    //document.write('<param name="wmode" value="transparent"/>');
	    document.write('<param name="wmode" value="transparent"/>');
	} else if	(transoption == "o")	{
		document.write('<param name="wmode" value="opaque"/>');
    }
	document.write('<param name="bgcolor" value="#ffffff" />');
	document.write('<param name="play" value="true" />');
	document.write('<param name="loop" value="true" />');
	document.write('<param name="scale" value="showall" />');
	document.write('<param name="menu" value="true" />');
	document.write('<param name="devicefont" value="false" />');
	document.write('<param name="salign" value="" />');
				
	document.write('<!-- Hixie method -->');
	document.write('<!--[if !IE]> <-->');
/*
	if(id != ""){
		document.write('<object type="application/x-shockwave-flash" allowScriptAccess="always" data="'+ furl +'" width="'+ fwidth +'" height="' + fheight +'" id="' + id + '"');
	}else{
		document.write('<object type="application/x-shockwave-flash" allowScriptAccess="always" data="'+ furl +'" width="'+ fwidth +'" height="' + fheight +'"');
	}
	if (transoption == "t")	{
	    //document.write(' wmode="transparent"');
	    document.write(' wmode="window"');
	} else if	(transoption == "o")	{
		document.write(' wmode="opaque"');
	}
	document.write(' flashVars="xmlURL='+xml+'"');
	document.write('<embed src="'+ furl +'" width="'+ fwidth +'" height="' + fheight +'" wmode="transparent"  allowScriptAccess="always" menu="false"/>');
	document.write('></object>');
*/
	document.write('<object type="application/x-shockwave-flash" data="' + furl + '" width="' + fwidth + '" height="' + fheight + '">');
	document.write('<param name="movie" value="' + furl + '" />');
	document.write('<param name="flashVars" value="' + xml + '"/>');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="bgcolor" value="#ffffff" />');
	document.write('<param name="play" value="true" />');
	document.write('<param name="loop" value="true" />');
	if (transoption == "t") {
	    document.write('<param name="wmode" value="transparent"/>');
	} else if (transoption == "o") {
	    document.write('<param name="wmode" value="opaque"/>');
	}
	document.write('<param name="scale" value="showall" />');
	document.write('<param name="menu" value="true" />');
	document.write('<param name="devicefont" value="false" />');
	document.write('<param name="salign" value="" />');
	document.write('<param name="allowScriptAccess" value="sameDomain" />');
	document.write('</object>');
	document.write('<!--> <![endif]-->');
	document.write('</object>');
}

function swfflashprint(furl, xml, fwidth, fheight, transoption, id) {
    id = id || "";
    if (id != "") {
        document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="' + fwidth + '" height="' + fheight + '" id="' + id + '" align="middle">');
    } else {
        document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="' + fwidth + '" height="' + fheight + '" align="middle">');
    }
    document.write('<param name="movie" value="' + furl + '" />');
    document.write('<param name="quality" value="high" />');
    document.write('<param name="bgcolor" value="#ffffff" />');
    document.write('<param name="play" value="true" />');
    document.write('<param name="loop" value="true" />');
    document.write('<param name="flashVars" value="' + xml + '" />');
    if (transoption == "t") {
        document.write('<param name="wmode" value="transparent"/>');
    } else if (transoption == "o") {
        document.write('<param name="wmode" value="opaque"/>');
    }
    document.write('<param name="scale" value="showall" />');
    document.write('<param name="menu" value="true" />');
    document.write('<param name="devicefont" value="false" />');
    document.write('<param name="salign" value="" />');
    document.write('<param name="allowScriptAccess" value="sameDomain" />');
    document.write('<!--[if !IE]>-->');
    document.write('<object type="application/x-shockwave-flash" data="' + furl + '" width="' + fwidth + '" height="' + fheight + '">');
    document.write('<param name="movie" value="' + furl + '" />');
    document.write('<param name="quality" value="high" />');
    document.write('<param name="bgcolor" value="#ffffff" />');
    document.write('<param name="play" value="true" />');
    document.write('<param name="loop" value="true" />');
    document.write('<param name="flashVars" value="' + xml + '" />');
    document.write('<param name="wmode" value="transparent" />');
    document.write('<param name="scale" value="showall" />');
    document.write('<param name="menu" value="true" />');
    document.write('<param name="devicefont" value="false" />');
    document.write('<param name="salign" value="" />');
    document.write('<param name="allowScriptAccess" value="sameDomain" />');
    document.write('<!--<![endif]-->');
    document.write('<a href="http://www.adobe.com/go/getflash">');
    document.write('<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />');
    document.write('</a>');
    document.write('<!--[if !IE]>-->');
    document.write('</object>');
    document.write('<!--<![endif]-->');
    document.write('</object>');

}
