//################################################################
//START: COMMON SCRIPT
//################################################################
function screening_schedule(){ 
	//2010.09.25 -----
	window.open("/structure/addon/module/00000025/pop_kor.asp","Duo_event_win4","width=400,height=520, toolbar=0,scrollbars=1,scroll=1,resizable=no, top=5, left=425");			
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function search_film(){
	window.open("/kor/html/board/sel_film.asp","film_choice","width=520,height=400,menubar=no, toolbar=no,scrollbars=yes");
}

//°Ô½ÃÆÇ ¸µÅ©ÀÌµ¿
function MM_jumpYear(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}  

//ÀÌ¹ÌÁöÁ¡¼±Á¦°Å************************
function autoBlur(){ 
  if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") 
  document.body.focus(); 
} 
//document.onfocusin=autoBlur; 


//*********************************************************************************
function ticketEbook() { //v2.0
  showEbook('/9611_DATA/EBOOK_FILE/20060918/view.htm',1024,768);
  //alert('ÁØºñÁßÀÔ´Ï´Ù.');
}

function showEbook(url,_width,_height){
	if(window.clientInformation.userAgent.indexOf("SV1")>0){
		//--WindowXP SP2°¡ ¼³Ä¡µÈ È¯°æ¿¡¼­ÀÇ ¼¼ÆÃÀÔ´Ï´Ù.
		newWin = window.open(url,"","toolbar=no location=no directories=no status=no menubar=no scrollbars=no resizable=no width=1024 height=768 top=0 left=0");
		newWin.moveTo(0,0);
		left1=(screen.availWidth-1024-5)/2;
		//--1024X768 ÇØ»óµµ¿¡¼­ÀÇ eBook Popup Ã¢ÀÇ °¡·Î Áß¾Ó À§Ä¡¸¦ ÁöÁ¤.
		top1=(screen.availHeight-768-10)/2;
		//--1024X768 ÇØ»óµµ¿¡¼­ÀÇ eBook Popup Ã¢ÀÇ ¼¼·Î Áß¾Ó À§Ä¡¸¦ ÁöÁ¤.
		//À§ 1024, 768 ÀÇ Á¶Á¤À¸·Î Ã¢ÀÌ ³ªÅ¸³ª´Â À§Ä¡¸¦ Á¶Á¤ÇÒ ¼ö ÀÖ½À´Ï´Ù.
		newWin.resizeTo(1024,768);
		newWin.moveTo(left1,top1);
	}else{
		//--Windows XP SP2 °¡ ¼³Ä¡µÈ È¯°æÀ» Á¦¿ÜÇÑ È¯°æ
		if(screen.width==_width&&screen.height==_height) {
			window.open(url,"","fullscreen");
			window.open(url,"","fullscreen");
		} else {
			left1=(screen.availWidth-1024-5)/2;
			top1=(screen.availHeight-768-10)/2;
			window.open(url,"","toolbar=no location=no directories=no status=no menubar=no scrollbars=no resizable=no width=1024 height=768 top="+top1+" left="+left1);
		}
	}
}
//*********************************************************************************

function historyback() {
	window.history.back();
}

function AutoResize(img){ 
foto1= new Image(); 
foto1.src=(img); 
Controlla(img); 
} 
function Controlla(img){ 
if((foto1.width!=0)&&(foto1.height!=0)){ 
viewFoto(img); 
} 
else{ 
funzione="Controlla('"+img+"')"; 
intervallo=setTimeout(funzione,20); 
} 
} 
function viewFoto(img){ 
largh=foto1.width+20; 
altez=foto1.height+20; 
stringa="width="+largh+",height="+altez; 
finestra=window.open('/structure/addon/module/00000010/photo_viewer.asp?image='+img,"",stringa); 
} 

//   ·Ñ¿À¹ö ¹öÆ° ½ºÅ©¸³Æ®
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];}
}


function search_news1() {
  document.search.action = "new_piffnews.asp";
  document.search.submit();
}

function search_news2() {
  document.search.action = "arc_board_list.asp";
  document.search.submit();
}

function search_news3() {
  document.search.action = "pro_guide.asp";
  document.search.submit();
}

function search_program() {
	if(document.search.title.checked == false && document.search.director.checked == false && document.search.make_country.checked == false){
		alert("Check Title or Director");
		document.search.title.focus();
		return false;
	}else if(document.search.searchString.value.length <= 0) {
	     alert("Check Search Text");
		document.search.searchString.focus();
		return false;
	}else{
	if(document.search.sarea.value == "whole"){
		document.search.c_idx.value	= "";	
		document.search.action = "prog_list.asp";
		document.search.submit();
		return false;
   	}else{
     document.search.action = "prog_list.asp";
     document.search.submit();
     return false;
     }
   }
}

function search_history() {
	if(document.search.title.checked == false && document.search.director.checked == false && document.search.make_country.checked == false){
		alert("Check Title or Director");
		document.search.title.focus();
		return false;
	}else if(document.search.searchString.value.length <= 0) {
	     alert("Check Search Text");
		document.search.searchString.focus();
		return false;
	}else{
     document.search.c_idx.value = "";
     document.search.action = "arc_history_search.asp";
     document.search.submit();
     return false;
   }
}

function search_arc() {
	if(document.search.title.checked == false && document.search.director.checked == false && document.search.make_country.checked == false){
		alert("Check Title or Director");
		document.search.title.focus();
		return false;
	}else if(document.search.searchString.value.length <= 0) {
	     alert("Check Search Text");
		document.search.searchString.focus();
		return false;
	}else{
     document.search.c_idx.value = "";
     document.search.action = "arc_search.asp";
     document.search.submit();
     return false;
   }
}

//-----------------------------------------------------------------------------------------------------------------------
function sendit_show(x,selObj)
{
	switch (selObj){
	case "date": 
		document.myform.day1.value = x;
		document.myform.myform.value = "date";
		document.myform.submit();
		break;
	case "theater": 
		document.myform.s_theater.value = x;
		document.myform.myform.value = "theater";
		document.myform.submit();
		break;
	case "section": 
		document.myform.c_idx.value = x;
		document.myform.myform.value = "section";
		document.myform.submit();		
		break;
	}	
}

function pageprint(x,selObj) {
	switch (selObj){
	case "date": 
		window.open("./date_print.asp?page_print=1&day1=" + x,"page_print","width=715,height=600, menubar=no, toolbar=no, scrollbars=yes");
		break;
	case "theater": 
		window.open("./theater_print.asp?page_print=1&s_theater=" + x,"page_print","width=715,height=600, menubar=no, toolbar=no, scrollbars=yes");
		break;
	case "section": 
		window.open("./section_print.asp?page_print=1&c_idx=" + x,"page_print","width=715,height=600, menubar=no, toolbar=no, scrollbars=yes");
		break;
	}	
}
//-----------------------------------------------------------------------------------------------------------------------

var ie=document.all
var ieNOTopera=document.all&&navigator.userAgent.indexOf("Opera")==-1

function toggle2(e) {
      e.style.visibility="hidden";
}

function toggle3(e) {
      e.style.visibility="visible";
}

function toggle1(e) {

var dsocleft=ie? document.body.scrollLeft : pageXOffset
var dsoctop=ie? document.body.scrollTop : pageYOffset
var window_width=ieNOTopera? document.body.clientWidth : window.innerWidth-20
var window_height=ieNOTopera? document.body.clientHeight : window.innerHeight


   if(e.style.visibility=="hidden") {
      var iObject = e;
    
       if ((dsocleft + event.x ) > (window_width + dsocleft -250)) {
        iObject.style.left =  dsocleft + event.x-50;
       } else {
        iObject.style.left =  dsocleft + event.x-10;
       } 
      
       if ((dsoctop + event.y ) > (window_height + dsoctop - 150)) {
        iObject.style.top =  dsoctop + event.y-20;
       } else {
        iObject.style.top =  dsoctop + event.y-20;
       } 
      
      
      iObject.style.visibility="visible";
     
   }
}

/*---------------------------------------------------------------------------------------------------
	AutoPlay¢â °ü·Ã ÇÔ¼ö
---------------------------------------------------------------------------------------------------*/

/* ÀÌ¹ÌÁö¿ë AutoPlay¢â ÇÔ¼ö */
function autoplay_image( item_sn) { xfile_image( item_sn); }

/* ½ºÆ®¸²¿ë AutoPlay¢â ÇÔ¼ö */
function autoplay_stream( item_sn) { xfile_stream( item_sn); }

/* ÇÃ·¡½Ã¿ë AutoPlay¢â ÇÔ¼ö */
function autoplay_flash( item_sn,item_width,item_height) { xfile_flash( item_sn,item_width,item_height); }

/* ÀÌ¹ÌÁö¿ë AutoPlay¢â ¼­ºê ÇÔ¼ö */
function xfile_image( item_sn){
	document.write("<img src='./article_attach.asp?filename=" + item_sn + "' title='Å¬¸¯ÇÏ½Ã¸é »õÃ¢À¸·Î º¸½Ç ¼ö ÀÖ½À´Ï´Ù.' border='0' onClick=AutoResize('/9611_DATA/ARTICLE_DATA/" +item_sn +"')>");
}

/* ½ºÆ®¸²¿ë AutoPlay¢â ¼­ºê ÇÔ¼ö */
function xfile_stream( item_sn){
	document.write("<embed id='stream_area' src='./article_attach.asp?filename=" + item_sn + "' autostart='1' autosize='0' autoresize='0' animationatstart='0' transparentatstart='1' autorewind='1' showdisplay='0' clicktoplay='1' enablecontextmenu='0' showpositioncontrols='1'  ShowControls='1'  ShowStatusBar='1' width='320' height='240'></embed>");
}

/* ÇÃ·¡½Ã¿ë AutoPlay¢â ¼­ºê ÇÔ¼ö */
function xfile_flash(item_sn,item_width,item_height){
	document.write("<embed id='flash_area' src='/kor/html/editorial/article/article_attach.asp?filename=" + item_sn + "' width='" + item_width + "' height='" + item_height + "' quality='high' Scale='NoScale' pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' enablecontextmenu='false' type='application/x-shockwave-flash'></embed>");
}	

// ¿©±â¼­ºÎÅÍ ÇÃ·¡½Ã ½ºÅ©¸³Æ®
function objflash(URL,wid,hei,mode,LT,scale)
{
document.write("<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='"+wid+"' height='"+hei+"'>");
document.write("<param name='movie' value='"+URL+"'>");
document.write("<param name='quality' value='high'>");
document.write("<param name='WMODE' value='"+mode+"'>");
document.write("<param name='salign' value='"+LT+"'>");
document.write("<param name='scale' value='" + scale + "'>");
document.write("<embed src='"+URL+"' width='"+wid+"' height='"+hei+"' quality='high' wmode='"+mode+"' scale='"+scale+"' salign='"+LT+"' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash'></embed>");
document.write("</object>");
}

function swf(src,w,h) {
 html = '';
 html += '<object type="application/x-shockwave-flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" id="param" width="'+w+'" height="'+h+'">';
 html += '<param name="movie" value="'+src+'">';
 html += '<param name="quality" value="high">';
 html += '<param name="bgcolor" value="#ffffff">';
 html += '<param name="menu" value="false">';
 html += '<param name="wmode" value="transparent">';
 html += '<param name="swliveconnect" value="true">';
 html += '<embed src="'+src+'" quality=high bgcolor="#ffffff" menu="false" width="'+w+'" height="'+h+'" swliveconnect="true" id="param" name="param" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"><\/embed>';
 html += '<\/object>';
 document.write(html);
}
// ¿©±â±îÁö ÇÃ·¡½Ã ½ºÅ©¸³Æ®



//################################################################
//END: COMMON SCRIPT
//################################################################



//################################################################
//START: MARQUEE DESIGN
//################################################################
var tID       = null;
var getObj	= null;
var mq = new classMQ();

function classMQ() 
{
} 

classMQ.prototype.set = function( obj )
{
getObj	= obj;
this.BLANK     = "                 ";
this.CONTENT = getObj.value;
this.SCROLL    = this.BLANK + this.CONTENT + this.BLANK + this.CONTENT;
}

classMQ.prototype.scroll = function( ) 
{
if (!getObj)	return;	
			
var value = getObj.value;
getObj.value = value.substring(1);
if ("" == getObj.value.length)
{
	getObj.value = this.SCROLL;
}			
}

classMQ.prototype.init = function(  ) 
{
if (!getObj)	return;
getObj.value = this.CONTENT;
}
//################################################################
//END: MARQUEE DESIGN
//################################################################


//################################################################
//START: IFRAME DESIGN
//################################################################

/*
 * iframeÀÇ ÃÖ¼Ò Å©±â¸¦ µðÆúÆ® °ªÀ¸·Î ¼³Á¤ÇØ ÁØ´Ù.
 * iframeÀº ¾Æ·¡ Å©±âº¸´Ù ÀÛ°Ô resizingµÇÁö ¾Ê´Â´Ù.
 */ 
var min_width_iframe = 690; 
var min_height_iframe = 311;
var min_size_apply = 0;

function set_min_size(width, height)
	{
	min_width_iframe = width;
	min_height_iframe = height;
	min_size_apply = 1;
	}

function p_resizeiframe(name)
{
  if (eval('parent.'+name+' == null'))
  {
    if (top && top != this && top.resizeframe_board && eval('top.'+name))
      top.resizeframe_board(name);
	  if(parent && parent != this && parent.resizeiframe != null)
		  parent.resizeiframe('bd_body');
  }
  else
  {
	  if(parent && parent != this && parent.resizeiframe != null)
		{
		  parent.resizeiframe(name);
		}
  }
}

function resizeiframe(name)
{
	if(name == null || name == "")
  {
		name="memo";
	}

	try
	{       
		var oBody = document.frames(name).document.body;
		var oFrame = document.all(name);
		var i_height = oBody.scrollHeight + (oBody.offsetHeight-oBody.clientHeight);
		var i_width = oBody.scrollWidth + (oBody.offsetWidth-oBody.clientWidth);
                
		if(min_size_apply)
    {
      if(i_height < min_height_iframe)
      {
        i_height = min_height_iframe;
      }
      if(i_width < min_width_iframe)
      {
        i_width = min_width_iframe;
      }
    }
		oFrame.style.height = i_height;
		oFrame.style.width = i_width;

	
    if (i_width > 625) // 800X600 »ç¿ëÀÚ¸¦ À§ÇÑ ½ºÅ©·Ñ »ý¼º¿ë
    {
      var table_nav = document.all('tbl_navigation');
      var table_main = document.all('tbl_main');
      var table_top = document.all('tbl_top');
      var table_menu = document.all('tbl_menu');
      var main_width = Number(table_menu.width) + i_width;     
      table_nav.style.width = main_width;
      table_top.style.width = main_width;
      table_main.style.width = main_width;
    }
    
  }
	catch(e)
  {
    //window.status = 'Error: ' + e.number + '; ' + e.description;
    window.status = '¿Ï·á';
  }
}

/* °Ô½ÃÆÇ Ã³¸®¿ë ÇÔ¼öµé */
function resizeframe_board(name)
{
  var oBody = document.frames(name).frames('bd_body').document.body;
  var oFrame = document.all(name);
  var i_height = oBody.scrollHeight + (oBody.offsetHeight-oBody.clientHeight);
	var i_width = oBody.scrollWidth + (oBody.offsetWidth-oBody.clientWidth);
  oFrame.style.height = i_height+1;
	oFrame.style.width = i_width;
}

function resizeBody()
{
	document.all.tblMain.height = document.body.clientHeight - document.all.tblTop.offsetHeight;
}



//################################################################
//END: IFRAME DESIGN
//################################################################

//START: PART1
// ¼Ò½ÄÅÇ
var on_notice_image = Array();
var out_notice_image = Array();



// ¸¶¿ì½º¸¦ ¿Ã·ÈÀ»¶§ÀÇ ÀÌ¹ÌÁö°æ·Î
on_notice_image[0] = "/kor/img/index/tab01_.gif";
on_notice_image[1] = "/kor/img/index/tab02_.gif";
on_notice_image[2] = "/kor/img/index/tab03_.gif";
on_notice_image[3] = "/kor/img/index/tab04_.gif";


// ¸¶¿ì½º¸¦ ¿À¹öµÇÁö ¾Ê¾ÒÀ»¶§ÀÇ ÀÌ¹ÌÁö°æ·Î
out_notice_image[0] = "/kor/img/index/tab01.gif";
out_notice_image[1] = "/kor/img/index/tab02.gif";
out_notice_image[2] = "/kor/img/index/tab03.gif";
out_notice_image[3] = "/kor/img/index/tab04.gif";


// Å×ÀÌºíÀÇ ±â´É±¸Çö
function onmouseover_notice(num){
more_num = num;
var oEl = document.getElementsByName("notice_mm");
var oEl_Contnets = document.getElementsByName("notice_content");
if(oEl){
for(count=0; count < oEl.length; count++){
oEl[count].src = out_notice_image[count];
oEl_Contnets[count].style.display = "none";
	}
	}
oEl[num-1].src = on_notice_image[num-1];
oEl_Contnets[num-1].style.display = "";

}
//END: PART1


//START: PART2
// ¼Ò½ÄÅÇ
var on_salon_image = Array();
var out_salon_image = Array();



// ¸¶¿ì½º¸¦ ¿Ã·ÈÀ»¶§ÀÇ ÀÌ¹ÌÁö°æ·Î
on_salon_image[0] = "/kor/img/index/mm01_on.gif";
on_salon_image[1] = "/kor/img/index/mm02_on.gif";
on_salon_image[2] = "/kor/img/index/mm03_on.gif";
on_salon_image[3] = "/kor/img/index/mm04_on.gif";


// ¸¶¿ì½º¸¦ ¿À¹öµÇÁö ¾Ê¾ÒÀ»¶§ÀÇ ÀÌ¹ÌÁö°æ·Î
out_salon_image[0] = "/kor/img/index/mm01.gif";
out_salon_image[1] = "/kor/img/index/mm02.gif";
out_salon_image[2] = "/kor/img/index/mm03.gif";
out_salon_image[3] = "/kor/img/index/mm04.gif";


// Å×ÀÌºíÀÇ ±â´É±¸Çö
function onmouseover_salon(num){
more_num = num;
var oEl = document.getElementsByName("salon_mm");
var oEl_Contnets = document.getElementsByName("salon_content");
if(oEl){
for(count=0; count < oEl.length; count++){
oEl[count].src = out_salon_image[count];
oEl_Contnets[count].style.display = "none";
	}
	}
oEl[num-1].src = on_salon_image[num-1];
oEl_Contnets[num-1].style.display = "";

}
//END: PART2


function setPng24(obj) {
obj.width=obj.height=1;
obj.className=obj.className.replace(/\bpng24\b/i,'');
obj.style.filter =
"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');"
obj.src=''; 
return '';
}

function ScreenSizeAlert(idname,maxheight) { //¸¶¿ì½º¿À¹ö¾Æ¿ôÇÔ¼öÇÒ´ç
//	alert(maxheight);
	document.getElementById(idname).style.height=maxheight+"px";
}
