﻿/// <reference path="jquery-vsdoc.js" />

document.write("<div id='tempDiv'></div>"); // 임시 컨테이너.

// jquery static effects
var effects = 
{
    A: "blind", B: "clip", C: "drop", D: "explode", E: "fold", F: "puff", G: "slide", 
    H: "scale", I: "size", J: "pulsate", K: "bounce", L: "highlight", M: "shake"
};


//---------------------------------------------------------------------
//  Description: 페이지 로딩 후 기본 환경 설정.
//  Date: 2009-07-31
//  Author: 조 정용
//  Depends: jQuery Library
//---------------------------------------------------------------------
//$(function() {
//    // 포커스 효과  
//    $("input[type=text], input[type=password]").each(function() {
//        $(this).focus(function() { $(this).addClass("input-focus") }).blur(function() { $(this).removeClass("input-focus") });
//    });

//    $("label").hover(
//        function() { $(this).addClass("label-on-highlight"); },
//        function() { $(this).removeClass("label-on-highlight"); }
//    );
//    
//    $(":checkbox").css("cursor", "pointer");    
//});

//// jQuery 확장함수목록
//(function($) {

//    // 이벤트 타겟 기준으로 메세지 레이어 팝업 출력
//    // @targetEvent : 이벤트가 발생한 주체 (element).
//    // @message  : 표출할 메세지.
//    $.fn.viewFineshedMessage = function(opts){
//        var objOffset = $(opts.target).offset();
//        var div = $("<div />").text(opts.message).css({ 
//                        left: objOffset.left - 10,
//                        top: objOffset.top - 10,
//                        position: "absolute",                            
//                        height: "20px",
//                        color: "red",
//                        border: "solid 2px gray",
//                        backgroundColor: "white",
//                        fontWeight: "bold",
//                        padding: "4px 25px 2px 25px"
//                    });
//        div.appendTo($(document.body));                        
//        div.fadeOut(2000);
//    };

//    // 캘린더 기본설정
//    $.datepicker.setDefaults({
//        monthNames: ['년 1월', '년 2월', '년 3월', '년 4월', '년 5월', '년 6월', '년 7월', '년 8월', '년 9월', '년 10월', '년 11월', '년 12월'],
//        dayNamesMin: ['일', '월', '화', '수', '목', '금', '토'],
//        monthNamesShort: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'],
//        changeYear: true,
//        changeMonth: true,
//        showMonthAfterYear: false,
//        dateFormat: 'yy-mm-dd',
//        buttonText: "달력",
//        defaultDate: new Date(),
//        hideIfNoPrevNext: true
//    });    
//    
//    // 라벨 워터마크 (확장메서드)    
//    $.fn.overlabel = function() {
//        this.filter('label[for]').each(function() {
//            var label = $(this);
//            var id = label.attr('for');
//            var field = $("#" + id);

//            if (!field) return;

//            label.addClass('overlabel-apply');

//            var hide_label = function() { label.css('text-indent', '-1000px') };
//            var show_label = function() { this.value || label.css('text-indent', '0px') };

//            $(field).focus(hide_label).blur(show_label).each(show_label);

//            if (field.val() != "") hide_label();
//        });
//    };
//    
//    // 검색 유효검증 (확장메서드)
//    // @viewTarget : 표출하고자 하는 element (보통은 input text box)
//    $.fn.searchValidation = function(viewTarget) {
//        $(document.body).append("<div id='err'></div>");
//        var target = $(this);
//        var offset = viewTarget.offset();
//	    var message = $("#err").css({   "padding-top": "3px",
//                                        "padding-left": "5px",
//                                        "color":"red",
//                                        "fontWeight":"bold",
//                                        "top":offset.top, 
//                                        "left":offset.left, 
//                                        "width":viewTarget.width(), 
//                                        "height":viewTarget.height(), 
//                                        "position":"absolute"   });
//        switch(target.attr("tagName")) 
//        {
//            case "SELECT":                
//                var selectedVal = target.find("option:selected").val();               
//	            if (selectedVal.length == 0) {
//		            message.text("검색 항목을 선택하세요.").fadeOut(1000, function(){ target.focus(); $(this).remove(); });
//		            return false;
//	            }
//                break;
//                
//            case "INPUT":
//                if ($.trim(target.val()).length == 0) {
//		            message.text("검색어를 입력하세요.").fadeOut(1000, function(){ target.focus(); $(this).remove(); });
//		            return false;
//	            }
//                break;
//        } 
//	    return true;
//   };
//    
//})(jQuery);


//---------------------------------------------------------------------
//  Desc: 체크박스 전체선택 및 전체취소
//  Date: 2009-07-20
//  Author: 조 정용
//  * Depends: jquery library
//---------------------------------------------------------------------
function selectAllOrCancel(objEvt, target, filter) {
	objEvt.click(function() {
        if (objEvt.is(":checked")) {
            var $checkboxes;
            if (filter.length > 0)
                $checkboxes = target.find(":checkbox:not([id$=" + filter + "])");
            else 
                $checkboxes = target.find(":checkbox");
            
            $checkboxes.each(function(){
            if (!$(this).attr("disabled"))
                $(this).attr("checked",true);
            });
            
            $(".messageInvalid").text("");
        }			 
        else
	        target.find(":checkbox").attr("checked", false);
	});
}


// 우편번호 팝업
function popupZipcode(){
    var features = "width=440px, height=282px, left=0, top=0, scrollbars=yes";
    var pop = window.open('/member/postal_find.aspx', 'zipcode_popup', features);
    pop.focus();
}

//---------------------------------------------------------------------
// Description : 메세지 표현 및 하이라이팅.
// Function : checkLength
// Date: 2009-07-31
// Author: 조 정용
// Arguments :  o = 대상(Object), msg = 메세지(String)
// Return : JQuery
//---------------------------------------------------------------------
function updateTips(o, msg) {
    o.text(msg).effect("highlight", {}, 1500);
}


//---------------------------------------------------------------------
// Description : 문자열의 길이 체크
// Function : checkLength
// Date: 2009-07-31
// Author: 조 정용
// Arguments :  o = 대상(Object),
//              n = 표현명칭(String),
//              min = 최소값(int),
//              max = 최대값(int),
//              err = 메세지(Object)
// Return : boolean
//---------------------------------------------------------------------
function checkLength(o, n, min, max, err) {
    if (o.val().length > max || o.val().length < min) {
	    o.addClass('ui-state-error');
	    updateTips(err, n + "의 길이는 " + min + " 보다 크거나 같고, " + max + " 보다 작거나 같아야 합니다.");
	    return false;
    } else {
	    return true;
    }
}


//---------------------------------------------------------------------
// Description : 이메일 체크
// Function : checkEmail
// Date: 2009-07-31
// Author: 조 정용
// Arguments :  o   => 대상(Object), 
//              err => 메세지출력(Object)
// Return : boolean
//----------------------------------------------------------------------
function checkEmail(o, err) {
    var regexp = /(\S+)@(\S+)\.(\S+)/;			
    if (!regexp.test(o.val())) {
	    updateTips(err, "이메일 형식이 올바르지 않습니다.");
	    return false;
    } else {
	    return true;
    }
}

//---------------------------------------------------------------------
// Description : 연락처 체크
// Function : checkPhone
// Date: 2009-07-31
// Author: 조 정용
// Arguments :          o   => 대상(object)
//                      err => 메세지출력(object)
// Return : boolean
//---------------------------------------------------------------------
function checkPhone(o, err) {
    var regexp = /^0[0-9]{1,3}(\-)[0-9]{3,4}(\-)[0-9]{4}$/;
    if (!regexp.test(o.val())){
	    updateTips(err, "연락처 형식이 올바르지 않습니다.");	    
	    return false;
    } else {
	    return true;
    }
}



//---------------------------------------------------------------------
// Description : 다이얼로그 Confirm 창 설정
// Function : SetConfirmation
// Date: 2009-08-14
// Author: 조 정용
// Arguments :  buttonId            => 버튼ID (object), 
//              message             => 메세지 (string),
//              causesValidation    => 검증유무 (bool)
// Return : boolean
//---------------------------------------------------------------------
var Page_IsValid = true;
var execute = false;

function SetConfirmation(buttonId, message, causesValidation, validationFunc) {


	//Unbind click before bind
	//(This is needed when using UpdatePanels)
	$("#" + buttonId).unbind('click').click(function(e) {
		//We keep the original click event so
		//it can be executed as a callback
		var target = $(e.target);
        
		//Check if the control is a button or a link
		if (target.attr("href")) {
			callback = function() { execute = true; window.location.href = target.attr("href"); };
		}
		else {
			callback = function() { execute = true; target.click(); };
		}

		var isValid = true;
		if ($.isFunction(validationFunc))
		{
		    isValid = validationFunc.apply();
        }
        
		//Register popup and yes callback
		//We take into account causes validation button property
		//And if the page is currently valid
		if (isValid && (!causesValidation || Page_IsValid))
			confirmPopup(message, callback);

		//If execute is true, it means that it was set by the yes callback
		//and so we should return true in order to not interfer with the form submission
		var result = execute;
		execute = false;
		return result;
	});
}

//---------------------------------------------------------------------
// Description : 다이얼로그 UI 구현
// Function : confirmPopup
// Date: 2009-08-14
// Author: 조 정용
// Arguments :  message             => 메세지 (string)
//              callbackYes         => callbackYes (function)
// Return : boolean
//---------------------------------------------------------------------
function confirmPopup(message, callbackYes) {


    $('#confirm').modal({
        overlay: 50,    // overlay 투명도
        close: false,
        overlayId: 'confirmModalOverlay',
        containerId: 'confirmModalContainer',
        onShow: function(dialog) {
            dialog.data.find('#message').append(message);
            
            // if the user clicks "OK"
            dialog.data.find('.modalYes').click(function() {
                // call the callback
                if ($.isFunction(callbackYes)) {
                    callbackYes.apply();
                }
                // close the dialog
                $.modal.close();
            });
            window.focus();
        }
    });	
}

// 다이얼로그 레이아웃
document.write(""
+ "<div id='confirm' style='display:none'>"
+ "	<div id='Div1'>"
+ "		<div id='Div2'></div>"
+ "		<div class='lbox' style='width:320px;'>"
+ "		<div class='lboxtl'><div class='lboxtr'></div></div>"
+ "		<div class='lboxmr'><div class='lboxml'>"
+ "     <br class='br20' />"
+ "			<div class='boxtype2' id='message'></div>"
+ "			<div class='p_t10 p_l10 a_r'>"
+ "				<span class='modalYes'>"
+ "					<span class='btnl5'><span class='btnr5'><a href='#N' id=''> 확인 </a></span></span>"
+ "				</span>&nbsp;"
+ "				<span class='modalClose'>"
+ "					<span class='btnl5'><span class='btnr5'><a href='#N' id=''> 닫기 </a></span></span>"
+ "             </span>"
+ "			</div>"
+ "		</div>"
+ "		</div><div class='lboxbl'><div class='lboxbr'></div></div>"
+ "		</div>"
+ "	</div>"
+ "</div>");

// 다이얼로그 레이아웃
document.write(""
+ "<div id='alertForm' style='display:none'>"
+ "	<div id='Div1'>"
+ "		<div id='Div2'></div>"
+ "		<div class='lbox' style='width:320px;'>"
+ "		<div class='lboxtl'><div class='lboxtr'></div></div>"
+ "		<div class='lboxmr'><div class='lboxml'>"
+ "     <br class='br20' />"
+ "			<div class='boxtype2' id='message'></div>"
+ "			<div class='p_t10 p_l10 a_r'>"
+ "				<span class='modalClose'>"
+ "					<span class='btnl5'><span class='btnr5'><a href='#N' id='confirmButton'> 확인 </a></span></span>"
+ "             </span>"
+ "			</div>"
+ "		</div>"
+ "		</div><div class='lboxbl'><div class='lboxbr'></div></div>"
+ "		</div>"
+ "	</div>"
+ "</div>");




function SetAlert(buttonId, message) {
    //Unbind click before bind
    //(This is needed when using UpdatePanels)
    $("#" + buttonId).unbind('click').click(function(e) {
        alertPopup(message);
        return false;
    });
}

function alertPopup(message) {
    $('#alertForm').modal({
        overlay: 50,    // overlay 투명도
        close: false,
        overlayId: 'confirmModalOverlay',
        containerId: 'confirmModalContainer',
        onShow: function(dialog) {
            dialog.data.find('#message').append(message);
            window.focus();
        }
    });
}



//---------------------------------------------------------------------
// Description : 화면확대 축소기능
// Function : 
// Date: 2009-09-16
// Author: 박유진
//---------------------------------------------------------------------
/*-------------------화면확대 축소기능--------------------------------*/

document.onkeypress = getKey;

function getKey(keyStroke) {
    isNetscape = (document.layers);
    eventChooser = (isNetscape) ? keyStroke.which : event.keyCode;
    which = String.fromCharCode(eventChooser).toLowerCase();
    which2 = eventChooser;

    var el = event.srcElement;

    if ((el.tagName != "INPUT") && (el.tagName != "TEXTAREA"))		//input,textarea 안에서의 +.-값은 실행안되도록
    {
        if (which == "+")
            zoomInOut('in');
        else if (which == "-")
            zoomInOut('out');
    }
}


var zoomRate = 1; 		// 확대/축소시 증감률

var maxRate = 300; 		//최대확대률

var minRate = 100; 		//최소축소률

var curRate = 100;

if (getCookie("zoomVal") != "") {
    curRate = getCookie("zoomVal");
}

if (curRate != minRate) {
    zoomInOut("curr");
}

function zoomInOut(how) {
    if (how == "in") {
        curRate = (-(-(curRate))) + (-(-(zoomRate)));
        if (curRate >= maxRate)
            curRate = maxRate;
        /* 화면 확대 */
    }
    else if (how == "out") {
        curRate = (-(-(curRate))) - (-(-(zoomRate)));
        if (curRate <= minRate)
            curRate = minRate;
        /* 화면 축소 */
    } else {
        if (curRate >= maxRate)
            curRate = maxRate;
        if (curRate <= minRate)
            curRate = minRate;
        /* 이전값 복구 */
    }

    document.body.style.zoom = curRate + '%';

    for (var i = 0; i < document.getElementsByTagName("DIV").length; i++) {
        var obj = document.getElementsByTagName("DIV").item(i);
        //debugger;
        if (obj.id == "main_contents" || obj.id == "wrap_contents" || obj.id == "ContentsBox")
            continue;

        if (obj.id == "wrap_header") {
            obj.style.zoom = minRate + "%";
        }

        obj.style.zoom = curRate + "%";
        document.body.style.zoom = curRate + "%";

    }

    SetInstantCookie("zoomVal", curRate);
}

// 쿠키값 가져오기
function getCookie(key) {
    var cook = document.cookie + ";";
    var idx = cook.indexOf(key, 0);
    var val = "";

    if (idx != -1) {
        cook = cook.substring(idx, cook.length);
        begin = cook.indexOf("=", 0) + 1;
        end = cook.indexOf(";", begin);
        val = unescape(cook.substring(begin, end));
    }

    return val;
}

function SetInstantCookie(name, value) {
    document.cookie = name + "=" + escape(value) + "; path=/;";
}
//

///////
/* 화면 확대 축소 시작 IE 전용 */
var nowZoom = 100; // 현재비율
var maxZoom = 200; // 최대비율(500으로하면 5배 커진다)
var minZoom = 100; // 최소비율


//화면 키운다.
function zoomIn() {
    if (nowZoom < maxZoom) {
        nowZoom += 2; //10: 25%씩 커진다.
    } else {
        return;
    }

    for (var i = 0; i < document.getElementsByTagName("DIV").length; i++) {
        var obj = document.getElementsByTagName("DIV").item(i);

        if (obj.id == "main_contents" || obj.id == "wrap_contents" || obj.id == "ContentsBox")
            continue;

        obj.style.zoom = nowZoom + "%";
    }

    document.body.style.zoom = nowZoom + "%";
}


//화면 줄인다.
function zoomOut() {
    if (nowZoom > minZoom) {
        nowZoom -= 2; //10: 25%씩 작아진다.
    } else {
        return;
    }

    for (var i = 0; i < document.getElementsByTagName("DIV").length; i++) {
        var obj = document.getElementsByTagName("DIV").item(i);

        if (obj.id == "main_contents" || obj.id == "wrap_contents" || obj.id == "ContentsBox")
            continue;

        obj.style.zoom = nowZoom + "%";
    }

    document.body.style.zoom = nowZoom + "%";
}

//화면 원래대로 
function zoomDefault() {
    nowZoom = 100;

    for (var i = 0; i < document.getElementsByTagName("DIV").length; i++) {
        var obj = document.getElementsByTagName("DIV").item(i);

        if (obj.id == "main_contents" || obj.id == "wrap_contents" || obj.id =="ContentsBox")
            continue;

        obj.style.zoom = nowZoom + "%";
    }
    document.body.style.zoom = nowZoom + "%";
}
//-->

/* 화면 확대 축소 끝 */


/*                                                  */
/*tabs*/
function tab_change(id, t, n, c) {
    var t = t + 1;
    for (i = 1; i < t; i++) {

        if (i == n) {
            tabImgId = document.getElementById(id + i);
            if (tabImgId != null) {
                (tabImgId.src.match(/(_on.gif)$/)) ? "" : tabImgId.src = tabImgId.src.replace(".gif", "_on.gif");
            }
            conId = document.getElementById(c + i);
            if (c != null) {
                if (conId != null) {
                    conId.style.display = "";
                }
            }
        } else {
            tabImgId = document.getElementById(id + i);
            if (tabImgId != null) {
                (tabImgId.src.match(/(_on.gif)$/)) ? tabImgId.src = tabImgId.src.replace("_on.gif", ".gif") : "";
            }

            conId = document.getElementById(c + i);
            if (c != null) {
                if (conId != null) {
                    conId.style.display = "none";
                }
            }
        }
    }
}

/*scrollMenu*/
var ns = (navigator.appName.indexOf("Netscape") != -1);
var ie = (navigator.appName.indexOf("Microsoft Internet Explorer") != -1);
var ie5 = (navigator.appVersion.indexOf("Microsoft Internet Explorer") != -1);

var d = document;
function scrollMenu(id, sy) {
    var el = document.all[id];
    var px = "px";
    window[id + "_obj"] = el;
    el.cy = el.sy = sy;
    el.sP = function(y) { this.style.top = y + px; };

    el.scrollPos = function() {
        var pY;
        pY = ns ? pageYOffset : document.documentElement && document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop;
        if (this.sy < 0)
            pY += ns ? innerHeight : document.documentElement && document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight;
        this.cy += (pY + this.sy - this.cy) / 8;
        this.sP(this.cy);
        setTimeout(this.id + "_obj.scrollPos()", 10);
    }
    return el;
}
/*gmb*/
function gmbmenu(name) {
    side1MenuImgCurr = document.getElementById("gmbmenu" + name + "_img");
    side1MenuCurr = document.getElementById("gmbmenu" + name);
    var side1Menu = new Array();
    for (var j = 1; j <= 30; j++) {
        side1MenuImg = document.getElementById("gmbmenu" + j + "_img");
        side1Menu[j] = document.getElementById("gmbmenu" + j);
        if ((side1MenuImg) && (side1MenuImg != side1MenuImgCurr)) { //현재메뉴가아닐때
            (side1MenuImg.src.match(/(_on.gif)$/)) ? side1MenuImg.src = side1MenuImg.src.replace("_on.gif", ".gif") : "";
            if (!side1Menu[j]) {

            } else {
                side1Menu[j].style.display = "none";
            }
        } else if ((side1MenuImg) && (side1MenuImg == side1MenuImgCurr)) {
            (side1MenuImg.src.match(/(_on.gif)$/)) ? "" : side1MenuImg.src = side1MenuImg.src.replace(".gif", "_on.gif");
            if (!side1Menu[j]) {

            } else {
                side1Menu[j].style.display = "block";
            }
        }
    }
}

/*1depth*/
function menu(name) {
    side1MenuCurr = document.getElementById("menus" + name);
    side2MenuCurrBox = document.getElementById("menussBox" + name);
    var side2MenuBox = new Array();
    for (var j = 1; j <= 30; j++) {
        side1Menu = document.getElementById("menus" + j);
        side1MenuImg = document.getElementById("menus" + j + "_img");
        side2MenuBox[j] = document.getElementById("menussBox" + j);
        if ((side1Menu) && (side1Menu != side1MenuCurr)) { //현재메뉴가아닐때
            side1Menu.style.zIndex = '';
            (side1MenuImg.src.match(/(_on.gif)$/)) ? side1MenuImg.src = side1MenuImg.src.replace("_on.gif", ".gif") : "";
            if (!side2MenuBox[j]) {

            } else {
                side2MenuBox[j].style.display = "none";
            }
        } else if ((side1Menu) && (side1Menu == side1MenuCurr)) {
            side1Menu.style.zIndex = '1';
            (side1MenuImg.src.match(/(_on.gif)$/)) ? "" : side1MenuImg.src = side1MenuImg.src.replace(".gif", "_on.gif");
            if (!side2MenuBox[j]) {

            } else {
                side2MenuBox[j].style.display = "block";
            }
        }
    }
}
/*2depth*/
function menus(name, num) {
    side1MenuCurr = document.getElementById(name + num);
    for (var j = 1; j <= 30; j++) {
        side1Menu = document.getElementById(name + j);
        if ((side1Menu) && (side1Menu != side1MenuCurr)) { //현재메뉴가아닐때
            (side1Menu.src.match(/(_on.png)$/)) ? side1Menu.src = side1Menu.src.replace("_on.png", ".png") : "";
        } else if ((side1Menu) && (side1Menu == side1MenuCurr)) {
            (side1Menu.src.match(/(_on.png)$/)) ? "" : side1Menu.src = side1Menu.src.replace(".png", "_on.png");
        }
    }
}



/*selectbox*/
function goUrl(url, target) {
    if (url != 0) {
        window.open(url, target);
    }
}


/*layer display*/
function layerView(layer) {
    var obj = document.getElementById(layer);
    if (!obj.style.display || obj.style.display == "none") {
        obj.style.display = "block";
    } else {
        obj.style.display = "none";
    }
}
function showDLayer(l) {
    var obj = document.getElementById(l);
    obj.style.display = "block";
    viewLayer = true;
}

function hideDLayer(l) {
    var obj = document.getElementById(l);
    obj.style.display = "none";
    viewLayer = false;
}

function setPng(obj) {
    if (navigator.appName == "Microsoft Internet Explorer") {
        var sVer = window.navigator.userAgent;
        var msie = sVer.indexOf("MSIE ");
        if (msie > 0) {
            var verNum = parseFloat(sVer.substring(msie + 5, sVer.indexOf(";", msie)));
        }
    }
    if (verNum < 7) {
        obj.width = obj.height = 1;
        obj.className = obj.className.replace(/\bpng\b/i, '');
        obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + obj.src + "',sizingMethod='image');"
        obj.src = '';
        return '';
    }
}

/*tax content show 조세재정 제도 콘텐츠 펼침 기능*/
function show(x) {
    if (document.getElementById('tax_t_' + x).style.display == "block") {
        document.getElementById('tax_t_' + x).style.display = "none";
    } else if (document.getElementById('tax_t_' + x).style.display == "none") {
        document.getElementById('tax_t_' + x).style.display = "block";
    }
}

/*
function show(x) {
    if (document.all['tax_t_' + x].style.display == "block") {
        document.all['tax_t_' + x].style.display = "none";
    } else if (document.all['tax_t_' + x].style.display == "none") {
        document.all['tax_t_' + x].style.display = "block";
    }
}
*/


/* 09.11.05수정 */

function TransformStart(){
	try{
		TransformImg("LogoPng","/images/common/header/logo.png");
		TransformImg("global_png","/images/common/search/bg.png","B");
		TransformImg("c1_bg_png","/images/common/search/input_bg.png","B");
		TransformImg("tit_search_png","/images/common/search/tit_search.png");
		TransformImg("UserLocationPng","/images/common/icon/home.png");
	}catch(e){}
	try{
		TransformImg("QuickMenu","/images/common/quick/quick_bg.png","B");
		TransformImg("QuickMenuBtn","/images/common/quick/quick_btn.png");
	}catch(e){}
}

function TransformImg(ids,imgs,kind){
	var target = document.getElementById(ids);
	if(kind != "B"){
		target.width=target.height=1;   
		target.src="/images/common/header/blank.gif";
		SizeM = "image";
	} else {
		target.style.backgroundImage = "none";
		SizeM = "crop";
	}
	target.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=" + imgs + ", sizingMethod='"+SizeM+"')";
}

var BeforePostImg;
var BeforePostBox;
function PostInfOver(num){
	var PostImg = document.getElementById("PostImg_"+num).style;
	try{var PostImgs = document.getElementById("PostImg_"+BeforePostImg).style;}catch(e){}
	
	if(PostImg.display != "block"){
		PostImg.display = "block";
		if(BeforePostImg != num){
			try{PostImgs.display = "none";}catch(e){}
		}
	} 
	BeforePostImg = num;
}
function PostInfClick(num){
	var PostBox = document.getElementById("PosInfoBox_"+num).style;
	try{var PostBoxs = document.getElementById("PosInfoBox_"+BeforePostBox).style;}catch(e){}
	
	if(PostBox.display != "block"){
		PostBox.display = "block";
		if(BeforePostBox != num){
			try{PostBoxs.display = "none";}catch(e){}
		}
	} 
	BeforePostBox = num;
}


var ZesternLiblary = {
	ChkBrowser : function(chk){
		var ChkBrw = navigator.userAgent;		
		if(chk == "opera"){
			var  Values= ChkBrw.indexOf("Opera","");
		} else if(chk == "safari"){
			var  Values= ChkBrw.indexOf("AppleWebKit/","");
		} else if(chk == "moz"){
			var  Values= ChkBrw.indexOf("Firefox","");
		} else if(chk == "ms"){
			var  Values= ChkBrw.indexOf("MSIE","");
		} else if(chk == "ms80"){
			var  Values= ChkBrw.indexOf("MSIE 8.0","");
		} else if(chk == "ms70"){
			var  Values= ChkBrw.indexOf("MSIE 7.0","");
		} else if(chk == "ms60"){
			var  Values= ChkBrw.indexOf("MSIE 6.0","");
		}
		return (Values != "-1")?true:false;
	},
	Alpha : function(target,opacitys){
		var target = document.getElementById(target);
		if (target.filters) {
			try {
				target.filters.item("DXImageTransform.Microsoft.Alpha").opacity = opacitys;
			} catch (e) {
				target.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=" + opacitys + ")";
			}
		} else {
			target.style.opacity = opacitys / 100;
		}	
	},
	currentStyle : function(obj){
		if(ZesternLiblary.ChkBrowser("ms")){		
			return obj.currentStyle;
		} else {
			if(window.getComputedStyle) {	
				return obj.ownerDocument.defaultView.getComputedStyle(obj, null); 
			}
		}
	}
}

var FontVal=0;
var RealSize;
var ZesternTextZoom = {
	Load : function(kind){
		var Types = (kind == "plus")?"+1":"-1";
		FontVal = FontVal+Types*1; 
		RealSize = Types*1;
		if(FontVal < 0 && kind != "plus"){
			FontVal = FontVal+1;
			alert("더 이상 축소 할 수 없습니다.");
			return false;
		} else if(FontVal > 5 && kind == "plus"){
			FontVal = FontVal-1;
			alert("더 이상 확대 할 수 없습니다.");
			return false;
		}
		
		this.Engine("H1");
		this.Engine("H2");
		this.Engine("H3");
		this.Engine("H4");
		this.Engine("H5");
		this.Engine("H6");
		this.Engine("LI");
		this.Engine("DT");
		this.Engine("DD");
		this.Engine("TD");
		this.Engine("A");
		this.Engine("P");
		this.Engine("SPAN");
		this.Engine("INPUT");
		this.Engine("SELECT");
		this.Engine("TEXTAREA");
		this.Engine("DIV");
		this.Engine("BODY");
	},
	Engine : function(tagName){
		var Target = document.getElementsByTagName(tagName);
		var TagLen = Target.length;
		if(TagLen > 0){
			for(var i=0; i<TagLen; i++){
				var GetSize = ZesternLiblary.currentStyle(Target[i]).fontSize;
				var GetLineHeight = ZesternLiblary.currentStyle(Target[i]).fontSize;
				if(GetSize){
					var SizeType = (GetSize.indexOf("px","") != -1)?"px":"pt";
					var Nums = GetSize.replace(SizeType,"");
					//var GetLineHeight = GetLineHeight.replace("px","");;
					try{Target[i].style.fontSize = (1*Nums+RealSize)+SizeType;}catch(e){}
					//try{Target[i].style.lineHeight = (2*GetLineHeight+RealSize)+"px";}catch(e){}
				}
			}
		}
	}
}

function scrollMenuOnOff(kind){
	var target = document.getElementById("QuickMenuBox");
	if(kind == "on"){
		target.style.display = "block";
	} else {
			target.style.display = "none";
	} 
}


//인쇄
function openPrint() {
    var url = "/popup_print.aspx";
    window.open(url, 'PRINT', 'status=no, resizable=yes, width=780, height=600, scrollbars=yes, menubar=no, toolbar=no, location=no');
}


$(function(){
    // 입력 필드에서 enter 키에 따른 검색버튼 trigger
    

    $("input[type='text'][id$='txtSearchValue']").keypress(function(e) {
        if (e.keyCode == 13)
        {
            $("input[type='image'][id$='btnSearch']").click();
            return false;
        }
    });
});

function OpenPopupMain(url, pName, width, height, left, top) {
    var pop = window.open(url, pName, 'width=' + width + ', height=' + height + ',left=' + left + ',top=' + top + ',toolbar=no, location=no, directories=no, status=no, menubar=no, resizable=no, scrollbars=no, copyhistory=no');
    if (pop != null)
        pop.focus();
}