var includeJs = 'scriptaculous/builder,scriptaculous/effects,scriptaculous/dragdrop,scriptaculous/controls,scriptaculous/slider,window,calendar,validation';


var Main = {
  Version: '1.7.0',
  require: function(libraryName) {
    // inserting via DOM fails in Safari 2.0, so brute force approach
    document.write('<script type="text/javascript" src="'+libraryName+'"></script>');
  },
  load: function() {
    if((typeof Prototype=='undefined') || 
       (typeof Element == 'undefined') || 
       (typeof Element.Methods=='undefined') ||
       parseFloat(Prototype.Version.split(".")[0] + "." +
                  Prototype.Version.split(".")[1]) < 1.5)
       throw("cscmain.js requires the Prototype JavaScript framework >= 1.5.0");
    
    $A(document.getElementsByTagName("script")).findAll( function(s) {
      return (s.src && s.src.match(/cscmain\.js(\?.*)?$/))
    }).each( function(s) {
      var path = s.src.replace(/cscmain\.js(\?.*)?$/,'');
      var includes = s.src.match(/\?.*load=([a-z,]*)/);
      (includes ? includes[1] : includeJs).split(',').each(
       function(include) { Main.require(path+include+'.js');});
    });
  }
};

Main.load();


    function $N(element) {
      if (arguments.length > 1) {
        for (var i = 0, elements = [], length = arguments.length; i < length; i++)
          elements.push($N(arguments[i]));
        return elements;
      }
      if (typeof element == 'string')
        element = document.getElementsByName(element);
      return Element.extend(element);
    }
    
  
    
    function getInputsByType(form, typeName) {
        form = $(form);
        if (form==null || form =='undefined') return null;
        var inputs = form.getElementsByTagName('input');

        if (!typeName) return $A(inputs).map(Element.extend);

        for (var i = 0, matchingInputs = [], length = inputs.length; i < length; i++) {
          var input = inputs[i];
          if ((typeName && input.type != typeName))
            continue;
          matchingInputs.push(Element.extend(input));
        }
        return matchingInputs;
    }
   
     
    /*
     * Function Name : showMe
     * Description   : 엘리먼트를 보인다.
     * Parameters    : html element
     * Return Value  : 
     * Author        : $$Author: 이창협 $$
     * Version       : $$Revision: 1.00 $$
     * Date          : $$Date: 2009/09/10 $$
     */
    function showMe(obj){
        $(obj).style.display='block';
    }
    /*
     * Function Name : hideMe
     * Description   : 엘리먼트를 숨긴다.
     * Parameters    : html element
     * Return Value  : 
     * Author        : $$Author: 이창협 $$
     * Version       : $$Revision: 1.00 $$
     * Date          : $$Date: 2009/09/10 $$
     */
    function hideMe(obj){
        $(obj).style.display='none';
    }
    
    
    function getAbsolutePos(obj) { 
        var position = new Object; 
        position.x = 0; 
        position.y = 0; 
        if(obj) { 
            position.x = obj.offsetLeft; 
            position.y = obj.offsetTop; 
 
            if( obj.offsetParent ) { 
                var parentpos = getAbsolutePos(obj.offsetParent); 
                position.x += parentpos.x; 
                position.y += parentpos.y; 
            } 
        } 
        return position;
    }
    
    function getMouseXY(event) {
        var position = new Object; 
        position.x = 0; 
        position.y = 0;

        if (document.all) { 
            position.x = event.clientX + document.documentElement.scrollLeft; 
            position.y = event.clientY + document.documentElement.scrollTop; 
        } else { 
            position.x = event.pageX;
            position.y = event.pageY;
        } 
        return position;
    } 
    
    
    
    
    
    function checkBrowser() {
        alert("IE:"+Prototype.Browser.IE);
        alert("Opera:"+Prototype.Browser.Opera);
        alert("WebKit:"+Prototype.Browser.WebKit);
        alert("Gecko:"+Prototype.Browser.Gecko);
        alert("MobileSafari:"+Prototype.Browser.MobileSafari);
    }
    
    function enterKeySearch(event) {
        /*
        alert("IE:"+Prototype.Browser.IE);
        alert("Opera:"+Prototype.Browser.Opera);
        alert("WebKit:"+Prototype.Browser.WebKit);
        alert("Gecko:"+Prototype.Browser.Gecko);
        alert("MobileSafari:"+Prototype.Browser.MobileSafari);
        */
        if(Prototype.Browser.IE) {
            if (event.keyCode==13 && searchPage) searchPage();
        }
        if(Prototype.Browser.Gecko) {
            if (event.which==13 && searchPage) searchPage();
        }
        if(Prototype.Browser.WebKit) {
            if (event.keyCode==13 && searchPage) searchPage();
        }
    }
    function enterKeySearchPage(event) {
        /*
        alert("IE:"+Prototype.Browser.IE);
        alert("Opera:"+Prototype.Browser.Opera);
        alert("WebKit:"+Prototype.Browser.WebKit);
        alert("Gecko:"+Prototype.Browser.Gecko);
        alert("MobileSafari:"+Prototype.Browser.MobileSafari);
         */
        if(Prototype.Browser.IE) {
            if (event.keyCode==13) doAction('SEARCH');
        }
        if(Prototype.Browser.Gecko) {
            if (event.which==13) doAction('SEARCH');
        }
        if(Prototype.Browser.WebKit) {
            if (event.keyCode==13) doAction('SEARCH');
        }
    }
    
    function toggleMe(event){
        var a = Try.these(     
                function() { return window.event.srcElement;},     
                function() { return event.target;});
        if($(a).className=='check'){
            $(a).removeClassName('check');
            $(a).next().value="N";
        }else{
            $(a).addClassName('check');
            $(a).next().value="Y";
        }
    }
    
      
    
    function copyToClipboard(text){   
        if( window.clipboardData && clipboardData.setData ){   
            window.clipboardData.setData('text',text);
            $('copy_layer').style.display='none';
        } else {
            $('copy_layer').style.display='none';
            alert("지원하지 않는 브라우저입니다.");
        }   
    } 
    
    function GetEmbed(url,id,width,height,vars) {
        vars = vars ? vars : "";
        if (Prototype.Browser.IE) {
            var txt = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+width+'" height="'+height+'" id="'+id+'" name="'+id+'" align="middle">';
            txt+= '<param name="allowScriptAccess" value="always" />';
            txt+= '<param name="flashVars" value="'+vars+'" />';
            txt+= '<param name="movie" value="'+url+'" />';
            txt+= '<param name="quality" value="high" />';
            txt+= '<param name="wmode" value="transparent" />';
            //txt+= '<embed src="'+url+'" quality="high" wmode="transparent" style="width:'+width+'px; height:'+height+'px;" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashVars="'+vars+'"></embed>';
            txt+= '</object>';

            document.write(txt);
        } else {
            txt = '<embed id="'+id+'" name="'+id+'"  src="'+url+'" quality="high" wmode="transparent" style="width:'+width+'px; height:'+height+'px;" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashVars="'+vars+'"></embed>';
            document.write(txt);
        }
    }
    
    function menuaction(ev){
        try {
            if(ev == "open"){
                $("allmenu_layer").style.display = "block";           
                $("allmenu").slideaction("open");
                $('all_menu_status').title = "close";
            }else if(ev == "close"){
                $('allmenu').slideaction('close');
                $('all_menu_status').title = "open";
            }  
        }catch(e) {}
    }

    function closeaction(ev){
        if(ev == "close"){
            $("allmenu_layer").style.display = "none";
        }
    }
    
    
    
    function printMe(path) {
        window.open(path,"print","width=785,height=636,scrollbars=no");
    }

    function mouseOverOutDt(event){
        var type;
        var dt = Try.these(     
                function() { type=window.event.type; return window.event.srcElement;},     
                function() { type=event.type; return event.target;});
        if(type=='mouseover'){
            $(dt).addClassName("copy");
            $(dt).removeClassName("over");
            $('copy_layer').style.display='inline';
        }
        if(type=='mouseout'){
            if($('copy_layer').style.display!='inline'){
                $(dt).addClassName("copy");
            }
        }
    }
    
    function mouseOverOutLi(event){
        var type;
        var a = Try.these(     
                function() { type=window.event.type; return window.event.srcElement;},     
                function() { type=event.type; return event.target;});
        if(type=='mouseover'){
            $(a.parentNode).addClassName("over");
        }
        if(type=='mouseout'){
            $(a.parentNode).removeClassName("over");
            if($('copy_layer').style.display!='inline'){
                $('cp').addClassName("copy");
            }
        }
    }
    
    function showCircleLoading(m) {
        var loading = $('circle_loading');
        $(loading).style.left = m.left + 100 +'px';
        $(loading).style.top =  m.top -50 +'px';
        $(loading).style.visibility = 'visible';
    }
    
    function hideCircleLoading() {
        var loading = $('circle_loading');
        $(loading).style.visibility = 'hidden';
    }
    
    
    function getAnchorPosition(anchorname){var useWindow=false;var coordinates=new Object();var x=0,y=0;var use_gebi=false, use_css=false, use_layers=false;if(document.getElementById){use_gebi=true;}else if(document.all){use_css=true;}else if(document.layers){use_layers=true;}if(use_gebi && document.all){x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);}else if(use_gebi){var o=document.getElementById(anchorname);x=AnchorPosition_getPageOffsetLeft(o);y=AnchorPosition_getPageOffsetTop(o);}else if(use_css){x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);}else if(use_layers){var found=0;for(var i=0;i<document.anchors.length;i++){if(document.anchors[i].name==anchorname){found=1;break;}}if(found==0){coordinates.x=0;coordinates.y=0;return coordinates;}x=document.anchors[i].x;y=document.anchors[i].y;}else{coordinates.x=0;coordinates.y=0;return coordinates;}coordinates.x=x;coordinates.y=y;return coordinates;}
    function getAnchorWindowPosition(anchorname){var coordinates=getAnchorPosition(anchorname);var x=0;var y=0;if(document.getElementById){if(isNaN(window.screenX)){x=coordinates.x-document.body.scrollLeft+window.screenLeft;y=coordinates.y-document.body.scrollTop+window.screenTop;}else{x=coordinates.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;y=coordinates.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset;}}else if(document.all){x=coordinates.x-document.body.scrollLeft+window.screenLeft;y=coordinates.y-document.body.scrollTop+window.screenTop;}else if(document.layers){x=coordinates.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;y=coordinates.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset;}coordinates.x=x;coordinates.y=y;return coordinates;}
    function AnchorPosition_getPageOffsetLeft(el){var ol=el.offsetLeft;while((el=el.offsetParent) != null){ol += el.offsetLeft;}return ol;}
    function AnchorPosition_getWindowOffsetLeft(el){return AnchorPosition_getPageOffsetLeft(el)-document.body.scrollLeft;}
    function AnchorPosition_getPageOffsetTop(el){var ot=el.offsetTop;while((el=el.offsetParent) != null){ot += el.offsetTop;}return ot;}
    function AnchorPosition_getWindowOffsetTop(el){return AnchorPosition_getPageOffsetTop(el)-document.body.scrollTop;}

    var relcompany= new Array(  'www.lotte.co.kr','롯데그룹',
                                'www.lotteb2b.com','롯데통합구매시스템',
                                'www.lottetown.com','롯데타운',
                                'www.lottememberscard.com','롯데멤버스',
                                'green.lotte.co.kr','롯데환경경영',
                                'www.daehong.com','대홍기획',
                                'www.lottecon.co.kr','롯데건설',
                                'www.lotteapt.net ','롯데캐슬',
                                'www.lottelem.co.kr','롯데기공',
                                'www.lotte.com','롯데닷컴',
                                'www.llc.co.kr','롯데로지스틱스',
                                'www.lotteria.co.kr ','롯데리아',
                                'www.lotteriamall.com','롯데리아몰',
                                'www.angelinus.co.kr','엔제리너스',
                                'shop.angelinus.co.kr','엔제리너스몰',
                                'www.lottemart.com','롯데마트',
                                'www.lottedfs.com','롯데면세점',
                                'www.lotte.co.kr/s2_business/sub2_02-11.html','롯데물산',
                                'www.lotteshopping.com','롯데백화점',
                                'www.lotteoutlets.com','롯데아울렛',
                                'www.lotteshopping.com/green/index.jsp','롯데그린파트너십',
                                'buying.lotteshopping.com','상품본부',
                                'lotteedi.dpt.co.kr','EDI 시스템',
                                'www.boulangerie.co.kr','롯데브랑제리',
                                'www.skyhill.co.kr','롯데스카이힐 C.C.',
                                'www.lottesamkang.com','롯데삼강',
                                'www.lotteins.co.kr','롯데손해보험',
                                'www.lotteintl.co.kr','롯데상사',
                                'www.lottesuper.co.kr','롯데슈퍼',
                                'www.lottecinema.co.kr','롯데시네마',
                                'www.lottefood.co.kr','롯데식품',
                                'www.lotteal.co.kr','롯데알미늄',
                                'www.lotteal.co.kr/2_product/s0240.asp','포장사업본부',
                                'www.lotteacademy.co.kr','롯데연수원',
                                'edu.lotteacademy.co.kr','사이버연수원',
                                'www.lotteworld.com','롯데월드',
                                'www.lottelhp.com','롯데유통사업본부',
                                'www.giantsclub.com','롯데자이언츠',
                                'www.lottefoundation.or.kr','롯데재단',
                                'www.lotte-e.co.kr','롯데전자',
                                'www.ldcc.co.kr','롯데정보통신',
                                'www.lotteconf.co.kr','롯데제과',
                                'www.lottehealth1.com','헬스원',
                                'www.natuur.co.kr','나뚜루',
                                'www.pepero.co.kr','빼빼로',
                                'www.cheetos.co.kr','치토스',
                                'www.lottepharm.co.kr','롯데제약',
                                'www.lottejtb.com','롯데제이티비',
                                'www.soju.co.kr','롯데주류BG-처음처럼',
                                'www.wine.co.kr','롯데주류BG-와인',
                                'www.lotternd.com','롯데중앙연구소',
                                'job.lotte.co.kr','롯데채용센터',
                                'www.lottechilsung.co.kr','롯데칠성음료',
                                'www.coffeecantata.co.kr','칸타타',
                                'www.lottecard.co.kr','롯데카드',
                                'www.lottecap.com','롯데캐피탈',
                                'www.lotteham.co.kr','롯데햄',
                                'www.lottehotel.com','롯데호텔',
                                'www.lottehotelbusan.com','부산롯데호텔',
                                'www.lotteimall.com/main/Index.jsp','롯데홈쇼핑',
                                'www.lotteimall.com/main/Index.jsp','롯데아이몰',
                                'www.freshdelica.co.kr','롯데후레쉬델리카',
                                'www.charlottetheater.co.kr','샤롯데씨어터',
                                'www.avenuel.co.kr','에비뉴엘',
                                'www.uniqlo.kr','에프알엘코리아',
                                'www.wellga.com','웰가',
                                'www.lotteasahi.co.kr','롯데아사히주류',
                                'www.canon-bs.co.kr','캐논코리아비즈니스솔루션',
                                'www.kpchem.co.kr','케이피케미칼',
                                'www.7-eleven.co.kr','코리아세븐',
                                'www.krispykreme.co.kr','크리스피크림도넛',
                                'www.toysrus.co.kr','토이저러스',
                                'www.fujifilm.co.kr','한국후지필름',
                                'www.fujicolor.co.kr','후지필름 인터넷 사진관',
                                'www.hpc.co.kr','호남석유화학',
                                'www.tgif.co.kr','T.G.I.Fridays\'');
    
    
    
    
    
    
    // Global variables
    xMousePos = 0; // Horizontal position of the mouse on the screen
    yMousePos = 0; // Vertical position of the mouse on the screen
    xMousePosMax = 0; // Width of the page
    yMousePosMax = 0; // Height of the page

    function captureMousePosition(e) {
        if (document.layers) {
            // When the page scrolls in Netscape, the event's mouse position
            // reflects the absolute position on the screen. innerHight/Width
            // is the position from the top/left of the screen that the user is
            // looking at. pageX/YOffset is the amount that the user has 
            // scrolled into the page. So the values will be in relation to
            // each other as the total offsets into the page, no matter if
            // the user has scrolled or not.
            xMousePos = e.pageX;
            yMousePos = e.pageY;
            xMousePosMax = window.innerWidth+window.pageXOffset;
            yMousePosMax = window.innerHeight+window.pageYOffset;
        } else if (document.all) {
            // When the page scrolls in IE, the event's mouse position 
            // reflects the position from the top/left of the screen the 
            // user is looking at. scrollLeft/Top is the amount the user
            // has scrolled into the page. clientWidth/Height is the height/
            // width of the current page the user is looking at. So, to be
            // consistent with Netscape (above), add the scroll offsets to
            // both so we end up with an absolute value on the page, no 
            // matter if the user has scrolled or not.
            xMousePos = window.event.x+document.body.scrollLeft;
            yMousePos = window.event.y+document.body.scrollTop;
            xMousePosMax = document.body.clientWidth+document.body.scrollLeft;
            yMousePosMax = document.body.clientHeight+document.body.scrollTop;
        } else if (document.getElementById) {
            // Netscape 6 behaves the same as Netscape 4 in this regard 
            xMousePos = e.pageX;
            yMousePos = e.pageY;
            xMousePosMax = window.innerWidth+window.pageXOffset;
            yMousePosMax = window.innerHeight+window.pageYOffset;
        }
    }
    
    function thisMovie(movieName){
        if(navigator.appName.indexOf("Microsoft")!= -1){
            return window[movieName];
        }else{
            return document[movieName];
        }
    }
    
    function fixCImage(image, size) {
        image.removeAttribute('width');
        image.removeAttribute('height');
        var width = image.naturalWidth || image.width;
        var height = image.naturalHeight || image.height;
        if (height > width) {
        if (height > size) {
        width = width * size / height;
        height = size;
        };
        } else {
        if (width > size) {
        height = height * size / width;
        width = size;
        };
        };
        image.height = height;
        image.width = width;
    }
    function fixImage(image) {
        image.removeAttribute('width');
        image.removeAttribute('height');
        var width = image.naturalWidth || image.width;
        var height = image.naturalHeight || image.height;
        if (height > width) {
            if (height > 200) {
                width = width * 200 / height;
                height = 200;
            };
        } else {
            if (width > 200) {
                height = height * 200 / width;
                width = 200;
            };
        };
        image.height = height;
        image.width = width;
    }
    function fixSImage(image) {
        image.removeAttribute('width');
        image.removeAttribute('height');
        var width = image.naturalWidth || image.width;
        var height = image.naturalHeight || image.height;
        if (height > width) {
            if (height > 51) {
                width = width * 51 / height;
                height = 51;
            };
        } else {
            if (width > 51) {
                height = height * 51 / width;
                width = 51;
            };
        };
        image.height = height;
        image.width = width;
    }
    function fixTImage(image) {
        image.removeAttribute('width');
        image.removeAttribute('height');
        var width = image.naturalWidth || image.width;
        var height = image.naturalHeight || image.height;
        if (height > width) {
            if (height > 150) {
                width = width * 150 / height;
                height = 150;
            };
        } else {
            if (width > 150) {
                height = height * 150 / width;
                width = 150;
            };
        };
        image.height = height;
        image.width = width;
    }


