if (REQUIRE_ONCE_COMMON == null)
{
	// ÇÑ¹ø¸¸ ½ÇÇàµÇ°Ô
	var REQUIRE_ONCE_COMMON = true;

    // ÀÚ¹Ù½ºÅ©¸³Æ®·Î PHPÀÇ number_format Èä³»¸¦ ³¿
    // ¼ýÀÚ¿¡ , ¸¦ Ãâ·Â
    function number_format(data) 
    {
        var tmp = '';
        var number = '';
        var cutlen = 3;
        var comma = ',';
        var i;
       
        len = data.length;
        mod = (len % cutlen);
        k = cutlen - mod;
        for (i=0; i<data.length; i++) 
        {
            number = number + data.charAt(i);
            
            if (i < data.length - 1) 
            {
                k++;
                if ((k % cutlen) == 0) 
                {
                    number = number + comma;
                    k = 0;
                }
            }
            
        }

        return number;
    }	

   // »èÁ¦ °Ë»ç È®ÀÎ
   function del(href) 
   {
        if(confirm("Á¤¸» »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?")) 
            document.location.href = href;
   }
   
    // a ÅÂ±×¿¡¼­ onclick ÀÌº¥Æ®¸¦ »ç¿ëÇÏÁö ¾Ê±â À§ÇØ
    function win_open(url, name, option)
    {
        var popup = window.open(url, name, option);
        popup.focus();
    }  
     
    // ·Î±×ÀÎ 
    function win_login(url)
    {
        win_open(url, "winLogin", "left=300,top=50,width=340,height=220");
    } 
       
   // ÆÐ½º¿öµå È®ÀÎ
    function win_password(url)
    {
        win_open(url, "winpassword", "left=300,top=50,width=300,height=180");
    }  
 
    // ¿ìÆí¹øÈ£ Ã¢
    function win_zip(frm_name, frm_zip1, frm_zip2, frm_addr1)
    {
        url = "/2008/pop/zipcode.php?frm_name="+frm_name+"&frm_zip1="+frm_zip1+"&frm_zip2="+frm_zip2+"&frm_addr1="+frm_addr1;
        win_open(url, "winZip", "left=50,top=50,width=420,height=360,scrollbars=1");
    }     
    // ¿ìÆí¹øÈ£ Ã¢
    function win_zip1(frm_name, frm_zip1, frm_zip2, frm_addr1, frm_addr2)
    {
        url = "/2008/pop/zipcode.php?frm_name="+frm_name+"&frm_zip1="+frm_zip1+"&frm_zip2="+frm_zip2+"&frm_addr1="+frm_addr1+"&frm_addr2="+frm_addr2;
        win_open(url, "winZip", "left=50,top=50,width=420,height=360,scrollbars=1");
    }    

	// Ã¼Å©¹Ú½ºÀÇ °ªÀ» º¯°æÇÑ´Ù.
	function set_checkbox(form,fname,val) {
		var chk_count=0;
		for(i=0;i<form.length;i++) {
			if(form[i].type=="checkbox" && form[i].name==fname) {
				if(val=='inv') {
					form[i].checked=!form[i].checked;
				} else {
					form[i].checked=val;
				}
				chk_count++;
			}
		}
		return chk_count;
	}

	// Ã¼Å©¹Ú½º¿¡ ÇÏ³ª¶óµµ val°ª°ú ÀÏÄ¡¶ó¸é Âü
	function chk_checkbox(form,fname,val) {
		var Check_List=false;
		for(i=0;i<form.length;i++) {
			if(form[i].type=="checkbox" && form[i].name==fname) {
				if(form[i].checked==val) Check_List=true;
			}
		}
		return Check_List;
	}
	
	// open ÇÔ¼ö ÀçÁ¤ÀÇ
	function window_open() {
		var a=window_open.arguments;
		if(a.length==1)
			window.open(a[0]);
		else if(a.length==2)
			window.open(a[0],a[1]);
		else
			window.open(a[0],a[1],a[2]);
	}
	
	// »óÀ§ÅÂ±× °Ë»öÇØ¼­ °´Ã¼ ¹ÝÈ¯
	function find_parent_tag(e,tag)
	{
		if(e.target)
			var obj = e.target
		else
			var obj = e.srcElement
		while (obj.tagName.toLowerCase() != tag)
		{
			if(obj.parentNode)
				obj = obj.parentNode
			else
				obj = obj.parentElement
			if(typeof(obj.tagName)=='undefined') break;
		}
		return obj
	}
	
	var list_tmp_color="";
	// ¸®½ºÆ®À§¿¡ ¸¶¿ì½º ¿Ã¶ó °¬À» °æ¿ì »ö»óº¯È¯
	function list_over_color(e,color,title_idx) {
		var obj=find_parent_tag(e,'tr');
		if(!obj.style) return;
		var idx = obj.rowIndex;
		if(idx>=title_idx)	 {
			list_tmp_color=obj.style.backgroundColor;
			obj.style.backgroundColor=color
		}
	}
	function list_out_color(e) {
		var obj=find_parent_tag(e,'tr');
		if(obj.style) obj.style.backgroundColor=list_tmp_color
	}
	
	// Åä±ÛÇÔ¼ö
	function toggle_display_object() {
		var a=toggle_display_object.arguments;
		var target=a[0];
		var disp=a[1];
		var on=a[2];
		var off=a[3];
		if(target.style.display=='') {
			target.style.display='none';
			disp.innerHTML=off;
		} else {
			target.style.display='';
			disp.innerHTML=on;
		}
	}
	
	
	// ±Ûº¸±â¿¡¼­ ÀÌ¹ÌÁö Ã³¸®¸¦ À§ÇÑ ºÎºÐ
	var img_width=Array();
	var img_array=Array();
	
	function set_img_width_init() {
		var img = eval((navigator.appName=='Netscape') ? nsdoc+'.view_image' : 'document.all.view_image');
		if(typeof(img)!='undefined') {
			if(img.length>0) {
				for(i=0;i<img.length;i++) {
					img_width[i] = img[i].width;
					img_array[i] = img[i];
				}
			} else {
				img_width[0] = img.width;
				img_array[0] = img;
			}
			setInterval(set_width_img, 100);
		}
		if(set_img_old_onload) set_img_old_onload();
	}
	
	function set_width_img(){
		var view_image_width = eval((navigator.appName=='Netscape') ?
																 nsdoc+'.view_image_width' :
																 'document.all.view_image_width');
		
		if(img_array.length>0) {
			for(i=0;i<img_array.length;i++){ 
				if(img_width[i] > view_image_width.offsetWidth) {
					img_array[i].width = view_image_width.offsetWidth;
				} else if(img_width[i] < view_image_width.offsetWidth) {
					img_array[i].width = img_width[i];
				}
			}
		}
	}

// HTML ·Î ³Ñ¾î¿Â <img ... > ÅÂ±×ÀÇ ÆøÀÌ Å×ÀÌºíÆøº¸´Ù Å©´Ù¸é Å×ÀÌºíÆøÀ» Àû¿ëÇÑ´Ù.
function resizeBoardImage(imageWidth, borderColor) {
    var target = document.getElementsByName('target_resize_image[]');
    var imageHeight = 0;

    if (target) {
        for(i=0; i<target.length; i++) { 
            // ¿ø·¡ »çÀÌÁî¸¦ ÀúÀåÇØ ³õ´Â´Ù
            target[i].tmp_width  = target[i].width;
            target[i].tmp_height = target[i].height;
            // ÀÌ¹ÌÁö ÆøÀÌ Å×ÀÌºí Æøº¸´Ù Å©´Ù¸é Å×ÀÌºíÆø¿¡ ¸ÂÃá´Ù
            if(target[i].width > imageWidth) {
                imageHeight = parseFloat(target[i].width / target[i].height)
                target[i].width = imageWidth;
                target[i].height = parseInt(imageWidth / imageHeight);
                target[i].style.cursor = 'pointer';

                // ½ºÅ¸ÀÏ¿¡ Àû¿ëµÈ ÀÌ¹ÌÁöÀÇ Æø°ú ³ôÀÌ¸¦ »èÁ¦ÇÑ´Ù
                target[i].style.width = '';
                target[i].style.height = '';
            }

            if (borderColor) {
                target[i].style.borderWidth = '1px';
                target[i].style.borderStyle = 'solid';
                target[i].style.borderColor = borderColor;
            }
        }
    }
}
	
	function view_image_popup(img) {
		var img_window=window.open('',img_window,'scrollbars=yes,resizable=yes,width=100,height=100');
		if(img_window) {
			img_window.document.writeln('<html>');
			img_window.document.writeln('<title>ÀÌ¹ÌÁöº¸±â</title>');

			img_window.document.writeln('<scr'+'ipt>');
			img_window.document.writeln('function load_image() {');
			img_window.document.writeln('if((view_image.width+30)>(screen.width-5)) ');
			img_window.document.writeln('imgWidth=screen.width-5;');
			img_window.document.writeln('else');
			img_window.document.writeln('imgWidth=view_image.width+30;');
			
			img_window.document.writeln('if((view_image.height+55)>(screen.height-30)) ');
			img_window.document.writeln('imgHeight=screen.height-30;');
			img_window.document.writeln('else');
			img_window.document.writeln('imgHeight=view_image.height+55;');
			
			img_window.document.writeln('var x=screen.width/2-imgWidth/2;');
			img_window.document.writeln('var y=(screen.height-30)/2-imgHeight/2;');
			img_window.document.writeln('self.resizeTo(imgWidth,imgHeight);');
			img_window.document.writeln('self.moveTo(x,y);');			
			img_window.document.writeln('}');
			img_window.document.writeln('</scr'+'ipt>');		}

			img_window.document.writeln('<body bottommargin="0" topmargin="0" leftmargin="0" rightmargin="0">');
			img_window.document.writeln('<img src="'+img.src+'" id="view_image" onclick="self.close()" style="cursor:hand;" onload="load_image()">');
			img_window.document.writeln('</body>');
			img_window.document.writeln('</html>');
	}
	
    function image_window(img)
    {
        var w = img.tmp_width; 
        var h = img.tmp_height; 
        var winl = (screen.width-w)/2; 
        var wint = (screen.height-h)/3; 

        if (w >= screen.width) { 
            winl = 0; 
            h = (parseInt)(w * (h / w)); 
        } 

        if (h >= screen.height) { 
            wint = 0; 
            w = (parseInt)(h * (w / h)); 
        } 

        var js_url = "<script language='JavaScript1.2'> \n"; 
            js_url += "<!-- \n"; 
            js_url += "var ie=document.all; \n"; 
            js_url += "var nn6=document.getElementById&&!document.all; \n"; 
            js_url += "var isdrag=false; \n"; 
            js_url += "var x,y; \n"; 
            js_url += "var dobj; \n"; 
            js_url += "function movemouse(e) \n"; 
            js_url += "{ \n"; 
            js_url += "  if (isdrag) \n"; 
            js_url += "  { \n"; 
            js_url += "    dobj.style.left = nn6 ? tx + e.clientX - x : tx + event.clientX - x; \n"; 
            js_url += "    dobj.style.top  = nn6 ? ty + e.clientY - y : ty + event.clientY - y; \n"; 
            js_url += "    return false; \n"; 
            js_url += "  } \n"; 
            js_url += "} \n"; 
            js_url += "function selectmouse(e) \n"; 
            js_url += "{ \n"; 
            js_url += "  var fobj      = nn6 ? e.target : event.srcElement; \n"; 
            js_url += "  var topelement = nn6 ? 'HTML' : 'BODY'; \n"; 
            js_url += "  while (fobj.tagName != topelement && fobj.className != 'dragme') \n"; 
            js_url += "  { \n"; 
            js_url += "    fobj = nn6 ? fobj.parentNode : fobj.parentElement; \n"; 
            js_url += "  } \n"; 
            js_url += "  if (fobj.className=='dragme') \n"; 
            js_url += "  { \n"; 
            js_url += "    isdrag = true; \n"; 
            js_url += "    dobj = fobj; \n"; 
            js_url += "    tx = parseInt(dobj.style.left+0); \n"; 
            js_url += "    ty = parseInt(dobj.style.top+0); \n"; 
            js_url += "    x = nn6 ? e.clientX : event.clientX; \n"; 
            js_url += "    y = nn6 ? e.clientY : event.clientY; \n"; 
            js_url += "    document.onmousemove=movemouse; \n"; 
            js_url += "    return false; \n"; 
            js_url += "  } \n"; 
            js_url += "} \n"; 
            js_url += "document.onmousedown=selectmouse; \n"; 
            js_url += "document.onmouseup=new Function('isdrag=false'); \n"; 
            js_url += "//--> \n"; 
            js_url += "</"+"script> \n"; 

        var settings;

        if (site_is_gecko) {
            settings  ='width='+(w+10)+','; 
            settings +='height='+(h+10)+','; 
        } else {
            settings  ='width='+w+','; 
            settings +='height='+h+','; 
        }
        settings +='top='+wint+','; 
        settings +='left='+winl+','; 
        settings +='scrollbars=no,'; 
        settings +='resizable=yes,'; 
        settings +='status=no'; 


        win=window.open("","image_window",settings); 
        win.document.open(); 
        win.document.write ("<html><head> \n<meta http-equiv='imagetoolbar' CONTENT='no'> \n<meta http-equiv='content-type' content='text/html; charset="+site_charset+"'>\n"); 
        var size = "ÀÌ¹ÌÁö »çÀÌÁî : "+w+" x "+h;
        win.document.write ("<title>"+size+"</title> \n"); 
        if(w >= screen.width || h >= screen.height) { 
            win.document.write (js_url); 
            var click = "ondblclick='window.close();' style='cursor:move' title=' "+size+" \n\n ÀÌ¹ÌÁö »çÀÌÁî°¡ È­¸éº¸´Ù Å®´Ï´Ù. \n ¿ÞÂÊ ¹öÆ°À» Å¬¸¯ÇÑ ÈÄ ¸¶¿ì½º¸¦ ¿òÁ÷¿©¼­ º¸¼¼¿ä. \n\n ´õºí Å¬¸¯ÇÏ¸é ´ÝÇô¿ä. '"; 
        } 
        else 
            var click = "onclick='window.close();' style='cursor:pointer' title=' "+size+" \n\n Å¬¸¯ÇÏ¸é ´ÝÈü´Ï´Ù. '"; 
        win.document.write ("<style>.dragme{position:relative;}</style> \n"); 
        win.document.write ("</head> \n\n"); 
        win.document.write ("<body leftmargin=0 topmargin=0 bgcolor=#dddddd style='cursor:arrow;'> \n"); 
        win.document.write ("<table width=100% height=100% cellpadding=0 cellspacing=0><tr><td align=center valign=middle><img src='"+img.src+"' width='"+w+"' height='"+h+"' border=0 class='dragme' "+click+"></td></tr></table>");
        win.document.write ("</body></html>"); 
        win.document.close(); 

        if(parseInt(navigator.appVersion) >= 4){win.window.focus();} 
    }

function scroll() {
  this.name = "scroll";
  this.item = new Array();
  this.itemcount = 0;
  this.currentspeed = 0;
  this.scrollspeed = 50;
  this.pausedelay = 1000;
  this.pausemouseover = false;
  this.stop = false;
  this.type = 1;
  this.height = 100;
  this.width = 100;
  this.stopHeight=0;
  this.add =function () {
   var text = arguments[0];
   this.item[this.itemcount] = text;
   this.itemcount = this.itemcount + 1;
  };
  this.start = function () {
   this.display();
   this.currentspeed = this.scrollspeed;
   setTimeout(this.name+'.scroll()',this.currentspeed);
  };
  this.display =function () {
   document.write('<div id="'+this.name+'" style="height:'+this.height+';width:'+this.width+';position:relative;overflow:hidden;" OnMouseOver="'+this.name+'.onmouseover();" OnMouseOut="'+this.name+'.onmouseout();">');
   for(var i = 0; i < this.itemcount; i++) {if ( this.type == 1) {
     document.write('<div id="'+this.name+'item'+i+'"style="left:0px;width:'+this.width+';position:absolute;top:'+(this.height*i+1)+'px;">');
     document.write(this.item[i]);
     document.write('</div>');
    }
    else if ( this.type == 2 ) {
     document.write('<div id="'+this.name+'item'+i+'"style="left:'+(this.width*i+1)+'px;width:'+this.width+';position:absolute;top:0px;">');
     document.write(this.item[i]);
     document.write('</div>');
    }
   }
   document.write('</div>');
  };
  this.scroll = function () {
   this.currentspeed = this.scrollspeed;if ( !this.stop ) {
    for (i = 0; i < this.itemcount; i++) {
     obj = document.getElementById(this.name+'item'+i).style;if ( this.type == 1 ) {
      obj.top = parseInt(obj.top) - 1;
      if ( parseInt(obj.top) <= this.height*(-1) ) obj.top = this.height * (this.itemcount-1);
      if ( parseInt(obj.top) == 0 || ( this.stopHeight > 0 && this.stopHeight - parseInt(obj.top) == 0 ) ) this.currentspeed = this.pausedelay;
     }
     else if ( this.type == 2 ) {
      obj.left = parseInt(obj.left) - 1;
      if ( parseInt(obj.left) <= this.left*(-1) ) obj.left = this.left* (this.itemcount-1);
      if ( parseInt(obj.left) == 0 ) this.currentspeed = this.pausedelay;
     }
    }
   }
   window.setTimeout(this.name+".scroll()",this.currentspeed);
  };
  this.onmouseover = function () {
   if ( this.pausemouseover ) {
   this.stop = true;}
  };
  this.onmouseout = function () {
   if ( this.pausemouseover ) {
    this.stop = false;
   }
  };
 }

//µ¿¿µ»ó
function Movies(){
	var objmediaP = "<object id='MPlayer' name='MPlayer' width=640 height=480  classid='CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95' codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701' standby='Loading Microsoft Windows Media Player components...' type='application/x-oleobject' style='filter:gray();'>" ;
	objmediaP = objmediaP + "<param name='ANIMATIONATSTART' value='0'>";
	objmediaP = objmediaP + "<param name='AUTOSTART' value='1'>";
	objmediaP = objmediaP + "<param name='BALANCE' value='0'> ";
	objmediaP = objmediaP + "<param name='CURRENTMARKER' value='0'> ";
	objmediaP = objmediaP + "<param name='CURRENTPOSITION' value='0'> ";
	objmediaP = objmediaP + "<param name='DISPLAYMODE' value='4'>";
	objmediaP = objmediaP + "<param name='ENABLECONTEXTMENU' value='0'>";
	objmediaP = objmediaP + "<param name='ENABLED' value='1'>";
	objmediaP = objmediaP + "<param name='FULLSCREEN' value='0'>";
	objmediaP = objmediaP + "<param name='INVOKEURLS' value='1'>";
	objmediaP = objmediaP + "<param name='PLAYCOUNT' value='1'> ";
	objmediaP = objmediaP + "<param name='RATE' value='1'> ";
	objmediaP = objmediaP + "<param name='SHOWCONTROLS' value='1'>";
	objmediaP = objmediaP + "<param name='SHOWSTATUSBAR' value='-1'>";
	objmediaP = objmediaP + "<param name='STRETCHTOFIT' value='0'> ";
	objmediaP = objmediaP + "<param name='TRANSPARENTATSTART' value='1'> "  ;
	objmediaP = objmediaP + "<param name='UIMODE' value='FULL'>";
	objmediaP = objmediaP + "<param name='displaybackcolor' value='0'>";
	objmediaP = objmediaP + "</object>";
	document.write(objmediaP);
}

function MoviesAuto(Msrc){
	var objmediaP = "<object id='MPlayer' name='MPlayer' width=640  height=480 classid='CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95' codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701' standby='Loading Microsoft Windows Media Player components...' type='application/x-oleobject' >" ;
	objmediaP = objmediaP + "<param name='AUTOSTART' value='1'>";
	objmediaP = objmediaP + "<param name='FileName' value='"+Msrc+"'>";
	objmediaP = objmediaP + "<param name='SHOWSTATUSBAR' value='-1'>";
	objmediaP = objmediaP + "<param name='TRANSPARENTATSTART' value='1'> "  ;
	objmediaP = objmediaP + "<param name='UIMODE' value='FULL'>";
	objmediaP = objmediaP + "<param name='displaybackcolor' value='0'>";
	objmediaP = objmediaP + "<embed id='MovieP' type='application/x-mplayer2' pluginspage = 'http://www.microsoft.com/windows/mediaplayer/' src='"+Msrc+"' name='mediaplayer1' width=640  height=480 autostart=true></embed>";
	objmediaP = objmediaP + "</object>";
	document.write(objmediaP);
}

function CmdVODPlayer(surl) {
		try{
   
		    win_open("../pop/movie.php?surl="+surl, "Player", "left=50,top=50,width=670,height=615,scrollbars=0");
		    openwin.focus();
	       }
	       catch(e)
	       {top.window.status="It's happen error";}
}

function CmdVODPlayer1(type, speed, progcd, seq,category) {
		try{
			var sUrl, sSize;
			if (type == "V")
		    {
		        sUrl = "/Player/ContentsVODPlayer_space.asp?speed=" + speed + "&progcd=" + progcd + "&vseq=" + seq + "&category=" + category;
		        sSize = "width=358,height=466";
		    }
	   
		    var openwin = window.open("","CmdContentsPlayer",sSize);
		    var oIFRAME = document.createElement("<a href=\"http://www.ebs.co.kr" + sUrl + "\" target='CmdContentsPlayer'></a>");
		    document.body.appendChild(oIFRAME);
		        oIFRAME.click();
		        openwin.focus();
	       }
	       catch(e)
	       {top.window.status="It's happen error";}
}

function vodplay(val,val1,val2,val3,val4){

    window.open("http://home.ebs.co.kr/servlet/wizard.servlet.admin.program.vodaodListServlet?client_id=home4365&command=vodplayer&charge=A&program_id="+val+"&step_no="+val1+"&seq="+val2+"&type="+val3+"&vodseq="+val4 ,'vod', 'width=846, height=717');

}


//µ¿¿µ»ó
function view_movie(val,val1){

    window.open("/2010/include/movie.html?num="+val+"&url="+val1,'vod', 'width=650, height=490');

}

//2011µ¿¿µ»ó
function view_movie2011(val,val1){

    window.open("/2011/include/movie.html?num="+val+"&url="+val1,'vod', 'width=650, height=490');

}

}
