// °øÅë ÇÃ·¡½¬
function Cji_Flash(Url, wd, ht, swfId, wm, vars) {// °æ·Î,°¡·Î,¼¼·Î,ID,Åõ¸í,º¯¼ö
	var TxtSwf = "" ;
	TxtSwf += "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,29,0' width='"+ wd +"' height='"+ ht +"' id='"+ swfId +"'>" ;
	TxtSwf += "<param name='movie' value='"+ Url +"'>" ;
	TxtSwf += "<param name='wmode' value='"+ wm +"'>" ;
	TxtSwf += "<param name='FlashVars' value='" + vars + "'>" ;
	TxtSwf += "<param name='allowScriptAccess' value='always'>" ;
	TxtSwf += "<param name='allowFullScreen' value='true'>" ;
	TxtSwf += "<param name='quality' value='high'>" ;
	TxtSwf += "<param name='menu' value='false'>" ;
	TxtSwf += "<embed src='"+ Url +"' width='"+ wd +"' height='"+ ht +"' wmode='"+ wm +"' name='"+ swfId +"' FlashVars='"+ vars +"' allowScriptAccess='always' allowFullScreen='true' quality='high' menu='false' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash'></embed>" ;
	TxtSwf += "</object>" ;
	document.write (TxtSwf);
}

// ¸¶¿ì½º ·Ñ¿À¹öÀÌ¹ÌÁö
var currentImg;
function Cji_ImgOn(imgEl){
	var name = imgEl.src;
	if( name.indexOf("on.gif") <= 0 ) {
		imgEl.src = name.replace(".gif", "on.gif");
	} else {
		currentImg = imgEl;
	}
}

function Cji_ImgOut(imgEl){
	if( currentImg != imgEl ) {
		imgEl.src = imgEl.src.replace("on.gif", ".gif");
	}
}

// °øÅë FAQ
function Cji_Faq(obj){
	var Faq_dtList = document.getElementById("CJGameFaq").getElementsByTagName("dt");
	var Faq_ddList = document.getElementById("CJGameFaq").getElementsByTagName("dd");
	for (i=0;i<Faq_dtList.length;i++) {
		if(obj.parentNode.parentNode==Faq_dtList[i]){
		Faq_ddList[i].style.display = (Faq_ddList[i].style.display != "block" ? "block" : "none")
		Faq_dtList[i].className = (Faq_dtList[i].className != "on" ? "on" : "")		
		} else {
		Faq_ddList[i].style.display = "none"
		Faq_dtList[i].className = ""
		}
	}
}

// Å¬·¡½º ³×ÀÌ¹Ö º¯°æ
function Cji_ClassOn(m_id,m_tag){
	var mList = document.getElementById(m_id).getElementsByTagName(m_tag)
	for (i=0;i<mList.length;i++) {
		old_class="";
		mList[i].onmouseover = function() {   
		old_class = this.className;
		this.className = this.className + " on";
		}
		mList[i].onmouseout = function() {  
		this.className = old_class;
		}
	}
}

// °øÅë ÅÇ
function Cji_Tab(m_id){
	bg_class = "k1"
	var cName = document.getElementById(m_id).className + " " + bg_class
	document.getElementById(m_id).className = cName
	var tList = document.getElementById(m_id).getElementsByTagName("a");
	
	for (i=0;i<tList.length;i++) {
		TabPlay = function() {
			for (y=0;y<tList.length;y++) { 
			tList[y].className = "";
			document.getElementById(m_id + "_sub" + (y+1)).style.display = "none";
			if(this==tList[y]){x=y+1}
			}
			this.className = this.className + "on";
			document.getElementById(m_id + "_sub" + x).style.display = "block";			
			document.getElementById(m_id).className = cName.replace(bg_class,"k" + x)
			return false;
		}
		tList[i].onclick = TabPlay;
		if(arguments[1]=="Mover"){tList[i].onmouseover = TabPlay;}
	}
}

// °øÅë »õÃ¢À¸·Î ¿­±â
function Cji_NewWindow() {

    var pURL    = arguments[0];
    var pName   = arguments[1];

    try {
        var popup = window.open(pURL, pName);        
        if (popup != "undefined" || popup != null || !popup.close) popup.focus();
    } catch(e) {
        alert("ÆË¾÷Â÷´Ü ¼³Á¤À» Ç®¾îÁÖ¼¼¿ä.\n[¹æ¹ý: µµ±¸-ÆË¾÷Â÷´Ü »ç¿ë¾ÈÇÔ Å¬¸¯]");
    }
    return popup;
}

function Cji_Parameter(paramName){

    var pmt = location.search;
    if (pmt.length>1&&pmt.indexOf("?")>-1){ 
        pmt = pmt.substring(1,pmt.length);
    }
    var param = pmt.split("&");
    var paramValue = "";

    for (var i=0; i<param.length; i++) {
         if (param[i].indexOf("=")>-1) {
              var pName = param[i].split("=")[0];
              var pValue = param[i].split("=")[1];
              if (pName==paramName) {
                   paramValue = pValue;
                   break;
              }
         }
    }
    return paramValue;
}
