// 플래시 스크립트
function flash_write(AMovie, AWMode, AWidth, AHeight) {
 document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="' + AWidth + '" height="' + AHeight + '">');
 document.write('<param name="movie" value="' + AMovie + '">');
 document.write('<param name="wmode" value="' + AWMode + '">');
 document.write('<embed src="' + AMovie + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + AWidth + '" height="' + AHeight + '"></embed>');
 document.write('</object>');
}


// 컨텐츠 최신글 스크립트
function show_Layer(id, len, item){
    var menuId = "menu_" + id;
    for(var i = 1; i <= len; i++) {
        document.getElementById(id+i).style.display = "none";
        document.getElementById(menuId+i).style.background = "#FAFAFA";
        document.getElementById(menuId+i).style.font = "11px 돋움";
        document.getElementById(menuId+i).style.borderBottom = "1px solid #dadada";
    }

    str = id + item;
    mstr = menuId + item;
    document.getElementById(str).style.display = "";
    document.getElementById(mstr).style.background = "#fff";
    document.getElementById(mstr).style.fontWeight = "bold";
    document.getElementById(mstr).style.borderBottom = "";
}




/****************************************************************************
	F_viewSwf - 단순 Flash일 경우
*****************************************************************************	
	- width		: 가로크기
	- height	: 세로크기
	- wmode	: 투명, 절대위치등 레이어의 기능 
	- url			: 플래쉬 파일의 경로
*****************************************************************************/

function F_viewSwf(width, height, wmode, url, dirinfo, title, time){
	document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' ");
	document.write("		codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' ");
	document.write("		width='"+width+"' height='"+height+"' align='middle'>");
	document.write("	<param name='allowScriptAccess' value='always' /> ");
	document.write("	<param name='movie'				value='"+url+"' /> ");
	document.write("	<param name='quality'			value='high' /> ");
	document.write("	<param name='wmode'				value='"+wmode+"'> ");
	document.write("	<param name='FlashVars' value='dir="+dirinfo+"&sbj="+title+"&time="+time+"' />");
	document.write("	<embed src='"+url+"' FlashVars='dir="+dirinfo+"&sbj="+title+"&time="+time+"' quality='high' width='"+width+"' height='"+height+"' align='middle' wmode='"+wmode+"' ");
	document.write("		allowScriptAccess='sameDomain' type='application/x-shockwave-flash' ");
	document.write("		pluginspage='http://www.macromedia.com/go/getflashplayer' />");
	document.write("</object>");
}




// main function
function showTitle(srcUrl, srcFilename, width, height, titleStr, linkStr, hAlign, tColor)
{	
	var str = "<embed id=\"viewTitle\" name=\"viewTitle\" type=\"application/x-shockwave-flash\" src=\"" +
				srcUrl + srcFilename + "\" width=\"" + width + "\" height=\"" + height + "\" wmode=\"transparent\"" + " allowScriptAccess=\"always\"" + "FlashVars=\"" +
				"articleTitle="+ pEncode(titleStr) +"&linkTo=" + linkStr + "&hAlign=" + hAlign + "&tColor="+ tColor + "\"/>";

//	window.alert(str);
	document.write(str);
}

// percent-encoding
function pEncode(str)
{
	str = str.replace(/&amp;/g, "%26");
	//str = str.replace(/[&]/g, "%26");
	str = str.replace(/[+]/g, "%2b");
	
	return str;
}
