var m_SslUrl = '';
var m_Normal = '';

document.write("<div id='progressbar' style='display:none;position:absolute;left:22px;top:250px;width:100%;height:100%;z-index:1;align:center;'> ");
document.write("<table width='100%' height='100%' border=0 align=center> ");
document.write("<tr> ");
document.write("	<td width='100%' height='100%' valign='middle' align='center'> ");
document.write("		<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' WIDTH=501 HEIGHT=155 id=mainFlash> ");
document.write("		<PARAM NAME=menu VALUE=false> ");
document.write("		<PARAM NAME=movie VALUE='/media/flash/front_loading.swf'> ");
document.write("		<PARAM NAME=quality VALUE=high> ");
document.write("		<PARAM NAME=bgcolor VALUE=#FFFFFF> ");
document.write("		<PARAM NAME=wmode VALUE=transparent> ");
document.write("		<EMBED src='/media/flash/front_loading.swf' quality=high bgcolor=#FFFFFF WIDTH=501 HEIGHT=155 TYPE='application/x-shockwave-flash' PLUGINSPAGE=http://www.macromedia.com/go/getflashplayer> ");
document.write("		</EMBED> ");
document.write("		</OBJECT> ");
document.write("	</td> ");
document.write("</tr> ");
document.write("</table> ");
document.write("</div> ");
document.write("<iframe src='about:blank' id='hideFrame' name='hideFrame' width='0' height='0' style='display:none;'></iframe>");
//document.write("<iframe src='about:blank' id='hideFrame' name='hideFrame' width='800' height='100' style='display:block;'></iframe>");
// ÄÁÅÙÃ÷·¹ÀÌ¾î ¼¼·Î°ª

function onWriteFooter(){
document.write("<tr><td height=1 class='footer_line'></td></tr> \n");
document.write("<tr> \n");
document.write("    <td height=46 valign=top> \n");
document.write("        <table width=100% cellpadding=0 cellspacing=0 border=0> \n");
document.write("        <tr> \n");
document.write("            <td style='padding:12 0 0 30'><img src='/media/images/common/footer_copyright.gif' border='0'  align=absmiddle></td> \n");
document.write("            <td align=right style='padding:13 25 0 0'> \n");
document.write("                <table cellpadding=0 cellspacing=0 border=0> \n");
document.write("                <tr> \n");
document.write("                    <td><a href='" + m_Normal + "/utility/privacy.asp' onfocus='blur()'><img src='/media/images/common/footer_privacy.gif' border='0'></a></td> \n");
document.write("                    <td><a href='" + m_Normal + "/utility/sitemap.asp' onfocus='blur()'><img src='/media/images/common/footer_sitemap.gif' border='0'></a></td> \n");
document.write("                    <td><a href='" + m_Normal + "/utility/contact.asp' onfocus='blur()'><img src='/media/images/common/footer_contact.gif' border='0'></a></td> \n");
document.write("                    <td><a href='" + m_SslUrl + "/utility/cooperate.asp' onfocus='blur()'><img src='/media/images/common/footer_cooper.gif' border='0'></a></td> \n");
document.write("                    <td><a href='http://www.gsconst.co.kr' onfocus='blur()' target='_blank'><img src='/media/images/common/footer_gs.gif' border='0'></a></td> \n");
document.write("                </tr> \n");
document.write("                </table> \n");
document.write("            </td> \n");
document.write("        </tr> \n");
document.write("        </table> \n");
document.write("    </td> \n");
document.write("</tr> \n");
document.write("<tr><td height=12 class='bottom_line'></td></tr> \n");

}
function setDiv() {
    var winY =  document.body.clientHeight - 90 ;
    document.all.cont.style.height = winY ;
}

function ch(name,img){
    var imgUrl = "/media/images/"
    name.src = imgUrl + img;
}

/************************************************************/

function home(){
    top.window.location.href = m_Normal + '/index_intro.asp?skip=1';
}

function apt(){
    window.location.href = m_Normal + '/apt/index.asp';
}

/* 2005.06.27 Ãß°¡ ½ÃÀÛ*/
function aptdbList(){
    window.location.href = m_Normal + '/aptdb/aptdb_list.asp';
}

function bunyangPlan(){
    window.location.href = m_Normal + '/apt/bunyang_plan.asp';
}
/* 2005.06.27 Ãß°¡ ½ÃÀÛ*/

function rebuild(){
    window.location.href = m_Normal + '/apt/rebuild/info.asp';
}

function remodeling(){
    window.location.href = m_Normal + '/apt/remodeling/info.asp';
}

function value(){
    window.location.href = m_Normal + '/value/notice_list.asp';
}

function life(){
    window.location.href = m_Normal + '/life/house/news01_list.asp';
}

function customer(){
    window.location.href = m_Normal + '/customer/faq.asp';
}

/************************************************************/

// ¾ÆÆÄÆ® history°æ·Î
function goNavi(gb,idx){
    if(gb =="info"){
        window.location.href=m_Normal + '/apt/info/info.asp?idx='+idx+'&code_jcm=1';
    }
    if(gb =="info01"){
        window.location.href=m_Normal + '/apt/info/info.asp?idx='+idx+'&code_jcm=1';
    }
    if(gb =="info02"){
        window.location.href=m_Normal + '/apt/info/info02.asp?idx='+idx+'&code_jcm=1';
    }
    if(gb =="info03"){
        window.location.href=m_Normal + '/apt/info/info03.asp?idx='+idx+'&code_jcm=1';
    }
    if(gb =="info04"){
        window.location.href=m_Normal + '/apt/info/info04.asp?idx='+idx+'&code_jcm=1';
    }
    if(gb =="bang"){
        window.location.href=m_Normal + '/apt/info/bang.asp?idx='+idx+'&code_jcm=1';
    }
    if(gb=="bun"){
        window.location.href=m_Normal + '/apt/bunyang/schedule.asp?idx='+idx+'&code_jcm=1';
    }
    if(gb=="gon"){
        window.location.href=m_Normal + '/apt/gongsa/status.asp?idx='+idx+'&code_jcm=1';
    }
    if(gb=="mov"){
        window.location.href=m_Normal + '/apt/movement/schedule.asp?idx='+idx+'&code_jcm=1';
    }
}

//ÇöÀåÀ» Å¬¸¯½Ã ÁøÇà»óÅÂ¿¡µû¶ó¼­ ÀÌµ¿ÆäÀÌÁö¸¦ ¼±ÅÃÇÑ´Ù.
function goApt(idx,status){
    if (status=="1"){
        window.location.href=m_Normal + '/apt/bunyang/schedule.asp?idx='+idx+'&code_jcm=1';
    }else if(status=="2"){
        window.location.href=m_Normal + '/apt/gongsa/status.asp?idx='+idx+'&code_jcm=1';
    }else if(status=="3"){
        window.location.href=m_Normal + '/apt/movement/schedule.asp?idx='+idx+'&code_jcm=1';
    }
}

/************************************************************/

// È®´ëº¸±â ÆË¾÷
function viewImg(url){
    //var w = 650 ;
    //var h = 491 ;
    //var winX = (screen.availWidth - w) * 0.5 ;
  //var winY = (screen.availHeight - h) * 0.5 ;
  var opt = "width=691,height=455,top=200,left=300,scrollbars=yes" ;
    window.open(url, 'viewImg',opt) ;
}

// ¸ðµ¨ÇÏ¿ì½º¾È³» È®´ëº¸±â ÆË¾÷
function viewImg2(url){
  var opt = "width=556,height=510,top=200,left=300,scrollbars=yes" ;
    window.open(url, 'viewImg2',opt) ;
}

/***************************¿©±âºÎÅÍ*********************************/

// ÀÔÁÖ´ÜÁö ¹èÄ¡µµÈ®´ëº¸±â ÆË¾÷
function viewImg3(url){
  var opt = "width=667,height=510,top=200,left=300,scrollbars=yes" ;
    window.open(url, 'viewImg3',opt) ;
}


// ÆòÇüÁ¤º¸ È®´ëº¸±â ÆË¾÷
function viewImg4(url){
  var opt = "width=612,height=540,top=200,left=300,scrollbars=no" ;
    window.open(url, 'viewImg4',opt) ;
}

/***************************¿©±â±îÁö*********************************/

/* ¾ÞÄ¿±â´ÉÀÇ ½ºÅ©·Ñ */
function window_top() {
    window.scroll(0,0);
}

/************************************************************/

/* »ó´ÜÅ¾ÇÃ·¡½Ã¸Þ´º */
//¾ÆÆÄÆ®ÂÊÀº aptÄÚµå
//»ýÈ° : value
//¾Õ¼± : life
//ÀÚÀÌ : customer

/************************************************************/

//»ó´ÜÁÖ¸Þ´º ¸µÅ©Á¤º¸

function goMenu(gb){
var frm = document.frm1;
var iii = document.URL.split("/");
//var get_url = iii[3];
//var jjj = get_url.split("?");
 if (iii[3] == "index_intro.asp" || iii[3] == "index_intro.asp?skip=1")
 {
     frm.gb.value = gb;
     frm.action="/index_full.asp";
    frm.submit();
     }else{
    if(gb == '') {
               frm.gb.value = gb;
           frm.action="/index_intro.asp?skip=1";
          frm.submit();
        }else{
        if (gb=='apt') {                        //ºÐ¾ç°ø»ç´ÜÁö
                movelayer("on");
                document.all.mainframe.src = m_Normal + "/apt/index.asp" ;
        }else if(gb=='apt01'){                    //ÀÔÁÖ´ÜÁö
                movelayer("on");
                document.all.mainframe.src = m_Normal + "/apt/index.asp";
        }else if(gb=='apt02'){                    //ÀÔÁÖ´ÜÁö
                movelayer("on");
                document.all.mainframe.src = m_Normal + "/aptdb/aptdb_list.asp";
        }else if(gb=='apt03'){                    //Àç°³¹ßÀç°ÇÃà
                movelayer("on");
                document.all.mainframe.src = m_Normal + "/apt/rebuild/info.asp";
        }else if(gb=='apt04'){                    //¸®¸ðµ¨¸µ
                movelayer("on");
                document.all.mainframe.src = m_Normal + "/apt/remodeling/info.asp";

        }else if(gb=='value01'){                    //ÀÚÀÌ¼Ò½Ä
                movelayer("on");
                document.all.mainframe.src = m_Normal + "/value/notice_list.asp";
        }else if(gb=='value02'){                    //°í°´°¡ÀÌµå
                movelayer("on");
                document.all.mainframe.src = m_Normal + "/value/guide/subscription.asp";
        }else if(gb=='value03'){                    //Ã¼Å©¸®½ºÆ®
                movelayer("on");
                document.all.mainframe.src = m_Normal + "/value/check/modelhouse.asp";
        }else if(gb=='value04'){                    //ºÎµ¿»ê ¿ë¾î
                movelayer("on");
                document.all.mainframe.src = m_Normal + "/value/dictionary/construction.asp";
        }else if(gb=='value05'){                    //À¥Áøxi
                movelayer("on");
                document.all.mainframe.src = m_Normal + "/value/webzine/webzine.asp";
        }else if(gb=='value06'){                    //xiÀÌº¥Æ®
                movelayer("on");
                document.all.mainframe.src = m_Normal + "/value/event_view.asp";
        }else if(gb=='value07'){                    //Á¤º¸°øÀ¯°Ô½ÃÆÇ
                movelayer("on");
                document.all.mainframe.src = m_Normal + "/value/board_list.asp?gb=value07&back_url=/value/board_list.asp";

        }else if(gb=='life01'){                        //¾Õ¼±-ÁÖÅÃ¹®È­°ü
                movelayer("on");
                document.all.mainframe.src = m_Normal + "/life/house/news01_list.asp";
        }else if(gb=='life02'){                        //Çàº¹ÀÌ °¡µæÇÑ Áý
                movelayer("on");
                document.all.mainframe.src = m_Normal + "/life/interior_list.asp";
        }else if(gb=='life03'){                        //ÅõÀÚ°¡ÀÌµå
                movelayer("on");
                document.all.mainframe.src = m_Normal + "/life/invest/column/column.asp";
        }else if(gb=='life04'){                        //¹®È­Á¤º¸
                movelayer("on");
                document.all.mainframe.src = m_Normal + "/life/culture/perform_list.asp";

        }else if(gb=='life05'){                        //Ä¿¹Â´ÏÆ¼
                movelayer("on");
                document.all.mainframe.src = m_Normal + "/customer/cafe_index.asp";

        }else if(gb=='customer01'){                //ÀÚÁÖ¹¯´ÂÁú¹®
                movelayer("on");
                document.all.mainframe.src = m_Normal + "/customer/faq.asp";
        }else if(gb=='customer02'){                //¹®ÀÇ¹× Á¦¾È
                movelayer("on");
                document.all.mainframe.src = m_Normal + "/customer/qna_list.asp?gb=customer02&back_url=/customer/qna_list.asp";
        }else if(gb=='customer03'){                //AS¼¾ÅÍ
                movelayer("on");
                document.all.mainframe.src = m_Normal + "/customer/service/cs_info.asp";
        }else if(gb=='customer04'){                //µ¶ÀÚÂü¿©
                movelayer("on");
                document.all.mainframe.src = m_Normal + "/customer/consulting.asp?gb=customer04&back_url=/customer/consulting.asp";
        }
        }

    }
}



/* Å×ÀÏ¸Þ´º */
function tail(gb){
    var frm = document.frm1;
    var iii = document.URL.split("/");
    if (iii[3] == "index_intro.asp" || iii[3] == "index_intro.asp?skip=1"){
        frm.gb.value = gb;
         frm.action="/index_full.asp";
        frm.submit();
    }else{
        if(gb == '') {
            frm.gb.value = gb;
             frm.action="/index_intro.asp?skip=1";
            frm.submit();
        }else{

            if (gb =='0') {                        //·Î±×¾Æ¿ô
                window.location.href= m_Normal + "/member/front_log_out_e.asp";
            }else if (gb =='1') {            //·Î±×ÀÎ
                movelayer("on");
                //document.all.mainframe.src="/member/login.asp";
                top.location.href= m_Normal + "/index_full.asp?gb=1";
            }else if(gb=='2'){                //È¸¿ø°¡ÀÔ
                movelayer("on");
                document.all.mainframe.src= m_SslUrl + "/member/join.asp";
            }else if(gb=='3'){                //»çÀÌÆ®¸Ê
                movelayer("on");
                document.all.mainframe.src= m_Normal + "/utility/sitemap.asp";
            }else if(gb=='4'){                //Contact Us
                movelayer("on");
                document.all.mainframe.src= m_Normal + "/utility/contact.asp";
            }
        }
    }
}

/************************************************************/

/* °í°´ */
function open_pop(gb){
    var path_url;
    if(gb=='1'){                    //Á¶ÇÕ°í°´
        path_url = "/myxi/union/index.asp";
    }else if(gb=='2'){        //°è¾à°í°´
        path_url = "/myxi/contract/index.asp";
    }else if(gb=='3'){        //ÀÔÁÖ°í°´
        path_url = "/myxi/resident/index.asp";
    }else if(gb=='4'){        //ÀÏ¹ÝÈ¸¿ø
        path_url = "/myxi/general/index.asp";
    }

    var w = 918 ;
    var winX = (screen.availWidth - w) * 0.5 - 2;

    var opt2 = "width=" + w + ",height=573,top=90,left=" + winX + ",scrollbars=no,status=no,titlebar=no,menubar=no,location=no,toolbar=no";
    var win1 = window.open(path_url, 'open_pop',opt2) ;
    win1.focus();

}

/* Ã¢ÃÖ¼ÒÈ­ */
function winMin() {
    var winXi = this.window ;
    winXi.blur();
}

/* Ã¢´Ý±â */
function winClose() {
    window.close();
}

/************************************************************/

// main flash go to url - news/event
function fn_fla(no,gb) {
    var frm = document.frm1;
    var iii = document.URL.split("/");
    if (iii[3] == "index_intro.asp" || iii[3] == "index_intro.asp?skip=1"){
        //frm.gb.value = "value05";
        //frm.action="/index_full.asp";
        //frm.submit();
        if (gb=="event_view"){
            frm.gb.value = "event_view";
            frm.action="/index_full.asp?idx="+no;
            frm.submit();
        }else{
            frm.gb.value = "news_view";
            frm.action="/index_full.asp?idx="+no;
            frm.submit();
        }
    }else{
        if (gb=="event_view"){
            movelayer("on");
            document.all.mainframe.src = "/value/event_view.asp?idx="+no;
        }else{
            movelayer("on");
            document.all.mainframe.src = "/value/notice_view.asp?idx="+no;
        }
    }
}

// main flash go to url - webzine
function webzine() {
    var frm = document.frm1;
    var iii = document.URL.split("/");
    if (iii[3] == "index_intro.asp" || iii[3] == "index_intro.asp?skip=1"){
        frm.gb.value = "value05";
        frm.action="/index_full.asp";
        frm.submit();
    }else{
        movelayer("on");
        document.all.mainframe.src = "/value/webzine/webzine.asp";
    }
}

/************************************************************/

/**************************** ´Ü¾î ÇÊÅÍ¸µ ********************************/
function WordFilter(s){
    var strWord = "»ç±â,ÇãÀ§".split(",");
    var regexp;
    for(var i=0;i<strWord.length;i++){
         regexp=eval("/"+strWord[i]+"/ig");

         if (s.match(regexp)){
              alert("\""+strWord[i]+"\" ´Ü¾î´Â µî·ÏÇÏ±â¿¡ ÀûÀýÇÏÁö ¾Ê½À´Ï´Ù.");
              return false;
         }
    }
}
/**************************** ´Ü¾î ÇÊÅÍ¸µ ********************************/

//******************************************************************* Image Å©±â¿¡ ¸Â°Ô Áß¾Ó¿¡ »õÃ¢¿­±â
var bigImage = new Image();
function showImgWin(imgSrc){
    bigImage.src = imgSrc;
    setTimeout("popupImg(bigImage)", 100);
}
function popupImg(bigImage){
    if (! bigImage.complete) {
         setTimeout("popupImg(bigImage)", 100);
         return;
    }
    var x = bigImage.width;
    var y = bigImage.height;
    var x2 = (screen.width - x) / 2;
    var y2 = (screen.height - y) / 2;
    var showImage = window.open("","","left="+x2+",top="+y2+",width="+x+",height="+y);
    showImage.document.write("<html>");
    showImage.document.write("<body style='margin:0'>");
    showImage.document.write("<img src='"+bigImage.src+"' border='1'>");
    showImage.document.write("</body>");
    showImage.document.write("</html>");
}
function ShowFlash(sfilename, iwidth, iheight){
	var _showflash = '';

	_showflash = '<object classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,22,0 width='+ iwidth +' height='+ iheight +'>';
	_showflash = _showflash + '<param name=movie value='+ sfilename +'>';
	_showflash = _showflash + '<param name=allowScriptAccess value=always>';
	_showflash = _showflash + '<param name=bgcolor  value=#000000>';
	_showflash = _showflash + '<param name=quality  value=high>';
	_showflash = _showflash + '<param name=wmode    value=transparent>';
	_showflash = _showflash + '<embed src='+ sfilename +' quality=high pluginspage=http://www.macromedia.com/go/getflashplayer bgcolor="#000000" type=application/x-shockwave-flash allowscriptaccess=always swliveconnect=true width='+ iwidth +' height='+ iheight +' wmode=transparent></embed></object>';


    document.write(_showflash);
}
// ÄíÅ°°ªÀ»  °¡Á®¿Â´Ù.
function getCookie(name) {
    var Found = false
    var start, end
    var i = 0

    // cookie ¹®ÀÚ¿­ ÀüÃ¼¸¦ °Ë»ö
    while(i <= document.cookie.length) {
        start = i
        end = start + name.length
        // name°ú µ¿ÀÏÇÑ ¹®ÀÚ°¡ ÀÖ´Ù¸é
        if(document.cookie.substring(start, end) == name) {
            Found = true ;
            break;
        }
        i++
    }

    // name ¹®ÀÚ¿­À» cookie¿¡¼­ Ã£¾Ò´Ù¸é
    if(Found == true) {
        start = end + 1
        end = document.cookie.indexOf(";", start)

        // ¸¶Áö¸· ºÎºÐÀÌ¶ó´Â °ÍÀ» ÀÇ¹Ì(¸¶Áö¸·¿¡´Â ";"°¡ ¾ø´Ù)
        if(end < start)
            end = document.cookie.length

        // name¿¡ ÇØ´çÇÏ´Â value°ªÀ» ÃßÃâÇÏ¿© ¸®ÅÏÇÑ´Ù.
        return document.cookie.substring(start, end)
    }
    // Ã£Áö ¸øÇß´Ù¸é
    return ""
}
// ÄíÅ°°ªÀ» ÀúÀåÇÑ´Ù.
function setCookie(name, value, expiredays) {
    var todayDate = new Date();
    todayDate.setDate(todayDate.getDate() + expiredays);
    document.cookie = name + "=" + escape(value) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}
