function fn_resize(){
//	window.resizeBy(0, -2);
//	window.resizeTo(1024, 766);
    window.moveTo(0,0);
	window.resizeTo(screen.availWidth,screen.availHeight);
}

// JavaScript Document
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

// Æ÷Ä¿½ºÁ¦¾î
function bluring(){
	if(event.srcElement.tagName=="A" || event.srcElement.tagName=="IMG"){
		document.body.focus();
	}
}
document.onfocusin=bluring;

//Flash
function swf_include(url, wN, hN, vars, id, wmNum, bgColor) {
	if(bgColor == undefined) bgColor = "#ffffff";
	if(wmNum == undefined) wmNum = 0;
	var wmodeArr = ["window", "opaque", "transparent"];
	var codeStr =
	"<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='"+wN+"' height='"+hN+"' id='"+id+"' align='middle'>"+
	"<param name='allowScriptAccess' value='sameDomain' />"+
	"<param name='movie' value='"+url+"' />"+
	"<param name='FlashVars' value='"+vars+"'/>"+
	"<param name='loop' value='false' />"+
	"<param name='menu' value='false' />"+
	"<param name='wmode' value='"+wmodeArr[wmNum]+"' />"+
	"<param name='quality' value='high' />"+
	"<param name='bgcolor' value='"+bgColor+"' />"+
	"<embed src='"+url+"' FlashVars='"+vars+"' quality='high' bgcolor='#EEF8FF' width='"+wN+"' height='"+hN+"' name='"+id+"' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
	"</object>";
	document.write(codeStr);
	//window.alert(vars);
}

// ÇÃ·¡½Ã, µ¿¿µ»ó Á¦¾î
function printSWFHAVEID(idz, fn, w, h)
{
	var arg = arguments;
	var argc =  arguments.length;
	str   = "<object id=\""+idz+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\"width=\""+w+"\" height=\""+h+"\">";
	str += "        <param name=\"SRC\" value=\""+fn+"\">";
	for(i = 4; i < argc ; i++){
		str += "        <param name=\""+arg[i++]+"\" value=\""+arg[i]+"\">";
	}
	str += "</object>";
	document.write(str);
}

// printSWF('ÇÃ·¹½¬ °æ·Î' , ³ÐÀÌ, ³ôÀÌ);
function printSWF(fn, w, h)
{
	var arg = arguments;
	var argc =  arguments.length;
	str   = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\"width=\""+w+"\" height=\""+h+"\">";
	str += "        <param name=\"SRC\" value=\""+fn+"\">";
	str += "        <param name=\"wmode\" value=\"transparent\">";
	for(i = 3; i < argc ; i++){
		str += "        <param name=\""+arg[i++]+"\" value=\""+arg[i]+"\">";
	}
	str += "        <embed wmode='transparent' src=\""+fn+"\" pluginspage=\"http://www.macromedia.com/shockwave/download/\" type=\"application/x-shockwave-flash\" width=\""+w+"\" height=\""+h+"\">";
	str += "        </embed> ";
	str += "</object>";
	document.write(str);
}

// printMEDIA(id, '°æ·Î', ³ÐÀÌ, ³ôÀÌ);
function printMEDIA(id, fn, w, h)
{
	
	objstr  = "<OBJECT id=\""+id+"\" name=\""+id+"\" classid=\"CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95\" codebase=\" ";
	objstr += "http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701\" ";
	objstr += "standby=\"Loading Microsoft Windows Media Player components...\" ";
	objstr += "type=\"application/x-oleobject\" bgcolor=\"DarkBlue\" ";
	objstr += "width=\""+w+"\" height=\""+h+"\" ";
	objstr += ">";
	objstr += " <PARAM NAME=\"Filename\" VALUE=\""+fn+"\">";
	objstr += "      <param name=\"ClickToPlay\" value=\"true\">";
	objstr += "      <param name=\"width\" value=\""+w+"\">";
	objstr += "      <param name=\"height\" value=\""+h+"\">";
	objstr += "      <param name=\"AutoSize\" value=\"true\">";
	objstr += "      <param name=\"AutoStart\" value=\"true\">";
	objstr += "      <param name=\"ShowControls\" value=\"false\">";
	objstr += "      <param name=\"ShowAudioControls\" value=\"true\">";
	objstr += "      <param name=\"ShowDisplay\" value=\"false\">";
	objstr += "      <param name=\"ShowTracker\" value=\"true\">";
	objstr += "      <param name=\"ShowStatusBar\" value=\"true\">";
	objstr += "      <param name=\"EnableContextMenu\" value=\"false\">";
	objstr += "      <param name=\"ShowPositionControls\" value=\"false\">";
	objstr += "      <param name=\"ShowCaptioning\" value=\"false\">";
	objstr += "      <param name=\"AutoRewind\" value=\"true\">";
	objstr += "      <param name=\"Enabled\" value=\"true\">";
	objstr += "      <param name=\"EnablePositionControls\" value=\"true\">";
	objstr += "      <param name=\"EnableTracker\" value=\"true\">";
	objstr += "      <param name=\"PlayCount\" value=\"1\">";
	objstr += "      <param name=\"SendWarningEvents\" value=\"true\">";
	objstr += "      <param name=\"SendErrorEvents\" value=\"true\">";
	objstr += "      <param name=\"SendKeyboardEvents\" value=\"false\">";
	objstr += "      <param name=\"SendMouseClickEvents\" value=\"false\">";
	objstr += "      <param name=\"SendMouseMoveEvents\" value=\"false\">";
	objstr += "      <param name=\"ShowGotoBar\" value=\"false\">";
	objstr += "      <param name=\"TransparentAtStart\" value=\"false\">";
	objstr += "      <param name=\"Volume\" value=\"50\">";
	objstr += "	  <param name=\"DisplaySize \" value=\"0\">";
	objstr += "</OBJECT>";
	return objstr;
}

function playMovie(id, fn, w, h){
	document.all.oDivPlayer.innerHTML = printMEDIA(id, fn, w, h)
	obj = eval("document.all."+id);
	obj.Filename=fn;
	setTimeout("VodPlay('"+id+"')", 1000);
}

function VodPause(id){
	obj = eval("document.all."+id);
	if(obj) obj.pause();
}

function VodPlay(id){
	obj = eval("document.all."+id);
	if(obj) obj.play();
}

function VodStop(id){
	obj = eval("document.all."+id);
	if(obj) obj.stop();
}


//-- GO TOP --//
function back_top()
{
x = document.body.scrollLeft;
y = document.body.scrollTop;
step = 2;

while ((x != 0) || (y != 0)) {
scroll (x, y);
step += (step * step / 100);
x -= step;
y -= step;
if (x < 0) x = 0;
if (y < 0) y = 0;
} 
scroll (0, 0);
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

// PRINT //

function printDiv(){
 if (document.all && window.print){
  window.onbeforeprint = beforeDivs;
  window.onafterprint = afterDivs;
  window.print();
 }
}

function beforeDivs(){
 if(document.all){
  objContents.style.display = 'none';
  objSelection.innerHTML = document.all['print_contents'].innerHTML;
 }
}

function afterDivs(){
 if(document.all){
  objContents.style.display='block';
  objSelection.innerHTML = "";
 }
}


function FlashCode(fid,fn,wd,ht,para)
{
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="' + wd + '" height="' + ht + '" id="' + fid + '" align="middle">');
document.write('<param name="allowScriptAccess" value="always">');
document.write('<param name="movie" value="' + fn + para + '">');
document.write('<param name="menu" value="false">');
document.write('<param name="quality" value="high">');
document.write('<param name="wmode" value="transparent">');
document.write('<embed src="' + fn + para + '" menu="false" quality="high" wmode="transparent" width="' + wd + '" height="' + ht + '" name="' + fid + '" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
document.write('</object>');
document.write('<script language="javascript">')
document.write('</script>')
}


// printSWF('ÇÃ·¹½¬ °æ·Î' , ³ÐÀÌ, ³ôÀÌ);
function printSWF(fn, w, h)
{
	var arg = arguments;
	var argc =  arguments.length;
	str   = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\"width=\""+w+"\" height=\""+h+"\">";
	str += "        <param name=\"SRC\" value=\""+fn+"\">";
	str += "        <param name=\"wmode\" value=\"transparent\">";
	for(i = 3; i < argc ; i++){
		str += "        <param name=\""+arg[i++]+"\" value=\""+arg[i]+"\">";
	}
	str += "        <embed wmode='transparent' src=\""+fn+"\" pluginspage=\"http://www.macromedia.com/shockwave/download/\" type=\"application/x-shockwave-flash\" width=\""+w+"\" height=\""+h+"\">";
	str += "        </embed> ";
	str += "</object>";
	document.write(str);
}

