// -------------------- Flash -------------------- //

function drawSwf(url, w, h){
	document.write('<object width="' +w+ '" height="' +h+ '" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8">');
	document.write('<param name="movie" value="' +url+ '" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="menu" value="false" />');
	document.write('<param name="wmode" value="opaque" />');
	document.write('<embed src="' +url+ '" width="' +w+ '" height="' +h+ '" quality="high" menu="false" wmode="opaque" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash">');
	document.write('</embed>');
	document.write('</object>');
}

function drawNenga2010(url, w, h){
	document.write('<object width="' +w+ '" height="' +h+ '" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8">');
	document.write('<param name="movie" value="' +url+ '" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="menu" value="false" />');
	document.write('<param name="wmode" value="opaque" />');
	document.write('<param name="allowFullScreen" value="true" />');
	document.write('<param name="allowScriptAccess" value="always" />');
	document.write('<embed src="' +url+ '" width="' +w+ '" height="' +h+ '" quality="high" menu="false" wmode="opaque" allowFullScreen="true" allowScriptAccess="always" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash">');
	document.write('</embed>');
	document.write('</object>');
}


// -------------------- MouseOver -------------------- //

var ajm_o = "_o";

if(window.addEventListener) window.addEventListener("load", setAjm, false);
else if(window.attachEvent) window.attachEvent("onload", setAjm);
function setAjm(){
	var tag = document.getElementsByTagName("a");
	var obj; var obj_o; var obj_i = new Array();
	for(i=0; i<tag.length; i++){
		if(tag[i].rel){
			obj = document.getElementById(tag[i].rel);
			if(obj){
				obj_o = obj.src.slice(0, -4) +"_o"+ obj.src.slice(-4);
				obj_i[i] = new Image(); obj_i[i].src = obj_o;
				if(obj.id.lastIndexOf(ajm_o) > -1) obj.src = obj_o;
				else {
					tag[i].onmouseover = function(){
						var obj = document.getElementById(this.rel);
						obj.src = obj.src.slice(0, -4) +"_o"+ obj.src.slice(-4);
					}
					tag[i].onmouseout = function(){
						var obj = document.getElementById(this.rel);
						obj.src = obj.src.replace("_o.", ".");
					}
				}
			}
		}
	}
}


function setAjm(){
	var obj = document.getElementsByTagName("img");
	ajm_i = new Array();
	for(var i=0; i<obj.length; i++){
		if(obj[i].className.indexOf("ajm") > -1){
			var obj_o = obj[i].src.slice(0, -4) +"_o"+ obj[i].src.slice(-4);
			ajm_i[i] = new Image(); ajm_i[i].src = obj_o;
			if(obj[i].className == "ajm_f2") obj[i].src = obj_o;
			else {
				obj[i].onmouseover = function(){
					this.src = this.src.slice(0, -4) +"_o"+ this.src.slice(-4);
				}
				obj[i].onmouseout = function(){
					this.src = this.src.replace("_o.", ".");
				}
			}
		}
	}
}
if(window.addEventListener) window.addEventListener("load", setAjm, false);
else if(window.attachEvent) window.attachEvent("onload", setAjm);


// -------------------- Nenga -------------------- //

nenga_open = new Image();
nenga_open.src = "/img/nenga_open.gif";
nenga_close = new Image();
nenga_close.src = "/img/nenga_close.gif";

var cng_now = "map";
function cngSwf(){
	if(cng_now == "map"){
		cng_now = "mov";
		document.getElementById("cngimg").src = nenga_open.src;
		fic.location.href = "/nenga_mov.html";
	} else {
		cng_now = "map";
		document.getElementById("cngimg").src = nenga_close.src;
		fic.location.href = "/nenga_map.html";
	}
}
