// Flash Activating Script
// 2005-12-05
// inome _at_ nhncorp.com
// Don't Edit Below! Never!

// s: source url
// d: flash id
// w: source width
// h: source height
// t: wmode ("" for none, transparent, opaque ...)
function mf(s,d,w,h,t){
        return "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" width="+w+" height="+h+" id="+d+"><param name=wmode value="+t+" /><param name=movie value="+s+" /><param name=quality value=high /><embed src="+s+" quality=high wmode="+t+" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?p1_prod_version=shockwaveflash\" width="+w+" height="+h+"></embed></object>";
}

// write document contents
function documentwrite(src){
        document.write(src);
}

// assign code innerHTML
function setcode(target, code){
        target.innerHTML = code;
}

// browser check for ad
function isAdAvailable(){
    var g,a,p,m,noepd; g=navigator; a=g.userAgent;
    p=g.appVersion; m=p.indexOf("MSIE");

    if(a.indexOf("MSIE")==-1){ noepd=true; }

    if(m!=-1 && a.indexOf("Win")!=-1){
        v=parseFloat(p.substring(m+4)); if(v<5.5){ noepd=true; }
    }

    return !noepd;
}

//ÆË¾÷À» À§ÇÑ ÄíÅ°Ã£±â
function setCookie( name, value, expiredays ) { 
	var todayDate = new Date();
	todayDate.setDate(todayDate.getDate() + expiredays);
	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
} 

function getCookie(name) { 
	var Found = false 
	var start, end 
	var i = 0 	 
	while(i <= document.cookie.length) { 
		start = i 
		end = start + name.length 
		
	if(document.cookie.substring(start, end) == name) { 
			Found = true 
			break
		} 	i++ 
	}  
	if(Found == true) { 
		start = end + 1 
		end = document.cookie.indexOf(";", start) 
		if(end < start) 
			end = document.cookie.length 
	
		return document.cookie.substring(start, end)
	}	
	return "" 
}


function deleteCookie( cookieName ) {
  var expireDate = new Date();  
  
  expireDate.setDate( expireDate.getDate() - 1 );
  document.cookie = cookieName + "= " + "; expires=" + expireDate.toGMTString() + "; path=/";
}

/** À½¼º È÷µç, ºä */
function showSound(){
	var soundView;	

	if(document.getElementById("soundTR1").style.display == "none") {
		document.getElementById("soundTR1").style.display = "block";
		document.getElementById("soundTR2").style.display = "none";	
		soundView = "N";
	} else {
		document.getElementById("soundTR1").style.display = "none";
		document.getElementById("soundTR2").style.display = "block";
		soundView = "Y";
	}	

	/** À½¼º UI Èùµç ¿©ºÎ¸¦ ÄíÅ°¿¡ ÀúÀå. */
	deleteCookie("SOUND_VIEW_YN_C");
	setCookie("SOUND_VIEW_YN_C", soundView , 1);
}

/** »ç¿îÆ® Æû È÷µç ¿©ºÎ */
window.onload = function() {
	if(document.getElementById("soundTR1") != null) {
		if(getCookie("SOUND_VIEW_YN_C") == "Y") {
			document.getElementById("soundTR1").style.display = "none";
			document.getElementById("soundTR2").style.display = "block";			
		} else {
			document.getElementById("soundTR1").style.display = "block";
			document.getElementById("soundTR2").style.display = "none";
		}
	}
}