function insertExternalFile(fname,W,H) {
if (navigator.appName.indexOf("Microsoft")!=-1
  || navigator.appName=="Netscape"
     && parseInt(navigator.appVersion)>4
)
{
  document.write(''
  +'<IFRAME src="'+fname+'" scrolling="yes" frameborder=1 border=1'
  +(W==null ? '' : ' width='+W)
  +(H==null ? '' : ' height='+H)
  +'></IFRAME>'
  )
}

if (navigator.appName=="Netscape"
     && parseInt(navigator.appVersion)==4) {
  document.write(''
  +'<ILAYER>'
  +'<LAYER src="'+fname+'" '
  +(W==null ? '' : ' width='+W)
  +(H==null ? '' : ' height='+H)
  +'></LAYER></ILAYER>'
  )
}
}

var IE5=(document.getElementById && document.all)? true: false;
var W3C=(document.getElementById)? true: false;
var currIDb=null, currIDs=null, xoff=0, yoff=0; zctr=0; totz=0;

function trackmouse(evt){
  if((currIDb!=null) && (currIDs!=null)){
    var x=(IE5)? event.clientX+document.body.scrollLeft : evt.pageX;
    var y=(IE5)? event.clientY+document.body.scrollTop : evt.pageY;
    currIDb.style.left=x+xoff+'px';
    currIDs.style.left=x+xoff+10+'px';
    currIDb.style.top=y+yoff+'px';
    currIDs.style.top=y+yoff+10+'px';
    return false;
  }
}

function stopdrag(){
  currIDb=null;
  currIDs=null;
  NS6bugfix();
}

function grab_id(evt){
  xoff=parseInt(this.IDb.style.left)-((IE5)? event.clientX+document.body.scrollLeft : evt.pageX);
  yoff=parseInt(this.IDb.style.top)-((IE5)? event.clientY+document.body.scrollTop : evt.pageY);
  currIDb=this.IDb;
  currIDs=this.IDs;
}

function NS6bugfix(){
  if(!IE5){
    self.resizeBy(0,1);
    self.resizeBy(0,-1);
  }
}

function incrzindex(){
  zctr=zctr+2;
  this.subb.style.zIndex=zctr;
  this.subs.style.zIndex=zctr-1;
}

function createPopup(id, title, width, height, x, y, isdraggable, boxcolor, barcolor, shadowcolor, text, textcolor, textptsize, textfamily, close_img, day_text){
  if(W3C){
    zctr+=2;
    totz=zctr;
    var txt='';
    txt+='<div id="'+id+'_s" style="position:absolute; left:'+(x+7)+'px; top:'+(y+7)+'px; width:'+width+'px; height:'+height+'px; background-color:'+shadowcolor+'; filter:alpha(opacity=30); visibility:visible"> </div>';
    /* ÇÏ´Ü¿¡ "¿À´ÃÇÏ·ç±×¸¸º¸±â" ÀÇ Å©±â¸¸Å­ height 30 px Áõ°¡½ÃÅ´ */
    txt+='<div id="'+id+'_b" style="border:outset '+barcolor+' 2px; position:absolute; left:'+x+'px; top:'+y+'px; width:'+width+'px; overflow:hidden; height:'+(height+30)+'px; background-color:'+boxcolor+'; visibility:visible">';
    /* ·¹ÀÌ¾î Ã¢À» ´ÝÀ» ¶§, "¿À´ÃÇÏ·ç±×¸¸º¸±â" Ã¼Å©¿©ºÎ¿¡ µû¶ó ÄíÅ° ÀúÀå½ÃÅ°±â.. */
    txt+='<div style="width:'+width+'px; height:16px; background-color:'+barcolor+'; padding:0px; border:1px"><table cellpadding="0" cellspacing="0" border="0" width="'+(IE5? width-4 : width)+'"><tr><td width="'+(width-20)+'"><div id="'+id+'_h" style="width:'+(width-20)+'px; height:14px; font: bold 12px Tahoma; cursor:move; color:'+textcolor+'"> '+title+'</div></td><td align="right"><a onmousedown="document.getElementById(\''+id+'_s\').style.display=\'none\'; document.getElementById(\''+id+'_b\').style.display=\'none\';showToday(document.getElementById(\'showToday_'+id+'\'));return false"><img src='+close_img+' border="0" height="15" width="15"></a></td></tr></table></div>';
    txt+='<div id="'+id+'_ov" width:'+width+'px; style="margin:5px; color:'+textcolor+'; font:'+textptsize+'pt '+textfamily+';">'+text+'</div>';
    /* ·¹ÀÌ¾î Ã¢¿¡ "¿À´ÃÇÏ·ç±×¸¸º¸±â" Ãß°¡ */
    txt+='<div id="'+id+'_d" width:'+width+'px; style="margin:5px; color:'+textcolor+'; font:'+textptsize+'pt '+textfamily+';border:solid 1px silver;"><input type=checkbox id=showToday_'+id+'>'+day_text+'</div></div>';
    document.write(txt);
    this.IDh=document.getElementById(id+'_h');
    this.IDh.IDb=document.getElementById(id+'_b');
    this.IDh.IDs=document.getElementById(id+'_s');
    this.IDh.IDb.subs=this.IDh.IDs;
    this.IDh.IDb.subb=this.IDh.IDb;
    this.IDh.IDb.IDov=document.getElementById(id+'_ov');
    if(IE5){
      this.IDh.IDb.IDov.style.width=width-6;
      this.IDh.IDb.IDov.style.height=height-22;
      this.IDh.IDb.IDov.style.scrollbarBaseColor=boxcolor;
      this.IDh.IDb.IDov.style.overflow="auto";
    }else{
      this.IDh.IDs.style.MozOpacity=.5;
    }
    this.IDh.IDb.onmousedown=incrzindex;
    if(isdraggable){
      this.IDh.onmousedown=grab_id;
      this.IDh.onmouseup=stopdrag;
    }
    /* ÀúÀåµÈ ÄíÅ°ÀÇ °ª¿¡ µû¶ó Ã³À½ ÆäÀÌÁö ¶ç¿ï ¶§ º¸ÀÌÁö ¾Êµµ·Ï Ã³¸®. */
    if(document.cookie.indexOf('showToday_'+id+'=off') >= 0){
      document.getElementById('showToday_'+id).checked = true;
      this.IDh.IDs.style.display = 'none';
      this.IDh.IDb.style.display = 'none';
    }
  }
}

if(W3C)document.onmousemove=trackmouse;
if(!IE5 && W3C)window.onload=NS6bugfix;      
      
/* "¿À´ÃÇÏ·ç±×¸¸º¸±â" ÀÇ Ã¼Å©¿©ºÎ¿¡ µû¶ó ÄíÅ°¸¦ ÀúÀåÇÏ´Â ÇÔ¼ö */
function showToday(obj){
  if(obj.checked){
    var cur = new Date();
    cur.setHours(23);
    cur.setMinutes(59);
    cur.setSeconds(59);
    document.cookie = obj.id + "=off; expires=" + cur.toGMTString() + ";";
  }else{
    document.cookie = obj.id + "=;";
  }
}

function win_open(get_mode)
{	
	var get_mode;
	if(get_mode == 'eng'){
		window.open("http://aseankorea.org/hanasean/english/2009ASEAN.htm","mmc","scrollbars=yes,status=no,toolbar=no,resizable=0,location=no,menu=no,width=780,height=900,top=100,left=100"); 
	}else if(get_mode=='kor'){
		window.open("http://aseankorea.org/hanasean/english/2009ASEANkor.htm","mmce","scrollbars=yes,status=no,toolbar=no,resizable=0,location=no,menu=no,width=780,height=900,top=100,left=100"); 
	}else if(get_mode == 'gf'){
		window.open("http://aseankorea.org/hanasean/event/gf/giftshow2009.html","gf","scrollbars=no,status=no,toolbar=no,resizable=0,location=no,menu=no,width=1000,height=690,top=100,left=100"); 
	}else if(get_mode == 'eng_gf'){
		window.open("http://aseankorea.org/hanasean/event/gf_eng/giftshow2009_eng.html","eng_gf","scrollbars=no,status=no,toolbar=no,resizable=0,location=no,menu=no,width=1000,height=690,top=100,left=100"); 
	}else if(get_mode == 'mmc'){
		window.open("http://www.aseankorea.org/hanasean/event/mmc/slide_mmc2.html","mmc","scrollbars=Yes,status=no,toolbar=no,resizable=0,location=no,menu=no,width=1000,height=690,top=100,left=100"); 
	}else if(get_mode == 'fair'){
		window.open("http://www.aseankorea.org/hanasean/event/fair/slide_fair.html","fair","scrollbars=Yes,status=no,toolbar=no,resizable=0,location=no,menu=no,width=1000,height=690,top=100,left=100"); 
	}else if(get_mode == 'food'){
		window.open("http://www.aseankorea.org/hanasean/event/food/food2009.htm","food","scrollbars=no,status=no,toolbar=no,resizable=0,location=no,menu=no,width=1000,height=690,top=100,left=100"); 
	}else if(get_mode == 'foode'){
		window.open("http://www.aseankorea.org/hanasean/event/food/food2009_eng.htm","foode","scrollbars=no,status=no,toolbar=no,resizable=0,location=no,menu=no,width=1000,height=690,top=100,left=100"); 
	}
} 

