/****************************************************************************
	Flash_view - 단순 Flash일 경우
*****************************************************************************	
	- width		: 가로크기
	- height		: 세로크기
	- wmode	: 투명, 절대위치등 레이어의 기능 
	- url			: 플래쉬 파일의 경로
*****************************************************************************/

function flashView(width, height, wmode, url){
	document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+width+"' height='"+height+"'>");
	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("<embed src='"+url+"' quality='high' width='"+width+"' height='"+height+"' wmode='"+wmode+"' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />");
	document.write("</object>");
}

/****************************************************************************
	아이디값을 넘겨줄 경우
*****************************************************************************/
function flashViewId(id, width, height, wmode, url){
	document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'");
    document.write("        id='"+id+"' width='"+width+"' height='"+height+"'");
    document.write("         codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab'>");
    document.write("<param name='movie' value='"+url+"' />");
 	document.write("<param name='quality' value='high' />");
  	document.write("<param name='bgcolor' value='#869ca7' />");
  	document.write("<param name='allowScriptAccess' value='sameDomain' />");
  	document.write("<param name='wmode' value='"+wmode+"' />");
  	document.write("<embed src='"+url+"' quality='high' bgcolor='#869ca7'");
    document.write("         width='"+width+"' height='"+height+"' name='ExternalInterfaceExample' align='middle' wmode='transparent'");
    document.write("        play='true' loop='false' allowscriptaccess='sameDomain'");
    document.write("         type='application/x-shockwave-flash'");
    document.write("         pluginspage='http://www.macromedia.com/go/getflashplayer'> </embed>");
	document.write("</object>");
}
/****************************************************************************
	변수값을 넘겨줄 경우
*****************************************************************************/
function flashViewSendVar(width, height, wmode, url, vars){
	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='"+vars+"'> ");
	document.write("	<embed src='"+url+"' 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>");
}

/****************************************************************************
	F_viewSwf - 페이지 인식이 있는 Flash일 경우
*****************************************************************************	
	- width		: 가로크기
	- height	: 세로크기
	- wmode	: 투명, 절대위치등 레이어의 기능 
	- url			: 플래쉬 파일의 경로
	- page		: pageNum
	- sub	 		: subNum
*****************************************************************************/

function flashPage(width, height, wmode, url, page, sub){
	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='pageNum="+page+"&subNum="+sub+"'> ");
	document.write("	<embed src='"+url+"' FlashVars='pageNum="+page+"&subNum="+sub+"' 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>");
}


/***********************************************************************************************************
	F_viewMediaPlayer - Microsoft Windows Media Player 재생
************************************************************************************************************
	예) F_viewMediaPlayer('NSPlay','NSPlay','322','286','true','true','true','false','false','false','false','파일명');
************************************************************************************************************/
function F_viewMediaPlayer(id, name, width, height, showcontrols, autostart, autorewind, autosize, autoresize, transparentatstart, loop, url) {
	document.write("<object id='"+id+"' codeBase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701' "); 
	document.write("		type='application/x-oleobject' standby='Loading Microsoft Windows Media Player components...' "); 
	document.write("		width='"+width+"' height='"+height+"' classid='clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95' name='"+name+"'> ");
	document.write("	<param name='ShowControls' value='"+showcontrols+"'> ");
	document.write("	<param name='AutoStart' value='"+autostart+"'> ");
	document.write("	<param name='AutoRewind' value='"+autorewind+"'> ");
	document.write("	<param name='Autosize' value='"+autosize+"'> ");
	document.write("	<param name='AutoResize' value='"+autoresize+"'> ");
	document.write("	<param name='TransparentAtStart' value='"+transparentatstart+"'> ");
	document.write("	<param name='loop' value='"+loop+"'> ");
	document.write("	<param name='Filename' value='"+url+"'> ");
	document.write("	<embed type='application/x-mplayer2' pluginspage='http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/' "); 
	document.write("		id='"+id+"' name='"+name+"' showpositioncontrols='0' showcontrols='0' autosize='0' autostart='1' showdisplay='0' ");
	document.write("		showstatusbar='0' showtracker='1' loop='1' width='"+width+"'  height='"+height+"' src='"+url+"'> ");
	document.write("	</embed> "); 
	document.write("</object> ");
}


/****************************************************************************
	img_over - 이미지 롤오버
****************************************************************************/

function img_over(img1,name,dir,over){

	if(over=='over')
	{
		img1.src=dir+name+'_on.gif';
	}
	else
	{
		img1.src=dir+name+'.gif';
	}
}


/****************************************************************************
	body onLoad 함수 응용 (여러 함수 동시부름가능)
****************************************************************************/
function addLoadEvent(func) {
	var oldonload = window.onload;
	if ( typeof window.onload != 'function' ) {
		window.onload = func;
	} else {
		window.onload = function() {
			oldonload();
			func;
		}
	}
}

//예제addLoadEvent(stripeTables);


/*탭전환(주의 id의값은 1부터.. total값은 탭수)*/
function tabDisplay(total,num){
	a = total + 1;
	for(i=1; i<a; i++){
		if( num == i){
			document.getElementById("tab0"+i).style.display = "";
		}
		else{
			document.getElementById("tab0"+i).style.display = "none";
		}
	}
}

//탭전환2
function tabView(num,total,id){
	var a = (total-1) + 2;
	for(i=1; i<a; i++){
		if( num == i){
			document.getElementById(id+i).style.display = "";
		}
		else{
			document.getElementById(id+i).style.display = "none";
		}
	}
}


/* 클래스명추가 */
function addClass(element,value) {
  if (!element.className) {
    element.className = value;
  } else {
    newClassName = element.className;
    newClassName+= " ";
    newClassName+= value;
    element.className = newClassName;
  }
}

/****************************************************************************
	uccmView - 더리뷰>uccm동영상관련(유투부확대모드지원?!) 2010.03.30 by publisher 
*****************************************************************************/

function uccmView(width, height, url){
	document.write("<object width='"+width+"' height='"+height+"'>");
	document.write("<param name='movie' value='"+url+"'></param>");
	document.write("<param name='allowFullScreen' value='true'></param>");
	document.write("<param name='allowscriptaccess' value='always'></param>");
	document.write("<embed src="+url+"' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' width='"+width+"' height='"+height+"'></embed>");
	document.write("</object>");
}
