// =================================================
// ¿À¸¥¸¶¿ì½º »ç¿ë±ÝÁö
// =================================================
var isNS = (navigator.appName == "Netscape") ? 1 : 0;
var EnableRightClick = 0;
if(isNS) 
document.captureEvents(Event.MOUSEDOWN||Event.MOUSEUP);

function mischandler(){
  if(EnableRightClick==1){ return true; }
  else {return false; }
}

function mousehandler(e){
  if(EnableRightClick==1){ return true; }
  var myevent = (isNS) ? e : event;
  var eventbutton = (isNS) ? myevent.which : myevent.button;
  if((eventbutton==2)||(eventbutton==3)) return false;
}

function keyhandler(e) {
  var myevent = (isNS) ? e : window.event;
  if (myevent.keyCode==96)
    EnableRightClick = 1;
  return;
}

document.oncontextmenu = mischandler;
document.onkeypress = keyhandler;
document.onmousedown = mousehandler;
document.onmouseup = mousehandler;


// =================================================
// ¸¶¿ì½º·Ñ¿À¹ö
// =================================================
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_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_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];}
}

var CH_activeLayerName = '';
function CH_swapLayer(lname)
{
  var obj = document.getElementById(lname);
  if (obj) {
    if (CH_activeLayerName == lname) {
      obj.style.display = 'none';
      CH_activeLayerName = '';
    } else {
      if (CH_activeLayerName) {
        document.getElementById(CH_activeLayerName).style.display = 'none';
      }
      CH_activeLayerName = lname;
      obj.style.display = 'block';
    }
  }
}
 
function CH_swapImage(x, imgsrc)
{
  document.MM_sr = new Array;
  document.MM_sr[0] = x;
  if (!x.oSrc)
    x.oSrc=x.src;
  x.src = imgsrc;
}


// =================================================
// a,img,input blur
// =================================================
function bluring(){
	try{
		if(event.srcElement.tagName=='A'||event.srcElement.tagName=='IMG'||event.srcElement.tagName=='input') {
			document.body.focus();
		}
	}
	catch( e ){	}
}
try{
	document.onfocusin=bluring;
}
catch( e ){}

// =================================================
// Flash Activating Script
// =================================================
// 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\" id="+d+" width="+w+" height="+h+" wmode="+t+" ><param name=movie value="+s+" /><param name=quality value=high /><param name=wmode value="+t+" ><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;
}

//¸Þ´º ÇöÀçÀ§Ä¡Ç¥½Ã
IEx = navigator.appName.indexOf("Microsoft") != -1; 

function trace(n) 
{ 
    flashObj = IEx ? Fmovie : document.Fmovie; 
    flashObj.TGotoFrame("_root",n) 
	
} 

function play_fs_flash(id, file, w, h){
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" id="' + id + '" width="' + w + '" height="' + h + '" align="middle">')
document.write('<param name="allowScriptAccess" value="sameDomain" />');
document.write('<param name="movie" value="' + file + '" />');
document.write('<param name="quality" value="high" />');
document.write('<param name="bgcolor" value="#ffffff" />');
document.write('<embed src="' + file + '" quality="high" bgcolor="#ffffff" width="' + w + '" height="' + h + '" swLiveConnect=true id="' + id + '" name="' + id + '" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>');
}



// =================================================
// flash ActiveX
// =================================================
function flash(strFile, width, height, wmode) {
	document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,22,0' width='" + width + "' height='" + height + "'>");
	document.write("<param name='allowScriptAccess' value='sameDomain'>");
	document.write("<param name='movie' value='" + strFile + "'>");
	document.write("<param name='quality' value='high'>");
	document.write("<param name='menu' value='false'>");
	document.write("<param name='scale' value='nosclae'>");
	document.write("<param name='wmode' value='" + wmode + "'>");
	document.write("<embed src='" + strFile + "' quality='high'  width='" + width + "' height='" + height + "' allowScriptAccess='sameDomain' quality='high' menu='false' scale='nosclae' wmode='" + wmode + "' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'></embed>");
	document.write("</object>");
}
function flashCM(obcode){
    document.write(obcode);
}

/************************************************************************************************/
/* Popup Window Function                                                                        */
/* url : document url / wname : window name / w : width / h : height / ptype : options type     */
/* t : top / l : left                                                                           */
/************************************************************************************************/
function popWin(url,wname,w,h,ptype,t,l){
	var popupWin, tVal, lVal;
	if (t == "c") {
		lVal = (screen.Width - w) / 2;
		tVal = (screen.Height - h) / 2;
	} else {
		tVal = (t!=null)?t:0;
		lVal = (l!=null)?l:0;
	}
	var popOpt = "width="+w+",height="+h+", top="+tVal+", left="+lVal;
	if(ptype == 0){
		popOpt += ",scrollbars=no";
	}
	if(ptype == 1){
		popOpt += ",scrollbars=yes";
	}
	if(ptype == 2){
		popOpt += ",scrollbars=yes,resizable=yes";
	}
	popupWin = window.open(url,wname,popOpt);
	popupWin.focus();
}


// =================================================
// ¿ÀÇÂ À©µµ¿ì
// =================================================
function openwindow(theURL,winName,width,height,scrollbars) { //v2.0
  window.open(theURL,winName,"width=" + width + ", height=" + height + ", scrollbars=" + scrollbars + "");
}


// =================================================
// À¯µ¿·¹ÀÌ¾î-Äü¸µÅ©
// =================================================

function fix(){
var a=document.body.scrollTop+480
bar.style.top = a
}





