
/*********************************************
¿©±â¼­ºÎÅÍ ÆÛºí¸®½Ì JS
**********************************************/
document.title = "No.1 ¿µÈ­Æ÷ÅÐ, CGV";

try {
    document.execCommand('BackgroundImageCache', false, true);
} catch (e) { }

/**********  PNG24 Åõ¸íÃ³¸®  **********************/
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 getCookie(_cookieName) {
    var currcookie = setCookie("cgv.cookie");

    var cookieList = currcookie.split("&");
    var cookieValue = "";
    for (i = 0; i < cookieList.length; i++) {
        if (cookieList[i].indexOf(_cookieName + "=") > -1) {
            if (cookieList[i].split("=")[0].replace(/\s/g, "") == _cookieName) {
                cookieValue = decodeURIComponent(cookieList[i].split("=")[1]);
                break;
            }
        }
    }
    
    return cookieValue;     
}

function getCookieRia(_cookieName) {
    var currcookie = setCookie("cgv.cookie");
	var cookieValue = "";

	try {
    var cookieList = currcookie.split("&");
    for (i = 0; i < cookieList.length; i++) {
        if (cookieList[i].indexOf(_cookieName + "=") > -1) {
            if (cookieList[i].split("=")[0].replace(/\s/g, "") == _cookieName) {
                cookieValue = decodeURIComponent(cookieList[i].split("=")[1]);
                break;
            }
        }
    }
    } catch (e) {}
    return cookieValue;     
}


function setCookie(name) {
    var nameOfCookie = name + "=";
    var x = 0;
    while (x <= document.cookie.length) {
        var y = (x + nameOfCookie.length);
        if (document.cookie.substring(x, y) == nameOfCookie) {
            if ((endOfCookie = document.cookie.indexOf(";", y)) == -1)
                endOfCookie = document.cookie.length;
            return unescape(document.cookie.substring(y, endOfCookie));
        }
        x = document.cookie.indexOf(" ", x) + 1;
        if (x == 0)
            break;
    }
    return "";
}

function getCookieCommon(name) {
	var dc = document.cookie;
	if ( dc.length > 0 ) {
		var start = dc.indexOf(name + "=");
		if ( start > -1) { 
    		start = start + name.length + 1;
    		var end = dc.indexOf(";", start);
    		if ( end == -1 ) {
	   			return unescape(dc.substring(start));
    		} else {
	   			return unescape(dc.substring(start, end));
    		}
    	} 
	}

	return "";
}


function CheckCookie_Process() {
	try {
		if (document.cookie != "") {
			thisCookie = document.cookie.split("; ");
			//expireDate = new Date();
			//expireDate.setDate(expireDate.getDate() - 1);
			//alert(thisCookie);
			for (i = 0; i < thisCookie.length; i++) {
				cookieName = thisCookie[i].split("=")[0];
				//document.cookie = cookieName + "=;expires=" + expireDate.toGMTString();
			}
		}
	} catch (e) {
	}
}

//CheckCookie_Process();
/********************************************************************************************************
°¡º¯¹Ú½º ¼³Á¤
********************************************************************************************************/
function setFlexibleBox(_roundContents, _roundStyle, _classParam) {
    try {
        var roundContents = _roundContents;
        var roundStyle = _roundStyle;
        var classParam = _classParam;

        var tbRoundBox = document.createElement("table");
        if (!classParam) {
            tbRoundBox.className = roundStyle;
        } else {
            tbRoundBox.className = roundStyle + " " + classParam;
        }

        var trTop = tbRoundBox.insertRow(0);
        var tdTopLeft = trTop.insertCell(0);
        tdTopLeft.className = "rtTL";
        var tdTop = trTop.insertCell(1);
        tdTop.className = "rtT";
        var tdTopRight = trTop.insertCell(2);
        tdTopRight.className = "rtTR";

        var trMiddle = tbRoundBox.insertRow(1);
        var tdLeft = trMiddle.insertCell(0);
        tdLeft.className = "rtL";
        var tdCenter = trMiddle.insertCell(1);
        tdCenter.className = "rtC";
        var tdRight = trMiddle.insertCell(2);
        tdRight.className = "rtR";

        var trBottom = tbRoundBox.insertRow(2);
        var tdBottomLeft = trBottom.insertCell(0);
        tdBottomLeft.className = "rtBL";
        var tdBottom = trBottom.insertCell(1);
        tdBottom.className = "rtB";
        var tdBottomRight = trBottom.insertCell(2);
        tdBottomRight.className = "rtBR";

        var parentRoundContents = roundContents.parentNode;
        parentRoundContents.insertBefore(tbRoundBox, roundContents);
        tdCenter.appendChild(roundContents);
    }
    catch (e) {
    }
}


function setFlexibleBox2(_roundContents, _roundStyle, _classParam) {
    try {
        var roundContents = _roundContents;
        var roundStyle = _roundStyle;
        var classParam = _classParam;

        var tbRoundBox = document.createElement("table");
        if (!classParam) {
            tbRoundBox.className = roundStyle;
        } else {
            tbRoundBox.className = roundStyle + " " + classParam;
        }

        var trTop = tbRoundBox.insertRow(0);
        var tdTopLeft = trTop.insertCell(0);
        tdTopLeft.className = "rt2TL";
        var tdTop = trTop.insertCell(1);
        tdTop.className = "rt2T";
        var tdTopRight = trTop.insertCell(2);
        tdTopRight.className = "rt2TR";

        var trMiddle = tbRoundBox.insertRow(1);
        var tdLeft = trMiddle.insertCell(0);
        tdLeft.className = "rt2L";
        var tdCenter = trMiddle.insertCell(1);
        tdCenter.className = "rt2C";
        var tdRight = trMiddle.insertCell(2);
        tdRight.className = "rt2R";

        var trBottom = tbRoundBox.insertRow(2);
        var tdBottomLeft = trBottom.insertCell(0);
        tdBottomLeft.className = "rt2BL";
        var tdBottom = trBottom.insertCell(1);
        tdBottom.className = "rt2B";
        var tdBottomRight = trBottom.insertCell(2);
        tdBottomRight.className = "rt2BR";

        var parentRoundContents = roundContents.parentNode;
        parentRoundContents.insertBefore(tbRoundBox, roundContents);
        tdCenter.appendChild(roundContents);
    }
    catch (e) {
    }
}

/*ÆË¾÷ ´Ý±â*/
function popClose() {
    self.close();
}

/********************************************************************************************************
ÆË¾÷ ¼öµ¿ Open Á¤ÀÇ
º¯¼ö Á¤ÀÇ : pop - ÆÄÀÏ¸í, width - °¡·Î»çÀÌÁî, height - ¼¼·Î»çÀÌÁî, flag - 0:½ºÅ©·Ñ¾øÀ½, 1:½ºÅ©·ÑÀÖÀ½
********************************************************************************************************/
function popfix(pop,tname,width,height,flag)
{
  var url = pop;
  var wd = width;
  var he = height;
  var tn = tname;

  if ((window.navigator.userAgent.indexOf("SV1") != -1) || (window.navigator.userAgent.indexOf("MSIE 7") != -1)) {
    wd = wd + 8;
    he = he + 10;
        
    if (flag == "0" )    {  
      winObj =  window.open(url,tn,"toolbar=0,menubar=0,scrollbars=no,resizable=no,width=" + wd + ",height=" + he + ";");  
	  winObj.focus(); 	}
    else  {  
      winObj =  window.open(url,tn,"toolbar=0,menubar=0,scrollbars=yes,resizable=no,width=" + wd + ",height=" + he + ";");  
	  winObj.focus();  }
  }
  
  else {
  if (flag == "0" )    {  
    winObj =  window.open(url,tn,"toolbar=0,menubar=0,scrollbars=no,resizable=no,width=" + wd +",height=" + he + ";");  
	winObj.focus();   }
  else  {  
    winObj =  window.open(url,tn,"toolbar=0,menubar=0,scrollbars=yes,resizable=no,width=" + wd +",height=" + he + ";");  
	winObj.focus();   }  
  }
}

/*********** ÆË¾÷Ã¢ ¿ÀÇÂ  **********/
function uf_popOpen(url,wname) {
	var positionX = 0;
	var positionY = 0;
//	var positionX = (screen.width-450)/2;
//	var positionY = (screen.height-250)/2;
	winStr = window.open(url,wname,"left="+positionX+",top="+positionY+",width=880,height=500,toolbar=no,scrollbars=yes" );
	winStr.focus();
}

/****** ÆË¾÷Ã¢ ÀÚµ¿ ¸®»çÀÌÁî **************************************************************/
function uf_popResize() {
	
	var Station = {   
        check : function (type, checkStr, checkPoint)   
        {   
            var name = "ETC";          
            for ( var list in checkPoint )   
            {   
                if (checkStr.indexOf(list) != -1)    
                {   
                    name = checkPoint[list];   
                }              
            }   
            escape("this." + type + " = function () { return name }") ;   
            return name;   
        },   
        os : function ()    
        {    
            var checkStr = navigator.platform.toLowerCase();   
            var checkPoint =    
            {    
                "win" : "WINDOW", "mac" : "MAC", "unix" : "UNIX",    
                "linux" : "LINUX"    
            }   
            return this.check("os", checkStr, checkPoint );    
        },   
        browser : function ()    
        {    
            var checkStr = navigator.userAgent.toLowerCase();   
            var checkPoint =    
            {    
                "msie 6" : "IE6" , "msie 7" : "IE7",    
                "firefox" : "FF", "navigator" : "NETSCAPE",    
                "opera" : "OPERA" , "msie 8" : "IE8" , "msie 9" : "IE9"
            }   
            return this.check("browser", checkStr, checkPoint);    
           
        }   
    } 	/*browser Check*/
	
	var thisX = document.getElementById("offsetTable").offsetWidth;
	var thisY = document.getElementById("offsetTable").offsetHeight;
	var maxThisX = screen.width - 50;
	var maxThisY = screen.height - 80;
		
	if (Station.browser() == "IE9") {
		var marginY = 88; //IE9 (ÅÛÇÃ¸´ÀÇ Çì´õ³ôÀÌ + Ç²ÅÍ ³ôÀÌ + ¾ËÆÄ)
		thisX += 34;
	}
	else if (Station.browser() == "IE8") {
		var marginY = 88; //IE8 (ÅÛÇÃ¸´ÀÇ Çì´õ³ôÀÌ + Ç²ÅÍ ³ôÀÌ + ¾ËÆÄ)
	}
	else if (Station.browser() == "IE7") {
		var marginY = 88; //IE7 (ÅÛÇÃ¸´ÀÇ Çì´õ³ôÀÌ + Ç²ÅÍ ³ôÀÌ + ¾ËÆÄ)
	}
	else if (Station.browser() == "IE6") {
		var marginY = 65; //IE6 (ÅÛÇÃ¸´ÀÇ Çì´õ³ôÀÌ + Ç²ÅÍ ³ôÀÌ + ¾ËÆÄ)
	}
	else if (Station.browser() == "FF") {
		var marginY = 88; //FireFox (ÅÛÇÃ¸´ÀÇ Çì´õ³ôÀÌ + Ç²ÅÍ ³ôÀÌ + ¾ËÆÄ)
	}
	else  {
		var marginY = 78; //IE7 (ÅÛÇÃ¸´ÀÇ Çì´õ³ôÀÌ + Ç²ÅÍ ³ôÀÌ + ¾ËÆÄ)
	}
	
	if (thisX > maxThisX) {
		window.document.body.scroll = "yes";
		thisX = maxThisX;
	}
	if (thisY > maxThisY - marginY) {
		window.document.body.scroll = "yes";
		if (Station.browser() == "IE6") {
			thisX += 19;
		} else {
			thisX += 35;
		}
		thisY = maxThisY - marginY;
	}
	
	var windowX = (screen.width - (thisX+10))/2;
	var windowY = (screen.height - (thisY+marginY))/2 - 20;
	//window.moveTo(windowX,windowY);
	window.resizeTo(thisX+10,thisY+marginY);
}


/****** ÀÌ¹ÌÁö rollover **************************************************************/
 function EImgChg(flag) {
     source = event.srcElement;
     if (source.id == "")
     { return false; }

     else if (document.images && source.tagName == "IMG") {
         imgElement = source.id;  // ÀÌ¹ÌÁö name
         imgPath = source.src;   // ÀÌ¹ÌÁö src ¼Ó¼º°ª

         imgPathLen = imgPath.length;
         imgPathFlag = imgPath.lastIndexOf("/");
         imgName = imgPath.substring(0, imgPathFlag + 1);

         document.images[imgElement].src = imgName + imgElement + "_" + flag + ".gif";
     }
 }

/**** È¨À¸·Î°¡±â  **************/
function goHome() {  
	var url = location.href;
	if (url.indexOf("localhost") > -1)
	{
		top.location.href = "/Cgv.Web/"; 
	} else {
		top.location.href = "/"; 
	}
}

/**** »ó´ÜÀ¸·Î°¡±â  **************/
function goTop() {  document.location.href = "#top" }

/****** »ó´Ü °Ë»ö°ü·Ã **************************************************************/
function schCategory_show() {
	document.getElementById('schCategoryDiv').style.display='block';
}
function autoSearch_show() {
	document.getElementById('schWord').value = "";
	document.getElementById('autoSearchDiv').style.display = "block";
}


/****** »çÀÌÆ®¸Êjs **************************************************************/
function htmlLink_movie(htmlLink_id) {
	switch(htmlLink_id) {
		case 1 : document.location.href = "/movie/moviechart/default.aspx";
			break;
		case 2 : document.location.href = "/movie/running/default.aspx";
			break;
		case 3 : document.location.href = "/movie/plan/default.aspx";
			break;
		case 4 : document.location.href = "/movie/past/default.aspx";
			break;

		default : document.location.href = "/movie/moviechart/default.aspx";
	}	
}

function htmlLink_theater(htmlLink_id) {
	switch(htmlLink_id) {
		case 1 : document.location.href = "/theater/theater/Default.aspx?theaterCode=56";
			break;
		case 2 : document.location.href = "/theater/cinedechef/main.aspx";
			break;
		case 3 : document.location.href = "/theater/special/onlymemory.aspx?theaterCode=02&onlyOne=101";
			break;
		case 4 : document.location.href = "/theater/special/onlycollage.aspx";
			break;

		default : document.location.href = "/theater/Default.aspx";
	}	
}

function htmlLink_ticketing(htmlLink_id) {
	switch(htmlLink_id) {
		case 1 : FastTicketing();
			break;
		case 2 : document.location.href = "/reservation/timetable/timetable.aspx";
			break;
		case 3 : document.location.href = "/reservation/guide/guidefast.aspx";
			break;
		case 4 : document.location.href = "/reservation/card/MCard.aspx";
			break;
		case 5 : document.location.href = "/reservation/ticket/ticket.aspx";
			break;
		case 6 : document.location.href = "/reservation/mobile/mobile.aspx";
			break;
		case 7 : document.location.href = "/gift/shop/shop01.aspx";
			break;
		case 8 : document.location.href = "/gift/card/info.aspx";
			break;		

		default : FastTicketing();
	}	
}

function htmlLink_review(htmlLink_id) {
	switch(htmlLink_id) {
		case 1 : document.location.href = "/media/magazine/expert/list.aspx";
			break;
		case 2 : document.location.href = "/openreview/blog/blog.aspx";
			break;
		case 3 : document.location.href = "/openreview/rating/rating_list.aspx";
			break;
		case 4 : document.location.href = "/openreview/cgvaward/cgvaward1.aspx";
			break;
		case 5 : document.location.href = "/openreview/poll/poll_list.aspx";
			break;

		default : document.location.href = "/openreview/default.aspx";
	}	
}


function htmlLink_magazine(htmlLink_id) {
	switch(htmlLink_id) {
		case 0 : document.location.href = "/playcgv/default.aspx";
			break;
		case 1 : document.location.href = "/playcgv/contents.aspx?MovieNCode=1572";
			break;
		case 2 : document.location.href = "/playcgv/contents.aspx?MovieNCode=1573";
			break;
		case 3 : document.location.href = "/playcgv/contents.aspx?MovieNCode=1574";
			break;
		case 4 : document.location.href = "/playcgv/news.aspx";
			break;

		default : document.location.href = "/playcgv/gallery.aspx";
	}	
}

/*
¸Å°ÅÁø ¸µÅ© ==============================================================================
function htmlLink_magazine(htmlLink_id) {
	switch(htmlLink_id) {
		case 1 : document.location.href = "/magazine/default.aspx?MovieNCode=1301";
			break;
		case 2 : document.location.href = "/magazine/default.aspx?MovieNCode=1302";
			break;
		case 3 : document.location.href = "/magazine/default.aspx?MovieNCode=1303";
			break;
		case 4 : document.location.href = "/magazine/default.aspx?MovieNCode=1304";
			break;

		default : document.location.href = "/magazine/default.aspx";
	}	
}
*/
function htmlLink_gift(htmlLink_id) {
	switch(htmlLink_id) {
		case 1 : document.location.href = "/gift/online/shop/list.aspx";
			break;
		case 2 : document.location.href = "/gift/snsshop/list.aspx";
			break;
		case 3 : document.location.href = "/gift/online/ticket/list.aspx";
			break;
		case 4 : document.location.href = "/gift/music/list_genre.aspx";
			break;
		case 5 : document.location.href = "/gift/cmcombine/cmcombine_main.aspx";
			break;
		case 6 : document.location.href = "/gift/cjticket/default.aspx";
			break;
		default : document.location.href = "/gift/online/shop/list.aspx";
	}
}

function htmlLink_event(htmlLink_id) {
	switch(htmlLink_id) {
		case 1 : document.location.href = "/event/running/list.aspx";
			break;
		case 2 : document.location.href = "/event/past/list.aspx";
			break;
		case 3 : document.location.href = "/event/winner/list.aspx";
			break;
		case 4 : document.location.href = "/event/stage/list.aspx";
			break;	

		default : document.location.href = "/event/running/list.aspx";
	}	
}

function htmlLink_mycgv(htmlLink_id) {
	switch(htmlLink_id) {
		case 1 : document.location.href = "/mycgv/diary/reserve/default.aspx";
			break;
		case 2 : document.location.href = "/mycgv/snsshop/mysnsshop.aspx";
			break;
		case 3 : document.location.href = "/mycgv/diary/coupon/movie/insert.aspx";
			break;
		case 4 : document.location.href = "/mycgv/download/mydownload.aspx";
			break;
		case 5 : document.location.href = "/gift/cmcombine/cmcombine_main.aspx";
			break;
		case 6 : document.location.href = "/mycgv/openreview/expert_list.aspx";
			break;
		case 7 : document.location.href = "/mycgv/point/";
			break;
		case 8 : document.location.href = "/mycgv/event/default.aspx";
			break;
		case 9 : document.location.href = "/mycgv/qna/my/list.aspx";
			break;
		case 10 : document.location.href = "/mycgv/membership/default.aspx";
			break;
		case 11 : document.location.href = "/mycgv/user/auth.aspx";
			break;
		default : document.location.href = "/mycgv/default.aspx";
	}
}

function htmlLink_member(htmlLink_id) {
	switch(htmlLink_id) {
		case 1 : document.location.href = "/user/membership/default.aspx";
			break;
		case 2 : document.location.href = "/user/vip/default.aspx";
			break;
		case 3 : document.location.href = "/user/mizstory/default.aspx";
			break;

		default : document.location.href = "/user/membership/default.aspx";
	}	
}

function htmlLink_customer(htmlLink_id) {
	switch(htmlLink_id) {
		case 1 : document.location.href = "/support/news/list.aspx";
			break;
		case 2 : document.location.href = "/support/faq/list.aspx";
			break;
		case 3 : document.location.href = "/support/qna/insert.aspx";
			break;
		case 4 : document.location.href = "/support/lost/insert.aspx";
			break;
		case 5 : document.location.href = "/support/lease/insert.aspx";
			break;
		case 6 : document.location.href = "/support/sitemap/sitemap.aspx";
			break;			

		default : document.location.href = "/support/main.aspx";
	}	
}

function htmlLink_download(htmlLink_id) {
	switch(htmlLink_id) {
		case 1 : document.location.href = "/download/widget.aspx";
			break;
		case 2 : document.location.href = "/download/toolbar.aspx";
			break;

		default : document.location.href = "/download/widget.aspx";
	}	
}

function htmlLink_about(htmlLink_id) {
	switch(htmlLink_id) {
		case 1 : document.location.href = "/company/cgv/cgv01.aspx";
			break;
		case 2 : document.location.href = "/company/cjgroup/default.aspx";
			break;
		case 3 : document.location.href = "/company/booth/default.aspx";
			break;
		case 4 : document.location.href = "/company/ir/manage/manage_list.aspx";
			break;
		case 5 : document.location.href = "/company/ir/manage/en_manage_list.aspx";
			break;
		case 6 : document.location.href = "/company/pr/pr_list.aspx";
			break;			
		case 7 : document.location.href = "/company/recruit/intern/intern.aspx";
			break;
		case 8 : document.location.href = "/company/cyber/default.aspx";
			break;
		case 9 : document.location.href = "/company/advertize/ad_insert.aspx";
			break;
		case 10 : document.location.href = "/company/community/approval.aspx";
			break;	
			
		default : document.location.href = "/company/main.aspx";
	}	
}

function htmlLink_utility1(htmlLink_id) {
	switch(htmlLink_id) {
		case 1 : document.location.href = "/user/login/login.aspx";
			break;
		case 2 : document.location.href = "/user/join/agreement.aspx";
			break;
		case 3 : window.open('http://www.cgv.com.cn/');
			break;
		case 4 : document.location.href = "/search/SearchTheaterAll.aspx?q=cgv&RegionCode=01&setname=%bc%ad%bf%ef%c1%f6%bf%aa";
			break;
			
		default : document.location.href = "/user/login/login.aspx";
	}	
}

function htmlLink_etc(htmlLink_id) {
	switch(htmlLink_id) {
		case 1 : uf_popOpen("/popup/p_agree01.aspx");
			break;
		case 2 : uf_popOpen("/popup/p_privacy01.aspx");
			break;
		case 3 : uf_popOpen("/popup/p_email01.aspx");
			break;
		case 4 : uf_popOpen("/popup/p_law01.aspx");
			break;
			
		default : uf_popOpen("/popup/p_agree01.aspx");
	}	
}

function htmlLink_arthall(htmlLink_id) {
	switch(htmlLink_id) {
		case 1 : document.location.href = "/party/default.aspx";
			break;
			
		default : document.location.href = "/party/default.aspx";
	}	
}

/*¿ÜºÎ js*/
document.write(" <script type=\"text/javascript\" language=\"javascript\" src=\"http://img.cgv.co.kr/common/js/base/selectBox.js\"></script> ");
document.write(" <script type=\"text/javascript\" language=\"javascript\" src=\"http://img.cgv.co.kr/common/js/base/tiplayer.js\"></script> ");
document.write(" <script type=\"text/javascript\" language=\"javascript\" src=\"http://img.cgv.co.kr/common/js/base/swfobject.js\"></script> ");
document.write(" <script type=\"text/javascript\" language=\"javascript\" src=\"http://img.cgv.co.kr/common/silverlight/Silverlight.js\" ></script>");
//document.write(" <script type=\"text/javascript\" language=\"javascript\" src=\"http://img.cgv.co.kr/common/js/flash_link.js\"></script> ");
document.write(" <script type=\"text/javascript\" language=\"javascript\" src=\"http://cjpg.cgv.co.kr/CGV2011/cgv_bank_sl.js\"></script> ");


var $n = function(arg, container) {
    if (container)
        return $(eval(container + '.' + arg));
    else {
        try {
            return $(eval('clientIds.' + arg));
        } catch (e) {
            return $(arg);
        }
    }
}


/*********** ±ØÀå ÀÌµ¿  **********/
function goTheater(code) {
    //¸ÞÀÎ¿¡¼­ µé¾î ¿Ô´Ù¸é type1ÀÏ¶§ Å¬¸¯ ÀÌº¥Æ®¸¦ ¹ß»ýÇÏ±â À§ÇÏ¿©
   
    try {
        if ($n('HiMainyn').value == "mainy") {
            $n('hdnTheaterCode').value = code;
            location.href = $n('btngotype2').href;
        }
        else {//±×¿Ü ÆäÀÌÁö¿¡¼­´Â ¹Ù·Î ÀÌµ¿
           
            location.href = "/theater/theater/default.aspx?theaterCode=#{code}".interpolate({ code: code });
        }
    }
    catch (e) {
        location.href = "/theater/theater/default.aspx?theaterCode=" + code;
    }
}



function goSpecialTheater(onlyOne, theaterCode) {

    $n('hidtheaterCode').value = theaterCode;
    $n('hidonlyOne').value = onlyOne;
    location.href = $n("theaterCheckLink").href;
   
}
function TxtLengthChk(txtPre, txtNext, len) {
    if (Form1.all[txtPre].value.length == len) {
        Form1.all[txtPre].blur();
        Form1.all[txtNext].focus();
    }
}
// ********************************************************************************
// ÅØ½ºÆ® ÄÁÆ®·Ñ¿¡ ÀÔ·ÂÃ¼Å© [¼ýÀÚ]
// onkeydown="javascript:CheckKeyNum();" style="IME-MODE:disabled"
// ********************************************************************************

function CheckKeyNum() {
    //alert(event.keyCode)
    if (event.shiftKey || event.ctrlKey) {
        event.returnValue = false;
    }

    // ¹æÇâÅ°
    if (37 <= event.keyCode && event.keyCode <= 40) return true;

    //1~0
    if (96 <= event.keyCode && event.keyCode <= 105) return true;

    //1~0
    if (48 <= event.keyCode && event.keyCode <= 57) return true;

    // Back Space
    if (event.keyCode == 8) return true;

    // tab
    if (event.keyCode == 9) return true;

    // Delete
    if (event.keyCode == 46) return true;

    event.returnValue = false;
}

function Trim(str) {
    var sw1 = true;
    var sw2 = true;

    while (sw1) {
        if (str.indexOf(' ') == 0) {
            str = str.substr(1, str.length - 1);
        }
        else {
            if (sw2) {
                sw2 = false;
                str = str.split('').reverse().join('');
            }
            else sw1 = false;
        }
    }
    return str.split('').reverse().join('');
}

//ÆË¾÷(¿À´ÃÇÏ·çµ¿¾È ¿­Áö¾Ê±â)
/**
 *  ÆË¾÷ Ã³¸®
 *  ¿ÞÂÊ À§Ä¡ ÀÚµ¿ ¸ÂÃã Ã³¸® 
 */
var popup_left = 0;
var frame_width = 10;   //À©µµ¿ì Æ² ³Êºñ
function open_pop(cookieName, popFile, wid, hei, top, left) {
    //  ÄíÅ° ÀÌ¸§, ÆË¾÷ ÆÄÀÏ, °¡·Î, ¼¼·Î, »ó´ÜÀ§Ä¡, ¿ÞÂÊÀ§Ä¡
    //  ÁÂÃø À§Ä¡ ÁöÁ¤ÀÌ¸é ´ÙÀ½ ÆË¾÷ À§Ä¡¸¦ °è»êÇÏÁö ¾Ê½À´Ï´Ù.
    var name = cookieName;
    var sign = "no";
    var start = -1;
    var end = 0;
    var pop_flag = 0;
    var params = (popFile.indexOf("?") >= 0) ? "&" : "?"; // ÆÄ¶ó¸ÞÅÍ
    var ops = ""    // ºÎ°¡ ¿É¼Ç(°¡·Î ¼¼·Î »ó´Ü ÁÂÃø À§Ä¡);
    start = document.cookie.indexOf(name);
    end = start + name.length;
    if(start > -1) {
        start = start + name.length + 1;
        if(document.cookie.substring(start, start+sign.length) == sign){
             pop_flag = 1;
        }
    }
    if(pop_flag == 0) {
        params += "s=" + sign + "&n="   + name;
        popFile += params;
        ops += (wid != null) ? "width="  + wid + "," : "";
        ops += (hei != null) ? "height=" + hei + "," : "";
        ops += (top != null) ? "top="    + top + "," : "top=0,";
        if(left == null) {
            if(wid != null) {
                //¿ÞÂÊºÎÅÍ ¼ø¼­´ë·Î ÆË
                ops += "left=" + popup_left + ",";
                popup_left += wid + frame_width;    //´ÙÀ½ ÆË¾÷ÀÇ ¿ÞÂÊÀ§Ä¡
            }
        }else{
            ops += "left="   + left + ",";
        }
        window.open(popFile, name, ops + " scrollbars=no, toolbar=no, status=no, resizable=no");
    }
}

/*¿µÈ­¿À·¡º¸±â*/
function getTime() {
    now = new Date("February 23 2010 12:00:00");
    later = new Date();
    days = (later - now) / 1000 / 60 / 60 / 24;
    daysRound = Math.floor(days);
	
    hours = (later - now) / 1000 / 60 / 60 - (24 * daysRound);	
    hoursRound = Math.floor(hours);
	
    hours2 = (later - now) / 1000 / 60 / 60;	
    hoursRound2 = Math.floor(hours2);  	
	
    minutes = (later - now) / 1000 /60 - (24 * 60 * daysRound) - (60 * hoursRound);
    minutesRound = Math.floor(minutes);
    
   	if (hoursRound2 >= 70 && minutesRound >= 30) {
  		h1.innerHTML = "70";
  		m1.innerHTML = "00";
  		return;	
  	}
    		
    if (minutesRound <= 9) {
        m1.innerHTML = "0";
        m2.innerHTML = minutesRound;
    } else {
        m1.innerHTML = Math.floor(minutesRound/10);
        m2.innerHTML = minutesRound%10;
    }
			
    if (hoursRound2 <= 9) {
        h1.innerHTML = "0";
        h2.innerHTML = hoursRound2;
    } else {
	        h1.innerHTML = Math.floor(hoursRound2/10);
	        h2.innerHTML = hoursRound2%10;
    }

    newtime = window.setTimeout("getTime();", 24000);
}

function getTimeBi() {
//    now = new Date("February 23 2010 12:00:00");
//    later = new Date();
//    days = (later - now) / 1000 / 60 / 60 / 24;
//    daysRound = Math.floor(days);
//	
//    hours = (later - now) / 1000 / 60 / 60 - (24 * daysRound);	
//    hoursRound = Math.floor(hours);
//	
//    hours2 = (later - now) / 1000 / 60 / 60;	
//    hoursRound2 = Math.floor(hours2);  	
//			
//    if (hoursRound2 <= 9) {
//        h1.innerHTML = "0";
//        h2.innerHTML = hoursRound2;
//    } else {
//        h1.innerHTML = Math.floor(hoursRound2/10);
//        h2.innerHTML = hoursRound2%10;
//    }
//
//    newtime = window.setTimeout("getTimeBi();", 24000);
}

function fn_ipinNotice_Pop()
{
    winObj =  window.open("http://www.cgv.co.kr/user/popup/p_ipin01.html","iPinNotice","toolbar=0,menubar=0,scrollbars=auto,resizable=no,width=677,height=800;");  
	winObj.focus();
}

//cgv & m.net °áÇÕ »óÇ° °áÁ¦ ÆË¾÷ 100414 add
function cgvMnet_Pop() 
{
    window.open("/gift/cgvmnet/p_payment.html","cgvmnet","toolbar=0,menubar=0,scrollbars=auto,width=400,height=450;");
}

function resizePopup(nWidth, nHeight) {
	if (navigator.appName == 'Microsoft Internet Explorer') {
		var nCWidth = document.body.offsetWidth;
		var nCHeight = document.body.offsetHeight;
		window.resizeTo(nWidth, nHeight);
		
		var nTmpWidth = nWidth - (document.body.offsetWidth - nCWidth);
		var nTmpHeight = nHeight - (document.body.offsetHeight - nCHeight);
		window.resizeTo(nTmpWidth, nTmpHeight);
		
		var nDiffWidth = nTmpWidth - nCWidth;
		var nDiffHeight = nTmpHeight - nCHeight;
			
		nWidth += document.body.offsetWidth + nDiffWidth - document.body.clientWidth;
		nHeight += document.body.offsetHeight + nDiffHeight - document.body.clientHeight;
	} else {
		window.resizeTo(nWidth, nHeight);
		nWidth += window.outerWidth - window.innerWidth;
		nHeight += window.outerHeight - window.innerHeight
	}
	
	var nWindowX = Math.ceil((window.screen.width  - nWidth) / 2);
	var nWindowY = Math.ceil((window.screen.height - nHeight) / 2);
	
	//window.moveTo(nWindowX, nWindowY);
	window.resizeTo(nWidth, nHeight);
}

function doLogIn() {
	var url = location.href;
	if (url.indexOf("localhost") > -1)
	{
		location.href = "/Cgv.Web/user/login/login.aspx?return=" + location.href;
	} else {
		location.href = "/user/login/login.aspx?return=" + location.href;
	}
}

/********************************/
/*
Author : alma kes
CreateDate : 2011-10-26
Description : ¸ÞÀÎ ºñÈ¸¿ø¿¹¸Å ·¹ÀÌ¾î
*/
/* ¼­ºêÆäÀÌÁö¿¡¼­ ½ºÅ©¸³Æ® ¿À·ù°¡ ¹ß»ýÇÕ´Ï´Ù. ¼öÁ¤ÇØ ÁÖ¼¼¿ä.
$(document).ready(function() {				
	$('#showLayer').click(function() {		
		$(".popupLayer").fadeIn(); //Show Layer					
		return false;	
	});						
	$(".popupLayer > .close").click(function() {						
		$(this).parent().fadeOut(); //Hide Layer				
		return false;	
	});	
});	
*/

// 2011-12-28
// Dbros Csk Attach
// º°Á¡ÀÇ °ªÀÌ 0ÀÏ°æ¿ì ¼û°Ü¶ó
// ÇØ´ç ÆÄÀÏ¿¡¼­ 0Á¡ º°Á¡ Á¦°Å ÇØÁÖ½Ã±â ¹Ù¶ø´Ï´Ù.
// ÇØ´ç ÆÄÀÏ¿¡¼­ 0Á¡ º°Á¡ÀÌ Á¦°Å µÇ¾ú´Ù¸é ¾Æ·¡ÀÇ ½ºÅ©¸³Æ®´Â ÇÊ¿äÄ¡ ¾Ê½À´Ï´Ù.
/*
$(document).ready(function(){
	var target_wrap=$('.select_on'),
	target=target_wrap.find('.option[title=0]');
	if(target_wrap.length>0) {
	target.hide();
	}
})
*/

// lnbSizing
function lnbSizing(add){
    var $lnbEl=$('.content_lnb'),
    $relativeEl=$('.content');
    $lnbEl.height(($relativeEl.height()+add));
}

// ÁÂÃø ±¤°í Á¦°Å
// 2012-02-07 Csk
function clearAdLeft(handle){
	var adLeft=$('.ad_left');
	if(handle=='remove'){
		adLeft.remove();
	}else{
		adLeft.hide();
	}
}

// ¿ìÃøÇÏ´Ü ±¤°í Á¦°Å
function clearAdRight(handle){
	var adRight=$('.rightCompAd');
	if(handle=='remove'){
		adRight.remove();
	}else{
		adRight.hide();
	}
}
