var _layer_id;
var _frame_id;
var _result_id;
var _result_url;
var _result_position;
var _result_block;
var _result_return;
var _result_loading;
var _upload;
var _request = true;
var _hold_flag = false;
var _hold_key = new Array();
var _hold_push = new Array();
var _hold_shift = new Array();
var _hold_div = "undefined";
var _hold_this;

var AjaxObject = { 
    handleSuccess: function(o){
        if(_upload){
            _result_id = _layer_id;
            _upload = false;
        }
        if(o.responseText != "undefined"){
            _result_id.innerHTML = "<img id=ajax_"+_result_id.id+" width=0 height=0 style=display:none>"+o.responseText+"";
            if(_result_id.innerText != " " || _result_id.innerText != ""){
                YAHOO.Ybiz.idToggleDisplay(_result_id,true);
            }else{
                YAHOO.Ybiz.idToggleDisplay(_result_id,false);
            }
        }
        
        //alert(o.responseText);
        YAHOO.Ybiz.setScriptEval(_result_id);
        
        if(_result_position == "position:absolute;" && _result_id.innerText != " "){
            if(_result_block == "BLOCK"){
                var _result_idHTML = _result_id.innerHTML;
                _result_id.innerHTML = "";
                YAHOO.Ybiz.idToggleDisplay(_result_id,false);
                YAHOO.Ybiz.idToggleHtml(_result_idHTML,_result_return);
            }else{
                var childDiv = _result_id.getElementsByTagName("DIV");
                var divLength = childDiv.length;
                var maxWidth = 0;
                var maxHeight = 0;
                for(var i = 0; i < divLength; i++ ) {
                    if(typeof childDiv[i].offsetWidth != "undefined" && childDiv[i].offsetWidth > maxWidth){
                        maxWidth = childDiv[i].offsetWidth;
                    }
                    if(typeof childDiv[i].offsetHeight != "undefined" && childDiv[i].offsetHeight > maxHeight){
                        maxHeight = childDiv[i].offsetHeight;
                    }
                }
                this.setLayerPosCenter(_result_id,maxWidth,maxHeight);
                if(typeof _result_loading != "undefined"){
                    _result_loading.parentNode.removeChild(_result_loading);
                }
            }
        }else{
            YAHOO.Ybiz.setZIndex(_result_id);
            if(typeof _result_loading != "undefined"){
                _result_loading.parentNode.removeChild(_result_loading);
            }
        }
        setTimeout("viewRequestRestart()",1);
    },
    setLayerPosCenter: function(setLayerId,maxWidth,maxHeight,posBody){
        
        if(typeof posBody == "undefined" || typeof posBody == "body"){
            var sDivObj = document.body;
        }else{        
            var sDivObj = setLayerId.parentNode;
        }
        var sBlockWidth = sDivObj.offsetWidth;
        var sBlockHeight = sDivObj.offsetHeight;
        var sBlockLeft = 0;
        var sBlockTop = 0;

        if(navigator.appName == "Microsoft Internet Explorer"){
        
            var sBlockLeft = (sDivObj.parentNode.offsetWidth / 2) - (maxWidth / 2) + sDivObj.parentNode.scrollLeft;
            var sBlockTop = (sDivObj.parentNode.offsetHeight / 2) - (maxHeight / 2) + sDivObj.parentNode.scrollTop;

            if(sDivObj.scrollWidth > sDivObj.parentNode.offsetWidth){
                sBlockWidth = sDivObj.scrollWidth;
            }else{
                sBlockWidth = sDivObj.parentNode.offsetWidth;
            }
            if(sDivObj.scrollHeight > sDivObj.parentNode.offsetHeight){
                sBlockHeight = sDivObj.scrollHeight;
            }else{
                sBlockHeight = sDivObj.parentNode.offsetHeight;
            }
            if(navigator.appVersion.indexOf('MSIE 6') > 0){
                var copyDiv_parentNode = setLayerId.parentNode;
                var copyDiv_className = setLayerId.className;
                var copyDiv_id = setLayerId.getAttribute("id");
                setLayerId.setAttribute("id",copyDiv_id+"_inner_layer_");
                var copyDiv_outerHTML = setLayerId.outerHTML;
                var copyDiv_cssText = setLayerId.style.cssText;
                var copyDiv_left = setLayerId.offsetLeft;
                var copyDiv_top = setLayerId.offsetTop;
                var copyDiv_width = setLayerId.offsetWidth;
                var copyDiv_height = setLayerId.offsetHeight;
                var copyDiv_position = setLayerId.style.position;
                
                if(typeof YAHOO.Ybiz.ajax.getForm(copyDiv_id) == "undefined"){
                    YAHOO.Ybiz.ajax.getForm(setLayerId).parentNode.removeChild(setLayerId);
                    var copyDivCreate = document.createElement("div");
                        copyDivCreate.setAttribute("id",copyDiv_id);
                        copyDivCreate.className = copyDiv_className;
                        copyDivCreate.style.cssText = copyDiv_cssText;
                        copyDivCreate.style.left = copyDiv_left;
                        copyDivCreate.style.top = copyDiv_top;
                        copyDivCreate.style.width = copyDiv_width;
                        copyDivCreate.style.height = copyDiv_height;
                        copyDivCreate.style.position = copyDiv_position;
                        copyDivCreate.innerHTML = copyDiv_outerHTML+"<IFRAME id=\""+(copyDiv_id+"_iframe_")+"\" src=\"javascript:;\" FRAMEBORDER=0 SCROLLING=NO style=\"position:absolute;left:0px;top:0px;width:"+copyDiv_width+"px;height:"+copyDiv_height+"px;\"></IFRAME>";
                    copyDiv_parentNode.appendChild(copyDivCreate);
                    YAHOO.Ybiz.idToggleDisplay(copyDiv_id+"_iframe_",true);
                    YAHOO.Ybiz.idToggleDisplay(copyDiv_id+"_inner_layer_",true);
                    YAHOO.Ybiz.idToggleDisplay(copyDiv_id,true);
                    YAHOO.Ybiz.setZIndex(copyDiv_id+"_frame_");
                    YAHOO.Ybiz.setZIndex(copyDiv_id+"_inner_layer_");
                    YAHOO.Ybiz.setZIndex(copyDiv_id);
                    if(copyDiv_parentNode.tagName == "BODY"){
                        YAHOO.Ybiz.ajax.getForm(copyDiv_id).style.left = sBlockLeft+"px";
                        YAHOO.Ybiz.ajax.getForm(copyDiv_id).style.top = sBlockTop+"px";
                        YAHOO.Ybiz.ajax.getForm(copyDiv_id+"_inner_layer_").style.left = "0px";
                        YAHOO.Ybiz.ajax.getForm(copyDiv_id+"_inner_layer_").style.top = "0px";
                        setLayerId = YAHOO.Ybiz.ajax.getForm(copyDiv_id);
                    }else{
                        YAHOO.Ybiz.ajax.getForm(copyDiv_id+"_inner_layer_").style.left = "0px";
                        YAHOO.Ybiz.ajax.getForm(copyDiv_id+"_inner_layer_").style.top = "0px";
                        YAHOO.Ybiz.ajax.getForm(copyDiv_id+"_inner_layer_").style.marginLeft = "-"+YAHOO.Ybiz.ajax.getForm(copyDiv_id+"_inner_layer_").clientLeft+"px";
                        YAHOO.Ybiz.ajax.getForm(copyDiv_id+"_inner_layer_").style.marginTop = "-"+YAHOO.Ybiz.ajax.getForm(copyDiv_id+"_inner_layer_").clientTop+"px";
                        YAHOO.Ybiz.ajax.getForm(copyDiv_id+"_iframe_").style.marginLeft = "-"+YAHOO.Ybiz.ajax.getForm(copyDiv_id+"_inner_layer_").clientLeft+"px";
                        YAHOO.Ybiz.ajax.getForm(copyDiv_id+"_iframe_").style.marginTop = "-"+YAHOO.Ybiz.ajax.getForm(copyDiv_id+"_inner_layer_").clientTop+"px";
                    }
                }
            }
            
        }else{
        
            var sBlockLeft = (sDivObj.parentNode.clientWidth / 2) - (maxWidth / 2) + sDivObj.parentNode.scrollLeft;
            var sBlockTop = (sDivObj.parentNode.clientHeight / 2) - (maxHeight / 2) + sDivObj.parentNode.scrollTop;
            
            if(sDivObj.scrollWidth > sDivObj.parentNode.clientWidth){
                sBlockWidth = sDivObj.scrollWidth;
            }else{
                sBlockWidth = sDivObj.parentNode.clientWidth;
            }
            if(sDivObj.scrollHeight > sDivObj.parentNode.clientHeight){
                sBlockHeight = sDivObj.scrollHeight;
            }else{
                sBlockHeight = sDivObj.parentNode.clientHeight;
            }
            
        }
        
        if( Number(setLayerId.style.left.replace('px','')) > 0 && Number(setLayerId.style.top.replace('px','')) > 0 ){
            setLayerId.style.cssText = setLayerId.style.cssText+"position:absolute;display:block;left:"+Number(setLayerId.style.left.replace('px',''))+"px;top:"+Number(setLayerId.style.top.replace('px',''))+"px;";
        }else{
            setLayerId.style.cssText = setLayerId.style.cssText+"position:absolute;display:block;left:"+sBlockLeft+"px;top:"+sBlockTop+"px;";
        }
        YAHOO.Ybiz.setZIndex(setLayerId);
        
    },
    handleFailure: function(o){
        if(_upload){
            _result_id = _layer_id;
            _upload = false;
        }
        if(o.responseText !== undefined){
            _result_id.innerHTML = "<li>Transaction id: " + o.tId + "</li>";
            _result_id.innerHTML += "<li>HTTP status: " + o.status + "</li>";
            _result_id.innerHTML += "<li>Status code message: " + o.statusText + "</li>";
        }
        _hold_flag = false;
    },
    strLength: function(field)
    {
        var Length = 0;
        var Nav = navigator.appName;
        var Ver = navigator.appVersion;
        var IsExplorer = false;
        var ch;

        if ( (Nav == 'Microsoft Internet Explorer') && (Ver.charAt(0) >= 4) )
            IsExplorer = true;
      
        if(IsExplorer){
            for(var i = 0 ; i < field.value.length; i++){
                ch = field.value.charAt(i);

                if ((ch == "\n") || ((ch >= "ㅏ") && (ch <= "히")) || ((ch >="ㄱ") && (ch <="ㅎ"))){
                    Length += 3;
                } else {
                    Length += 1;
                }
            }
        }else {
            for(var i = 0 ; i < field.value.length; i++){
                ch = field.value.charAt(i);

                if ((ch == "\n") || ((ch >= "ㅏ") && (ch <= "히")) || ((ch >="ㄱ") && (ch <="ㅎ"))){
                    Length += 3;
                } else {
                    Length += 1;
                }
            }
        }
        
        return Length;
    }
};

var callback =
{
  success: AjaxObject.handleSuccess,
  failure: AjaxObject.handleFailure,
  upload: AjaxObject.handleSuccess,
  scope: AjaxObject
};

function viewRequestRestart(){
    _hold_key_shift = _hold_key.shift();
    _hold_shift = _hold_push.shift();
    _hold_flag = false;
    if(typeof _hold_this != "undefined"){
        _hold_this.disabled = false;
    }
    if(_hold_shift != undefined){
        _hold_div = _hold_shift[0];
        viewRequest(_hold_shift[0],_hold_shift[1],_hold_shift[2],_hold_shift[3],_hold_shift[4],_hold_shift[5]);
    }
    _hold_div = "undefined";
}
function viewRequest(sDiv,sUrl,rUrl,sForm,sLoading,sLoadingMessage,sThis,sPosition,sBlock,sReturn){
    if(_hold_flag == false){
        _hold_flag = true;
        if(typeof sThis != "undefined"){
            _hold_this = sThis;
        }
        if(typeof sPosition != "undefined" && sPosition != "" && sPosition == "absolute"){
            _result_position = "position:"+sPosition+";";
        }else{
            _result_position = "position:relative;";
        }
        if(typeof sBlock != "undefined" && sBlock != ""){
            _result_block = sBlock;
        }
        if(typeof sReturn != "undefined" && sReturn != ""){
            _result_return = sReturn;
        }
        
        if(typeof YAHOO.Ybiz.ajax.getForm(sDiv) == "undefined"){
            _result_position = "position:absolute;";
            var sDivCreate = document.createElement("div");
                sDivCreate.setAttribute("id",sDiv);
                sDivCreate.style.cssText = ""+_result_position+"display:none;width:0px;height:0px;left:-1000px;top:-1000px;";
            document.body.appendChild(sDivCreate);
        }else{
            if(YAHOO.Ybiz.ajax.getForm(sDiv).style.position == "absolute"){
                _result_position = "position:absolute;";
            }
            YAHOO.Ybiz.idToggleDisplay(sDiv,false);
        }
        _hold_div = sDiv;
        _layer_id = YAHOO.Ybiz.ajax.getForm(sDiv);
        _result_id = _layer_id;
        _result_url = sUrl;
        _frame_id = null;
        _upload = false;
        _request = true;
        var sData = postData(sDiv,sUrl,rUrl,sForm);
        if(_request == true && typeof _layer_id != 'undefined' && _layer_id != null && sDiv != "undefined"){
            if(sLoading=='true'){
                
                if(_result_position == "position:absolute;" && _result_block == "BLOCK"){
                    var div_loading_style = '';
                    div_loading_style += 'z-Index:9999;';
                    div_loading_style += 'display: block;';
                    div_loading_style += 'position: absolute;';
                    div_loading_style += 'font-size:11px;';
                    div_loading_style += 'font-family:돋움;';
                    div_loading_style += 'font-weight: bold;';
                    div_loading_style += 'padding: 5px 20px 5px 20px;';
                    //div_loading_style += 'background: white url(../../img/loading.gif) center left no-repeat;';
                    div_loading_style += 'border: 3px solid #9f9f9f;';
                    div_loading_style += 'background-color: rgb(0, 0, 0);';
                    div_loading_style += 'color: yellow;';
                    div_loading_style += 'opacity: 0.5; filter: alpha(opacity=50);';
                    div_loading_style += 'word-wrap : break-word; white-space: nowrap;';
                    
                    var sLoadingDivCreate = document.createElement("div");
                        sLoadingDivCreate.setAttribute("id","_blocking_loading_layer_");
                        sLoadingDivCreate.style.cssText = div_loading_style;
                        sLoadingDivCreate.innerHTML = sLoadingMessage+" Loading...";
                    _layer_id.parentNode.appendChild(sLoadingDivCreate);
                    _result_loading = sLoadingDivCreate;
                    
                    YAHOO.Ybiz.idToggleDisplay(_result_loading,true);
                    if(navigator.appName == "Microsoft Internet Explorer"){
                        var _result_loadingHTML = _result_loading.outerHTML;
                        var _result_width = _result_loading.offsetWidth;
                        var _result_height = _result_loading.offsetHeight;
                    }else{
                        var _result_loadingHTML = (new XMLSerializer).serializeToString(_result_loading);
                        var _result_width = _result_loading.offsetWidth;
                        var _result_height = _result_loading.offsetHeight;
                    }
                    
                    YAHOO.Ybiz.idToggleDisplay(_result_loading,false);
                    _result_loading.parentNode.removeChild(YAHOO.Ybiz.ajax.getForm(_result_loading));
                    YAHOO.Ybiz.idToggleHtml(_result_loadingHTML,_result_return,_result_width,_result_height);
                }else{
                    var div_loading_style = '';
                    div_loading_style += 'z-Index:9999;';
                    div_loading_style += 'display: block;';
                    div_loading_style += 'position: absolute;';
                    div_loading_style += 'font-size:11px;';
                    div_loading_style += 'font-family:돋움;';
                    div_loading_style += 'font-weight: bold;';
                    div_loading_style += 'padding: 5px 20px 5px 20px;';
                    //div_loading_style += 'background: white url(../../img/loading.gif) center left no-repeat;';
                    div_loading_style += 'border: 3px solid #9f9f9f;';
                    div_loading_style += 'background-color: rgb(0, 0, 0);';
                    div_loading_style += 'color: yellow;';
                    div_loading_style += 'opacity: 0.5; filter: alpha(opacity=50);';
                    div_loading_style += 'word-wrap : break-word; white-space: nowrap;';
                    
                    var sLoadingDivCreate = document.createElement("div");
                        sLoadingDivCreate.setAttribute("id","_blocking_loading_layer_");
                        sLoadingDivCreate.style.cssText = div_loading_style;
                        sLoadingDivCreate.innerHTML = sLoadingMessage+" Loading...";
                    _layer_id.parentNode.appendChild(sLoadingDivCreate);
                    _result_loading = sLoadingDivCreate;
                    YAHOO.Ybiz.idToggleDisplay(_result_loading,true);
                }
                                
                if(navigator.appName == "Microsoft Internet Explorer"){
                    if(_result_loading.parentNode.tagName == "BODY"){
                        _result_loading.style.left = window.event.clientX;
                        _result_loading.style.top = window.event.clientY;
                    }else{
                        if(window.event != null){
                            _result_loading.style.left = window.event.x;
                            _result_loading.style.top = window.event.y;
                        }
                    }
                }else{
                    _result_loading.style.left = 0;
                    _result_loading.style.top = 0;
                    //AjaxObject.setLayerPosCenter(_result_loading,_result_loading.offsetWidth,_result_loading.offsetHeight,_result_loading.parentNode);
                }
            }
            if(_upload){
                var formObject = YAHOO.Ybiz.ajax.getForm(sForm); 
                YAHOO.util.Connect.setForm(formObject, true, true); 
                var defData = 'pop=ajax';
                defData += '&ajax_div='+encodeURI(sDiv);
                defData += '&ajax_url='+encodeURI(rUrl);
                var cObj = YAHOO.util.Connect.asyncRequest('POST', sUrl, callback, sData);
            }else{
                YAHOO.util.Connect.asyncRequest('POST', sUrl, callback, sData);
            }
        }
        else{
            _upload = false;
            _hold_flag = false;
            _request = true;
            _hold_div = "undefined";
        }
    }else{
        if(sDiv == 'connection_content'){
            _hold_div = 'undefined';
        }
        if(_hold_div != sDiv && sDiv != "undefined"){
            var _hold_push_block = "";
            for(var i=0; i<_hold_key.length; i++){
                if(_hold_key[i] == sDiv ){
                    _hold_push_block = sDiv;
                }
                if(sDiv == "undefined"){
                    _hold_push_block = sDiv;
                }
            }
            if(_hold_push_block == ""){
                _hold_key.push(sDiv);
                _hold_push.push(new Array(sDiv,sUrl,rUrl,sForm,sLoading,sLoadingMessage));
            }
        }
    }
    
}

function postData(sDiv,sUrl,rUrl,sForm){
    var data = new Array();
    var k = 0;
    data[k++] = 'pop=ajax';
    data[k++] = 'ajax_div='+encodeURI(sDiv);
    data[k++] = 'ajax_url='+encodeURI(rUrl);

    if(sForm){
        var Form = YAHOO.Ybiz.ajax.getForm(sForm);
        if(typeof Form == 'object'){
            for(var i = 0; i < Form.elements.length; i++ ) {
                var FormElement = Form.elements[i];
                switch(FormElement.type.toLowerCase())
                {
                    case 'submit':
                    case 'button':
                    case 'reset':
                    case undefined:
                    case 'image': break;
                    case 'file':
                    /*
                        var frameId = 'yuiIO' + YAHOO.util.Connect._transaction_id;
                        if(navigator.appName == "Microsoft Internet Explorer"){
                            _result_id.innerHTML+= '<iframe id="' + frameId + '" name="' + frameId + '" style="background-color:gray;width:1000;height:800;display:;" />';
                        }else{
                            _result_id.innerHTML+= '<iframe id="' + frameId + '" name="' + frameId + '" style="background-color:gray;width:1000;height:800;display:;" />';
                        }
                        YAHOO.util.Connect.initHeader('Content-Type', YAHOO.util.Connect._default_form_header);
                        YAHOO.util.Connect.resetFormState();
                        YAHOO.util.Connect._isFormSubmit = true;
                        YAHOO.util.Connect._isFileUpload = true;
                        YAHOO.util.Connect._formNode = Form;
                        _frame_id = document.getElementById(frameId);
                        _frame_id.style.position = 'absolute';
                        _frame_id.style.top = '1px';
                        _frame_id.style.left = '1px';
                        _result_id = _frame_id;
                        document.body.appendChild(_frame_id);
                     */
                        _upload = true;
                        break;
                    default :
                        if(FormElement.getAttribute('isNotNull') == 'true'){
                            if(FormElement.value.split('').join('') == ''){
                                _request = false;
                                if(FormElement.getAttribute('title') != 'undefined' && FormElement.getAttribute('title') != ''){
                                    var form_msg = '[ '+FormElement.getAttribute('title')+' ]는 필수 항목 입니다.\n\n확인해주세요.';
                                }else{
                                    var form_msg = "필수 항목 값이 비어 있습니다.\n\n확인해주세요.";
                                }
                                
                                var FormElementNname = (FormElement.name) ? FormElement.name : FormElement.id ;
                                
                                if(FormElement.type.toLowerCase() == "hidden"){
                                    YAHOO.Ybiz.idToggleAlert(form_msg);
                                }else{
                                    var form_return = "parent.document."+FormElement.form.name+"."+FormElementNname+".focus();";
                                    YAHOO.Ybiz.idToggleAlert(form_msg,form_return);
                                }
                                
                                //alert(form_msg+'는 필수 항목 입니다.\n확인해주세요.');
                                if(typeof _hold_this != "undefined"){
                                    _hold_this.disabled = false;
                                }
                                YAHOO.Ybiz.idToggleDisplay(_result_id,true);
                                //_result_id.innerHTML = '';
                                return;
                            }
                        }
                        if(typeof FormElement.getAttribute('maxlength') == 'number'){
                            if(Number(FormElement.getAttribute('maxlength')) < Number(AjaxObject.strLength(FormElement))){
                                _request = false;
                                if(FormElement.getAttribute('title') != 'undefined'){
                                    var form_msg = '[ '+FormElement.getAttribute('title')+' ] 길이가 너무 큽니다.\n\n확인해주세요.';
                                }else{
                                    var form_msg = "길이가 너무 큽니다.\n\n확인해주세요.";
                                }
                                
                                var FormElementNname = (FormElement.name) ? FormElement.name : FormElement.id ;
                                
                                if(FormElement.type.toLowerCase() == "hidden"){
                                    YAHOO.Ybiz.idToggleAlert(form_msg);
                                }else{
                                    var form_return = "parent.document."+FormElement.form.name+"."+FormElementNname+".focus();";
                                    YAHOO.Ybiz.idToggleAlert(form_msg,form_return);
                                }
                                    
                                //alert(form_msg+' 길이가 너무 큽니다.\n확인해주세요.');
                                if(typeof _hold_this != "undefined"){
                                    _hold_this.disabled = false;
                                }
                                YAHOO.Ybiz.idToggleDisplay(_result_id,true);
                                //_result_id.innerHTML = '';
                                return;
                            }
                        }
                        break;
                }
            }
            if(!_upload){
                for(var i = 0; i < Form.elements.length; i++ ) {
                    var FormElement = Form.elements[i];
                    switch(FormElement.type.toLowerCase())
                    {
                        case 'submit':
                        case 'button':
                        case 'reset':
                        case undefined:
                        case 'image':
                        case 'file': break;
                        case 'radio':  
                        case 'checkbox':  
                            if(FormElement.checked == true){
                                data[k++] = encodeURIComponent(FormElement.name)+'='+encodeURIComponent(FormElement.value);
                            }
                            break;
                        default : 
                            data[k++] = encodeURIComponent(FormElement.name)+'='+encodeURIComponent(FormElement.value);
                            break;
                    }
                }
            }
        }
    }
    return(data.join('&'));
}


var ajaxTimeoutID;
var ajaxTime = 100;
var ajaxInput;
var ajaxForm;
var ajaxDiv;
var ajaxUrl;

function ajaxAlt(gThis,gDiv,gUrl){
    if(ajaxDiv == '[object]'){
        ajaxAltDisplay(false);
    }
    ajaxInput = gThis;
    ajaxDiv = document.getElementById(gDiv);
    ajaxForm = gThis.form.name;
    ajaxUrl = gUrl;
    ajaxAltStyle();
    window.clearTimeout(ajaxTimeoutID);
    var gInputIndexOf = encodeURI(ajaxInput.value).indexOf("%");
    if(gInputIndexOf == -1){
        ajaxTimeoutID = window.setTimeout('ajaxRequest("'+ajaxInput.value+'")', ajaxTime);                  
    }
}
function ajaxRequest(gStr){
    if(gStr.split(' ').join('').length > 0)
        viewRequest(ajaxDiv.id, ajaxUrl+gStr, '', ajaxForm);
    else
        ajaxAltDisplay(false);
    window.clearTimeout(ajaxTimeoutID);
}
function ajaxAltStyle(){
    ajaxDiv.style.display = 'none';
    ajaxDiv.style.position = 'absolute';
    ajaxDiv.style.zIndex = '1';
    ajaxDiv.style.marginTop = '15px';
    ajaxDiv.style.padding = '3px 5px 3px 5px';
    ajaxDiv.style.border = '2px dotted #9f4fcf';
    ajaxDiv.style.backgroundColor = '#f9f0ff';
}    
function ajaxAltDisplay(flag){
    if(flag)
        ajaxDiv.style.display = 'block';
    else                    
        ajaxDiv.style.display = 'none';
}
function ajaxAltClick(gStr){
    ajaxInput.value = gStr;
}
function ajaxAltAdd(gStr){
    ajaxInput.value+= gStr;
}
function ajaxAltReset(){
    ajaxInput.value = '';
}

function ajaxGeneral(sUrl, sForm){
	var sData = postDataGeneral(sForm);
	YAHOO.util.Connect.asyncRequest('POST', sUrl, callbackResult, sData);
}

function postDataGeneral(sForm){
	var Form = YAHOO.Ybiz.ajax.getForm(sForm);
	var data = new Array();
	var k = 0;
	if(Form != undefined){	
		for(var i = 0; i < Form.elements.length; i++ ) {
	        var FormElement = Form.elements[i];
	        switch(FormElement.type.toLowerCase())
	        {
	            case 'submit':
	            case 'button':
	            case 'reset':
	            case undefined:
	            case 'image':
	            case 'file': break;
	            case 'radio':  
	            case 'checkbox':  
	                if(FormElement.checked == true){
	                    data[k++] = encodeURIComponent(FormElement.name)+'='+encodeURIComponent(FormElement.value);
	                }
	                break;
	            default : 
	                data[k++] = encodeURIComponent(FormElement.name)+'='+encodeURIComponent(FormElement.value);
	                break;
	        }
	    }
	    //alert(data.join('&'));
	    return(data.join('&'));
	}
	else{
		return null;
	}	    
}

var callbackResult = { 
    handleSuccess: function(o){	    

    },    
    handleFailure: function(o){
       
    }
};

var callbackGeneral =
{
  success: callbackResult.handleSuccess,
  failure: callbackResult.handleFailure,
  upload: callbackResult.handleSuccess,
  scope: callbackResult
};

var ad_regno = '';
var ajaxtype = ''; //define as ajax return type.

function ajaxGeneral2(sUrl, sForm, sRegno, sAjaxtype){
	ad_regno = sRegno;
	ajaxtype = sAjaxtype;
	var sData = postDataGeneral(sForm);
	YAHOO.util.Connect.asyncRequest('POST', sUrl, callbackGeneral2, sData);
}

var callbackResult2 = { 
    handleSuccess: function(o){	    
		if(ajaxtype == "getxml"){
			//alert(o.responseText);
			getLeafletSlideXml(o.responseXML);
		}
    },    
    handleFailure: function(o){}
};

var callbackGeneral2 =
{
  success: callbackResult2.handleSuccess,
  failure: callbackResult2.handleFailure,
  upload: callbackResult2.handleSuccess,
  scope: callbackResult2
};

YAHOO.Ybiz.bizSlide = YAHOO.Ybiz.bizSlide || {
	slideimg_obj : [],
	slideimgthumb_obj : [],
	v_desc : '',
	v_regno : '',
	v_addr : '',
	v_telnum : '',
	v_title : '',
	v_url : '',
	dragapproved : false,
	resizedragapproved : true,
	target_img : null,
	img_posx : 0,
	img_posy : 0,
	lat : 0,
	lon : 0
}


var topgap = 0, bottomgap = 0, leftgap = 0, rightgap = 0;
var vecx = 0, vecy = 0;
var img_count = 0;
var isLargeSize = false;

function getLeafletSlideXml(tmpXml){
	var root = tmpXml.documentElement;
	var nds1, nds2, nds3;
	var img_array = {}; 
	//dapth1 start
	if(root.hasChildNodes()){
		nds1 = root.childNodes; //AdsGugipremium node
		//alert('1');
		for(var a = 0 ; a < nds1.length ; a++){
			if(nds1[a].hasChildNodes() && nds1[a].nodeName == "AdsGugipremium"){					
				//dapth2 start
				if(nds1[a].hasChildNodes()){
					nds2 = nds1[a].childNodes; //product node
					for(var b = 0 ; b < nds2.length ; b++){							
						//dapth3 start
						if(nds2[b].hasChildNodes()){
							nds3 = nds2[b].childNodes; //property node
							for(var c = 0 ; c < nds3.length ; c++){
								try{
									if(nds3[c].nodeName.indexOf("image") >= 0){
										if(nds3[c].firstChild.nodeValue != ""){
											YAHOO.Ybiz.bizSlide.slideimg_obj[img_count] = new Image();
	
											YAHOO.Ybiz.bizSlide.slideimgthumb_obj[img_count] = new Image();
											YAHOO.Ybiz.bizSlide.slideimgthumb_obj[img_count].src = nds3[c].firstChild.nodeValue;
											YAHOO.Ybiz.bizSlide.slideimg_obj[img_count].src = nds3[c].firstChild.nodeValue.replace("_thumb","");
											img_count++;
										}
										
									}									
									if(nds3[c].nodeName.indexOf("description") >= 0){
										YAHOO.Ybiz.bizSlide.v_desc = nds3[c].firstChild.nodeValue;
									}
									if(nds3[c].nodeName.indexOf("addr") >= 0){
										YAHOO.Ybiz.bizSlide.v_addr = nds3[c].firstChild.nodeValue;
									}
									if(nds3[c].nodeName.indexOf("telnum") >= 0){
										YAHOO.Ybiz.bizSlide.v_telnum = "("+nds3[c].firstChild.nodeValue+")";
									}
									if(nds3[c].nodeName.indexOf("cname") >= 0){
										YAHOO.Ybiz.bizSlide.v_title = nds3[c].firstChild.nodeValue;
									}
									if(nds3[c].nodeName.indexOf("url") >= 0){
										YAHOO.Ybiz.bizSlide.v_url = nds3[c].firstChild.nodeValue;
									}
									if(nds3[c].nodeName.indexOf("regno") >= 0){
										YAHOO.Ybiz.bizSlide.v_regno = nds3[c].firstChild.nodeValue;
									}
									if(nds3[c].nodeName.indexOf("wgsx") >= 0){
										YAHOO.Ybiz.bizSlide.lon = nds3[c].firstChild.nodeValue;
									}
									if(nds3[c].nodeName.indexOf("wgsy") >= 0){
										YAHOO.Ybiz.bizSlide.lat = nds3[c].firstChild.nodeValue;
									}
								}
								catch(e){}
							}
						}
						//dapth3 end
					}
				}
				//dapth2 end
			}
		}
	}
	if(img_count <= 0){
		alert('No Data');
		self.close();
		return;
	}
	else{
		var img_list = new Array();
		var img_atag = new Array();
		for(var x = 0; x < img_count ; x++){
			
			img_list[x] = document.getElementById("th_img_0"+x);			
			//img_list[x].innerHTML = "<a href=\"#\" id=\"img_atag"+x+"\"><img src=\""+YAHOO.Ybiz.bizSlide.slideimgthumb_obj[x].src+"\" /></a>";
			img_list[x].innerHTML = "<img id=\"img_atag"+x+"\" src=\""+YAHOO.Ybiz.bizSlide.slideimgthumb_obj[x].src+"\" />";
			
			img_atag[x] = document.getElementById("img_atag"+x);			
			if(navigator.appName == "Microsoft Internet Explorer"){
				//img_atag[x].attachEvent("onclick", new Function("ex.changeLayer('"+x+"'); viewMainImage('"+x+"'); return false;"));
				img_atag[x].attachEvent("onclick", new Function("ex.changeLayer('"+x+"'); return false;"));
			}
			else{
				//img_atag[x].addEventListener("click", new Function("ex.changeLayer('"+x+"');  viewMainImage('"+x+"'); return false;"), false);
				img_atag[x].addEventListener("click", new Function("ex.changeLayer('"+x+"'); return false;"), false);
			}
			
			document.getElementById("photoimg"+x).src = YAHOO.Ybiz.bizSlide.slideimg_obj[x].src;
			
		}
		document.getElementById("addr_div").innerHTML = "<em id=\"newsTime\">"+YAHOO.Ybiz.bizSlide.v_addr+" "+YAHOO.Ybiz.bizSlide.v_telnum+"</em>";
		//document.getElementById("desc_div").innerHTML = YAHOO.Ybiz.bizSlide.v_desc;
		document.getElementById("desc_div").innerHTML = YAHOO.Ybiz.bizSlide.v_desc;
		document.getElementById("title_div").innerHTML = "<a onclick=\"YAHOO.Ybiz.formInit.openerRedirect('"+YAHOO.Ybiz.bizSlide.v_url+"'); return false;\" style=\"cursor:pointer\" tooltip=\"linkalert-tip\">"+YAHOO.Ybiz.bizSlide.v_title+"</a>";
		document.getElementById("home_div").innerHTML = "<a class=\"more\" onclick=\"YAHOO.Ybiz.formInit.openerRedirect('"+YAHOO.Ybiz.bizSlide.v_url+"'); return false;\" style=\"cursor:pointer\" title=\"홈페이지 보기\">홈페이지 보기</a>";

		if(YAHOO.Ybiz.bizSlide.lon != "" && YAHOO.Ybiz.bizSlide.lat != ""){
			//document.getElementById("map_div").innerHTML = "<a class=\"more_map\" onclick=\"YAHOO.Ybiz.formInit.openerRedirect('"+YAHOO.Ybiz.bizSlide.v_url+"'); return false;\" style=\"cursor:pointer\" title=\"지도 보기\">지도 보기</a>";
			//YAHOO.Ybiz.bizSlide.lon = 0; YAHOO.Ybiz.bizSlide.lat = 0;
			document.getElementById("map_div").innerHTML = "<img onclick=\"viewMap(); return false;\" class=\"moremap\" src=\"http://l.yimg.com/ne/business/leaflet/2009/icon_map.gif\" style=\"position:absolute;top:6px;right:109px;width:66px;height:20px;padding:0 0 0 11px;cursor:pointer\" title=\"지도 보기\">";
			document.getElementById("map_div").style.display = "block";
		}
		//<img src="http://l.yimg.com/go/bizcenter/biz_image//ad_info/2010/01/11/d41d8cd98f00b204e9800998ecf8427e_image3_1263174129_thumb.JPG">
		
		//document.getElementById("photoimg0").parentNode.parentNode.style.display = "block";
		viewMainImage(0);
	}
	//alert(document.body.outerHTML);
}
var isInit = false;
function viewMainImage(id){
	document.getElementById("photoimg"+id).parentNode.parentNode.parentNode.style.display = "block";
	document.getElementById("mapimg").style.visibility = "hidden";
	if(navigator.appName == "Microsoft Internet Explorer"){
		document.getElementById("gapdiv").style.paddingTop = 0;
	}
	else{
		document.getElementById("gapdiv").style.paddingTop = 10000+"px";
	}	
	
//	alert(document.getElementById("mapimg").style.visibility);
	
	var photoimg = document.getElementById("photoimg"+id);
	//YAHOO.Ybiz.formInit.getForm("img_url").value = YAHOO.Ybiz.bizSlide.slideimg_obj[id].src;
	document.form1.img_url.value = YAHOO.Ybiz.bizSlide.slideimg_obj[id].src;
	document.form1.mainimg_idx.value = id;
	
	calGap(id);	
	
	if(navigator.appName == "Microsoft Internet Explorer"){
		photoimg.style.paddingTop = 0;
		photoimg.style.pixelLeft = 0;
		photoimg.style.pixelTop = 0;
		
		
	}
	else{
		photoimg.style.paddingTop = 0 + "px";
		photoimg.style.left = 0+"px";
		photoimg.style.top = 35+"px";		
		tempX = 0;
		tempY = 0;
		
		
		//document.getElementById("photoimg"+id).parentNode.parentNode.style.display = "block";
		//photoimg.parentNode.parentNode.style.display = "block";
		
		
	}
	resizeSmallImage();
	isInit = true;
	
	//document.getElementById("mapimg").style.display = "none";
}

function initMainImage(){
	//if(navigator.appName == "Microsoft Internet Explorer"){
		var photoimg = new Image();  
		photoimg.src = YAHOO.Ybiz.bizSlide.slideimg_obj[0].src;
		if(photoimg.width >= 600 || photoimg.height >= 550){
	//		alert(photoimg.width +" : "+ photoimg.height);
			returnArray = resizeImage(photoimg.width, photoimg.height);
			photoimg.width = returnArray[0];
			photoimg.height = returnArray[1];	
	//		alert(photoimg.width +" : "+ photoimg.height);
			
		}
		document.getElementById("photoimg0").src = photoimg.src;
		document.getElementById("photoimg0").width = photoimg.width;
		document.getElementById("photoimg0").height = photoimg.height;
	//	alert(document.getElementById("photoimg0").src);
		if((photoimg.height < 550)){
			if(navigator.appName != "Microsoft Internet Explorer"){
				document.getElementById("photoimg0").style.paddingTop = Math.round((515/2) - (photoimg.height/2)) + "px";
				//alert(photoimg.style.paddingTop);
			}
		}
		document.getElementById("photoimg0").parentNode.parentNode.style.display = "block";
	//}
}

function calGap(id){
	if(navigator.appName == "Microsoft Internet Explorer"){
//		rightgap = Math.round((YAHOO.Ybiz.bizSlide.slideimg_obj[id].width - 600));
//		bottomgap = Math.round((YAHOO.Ybiz.bizSlide.slideimg_obj[id].height - 550) / 2);
//		topgap = Math.round((YAHOO.Ybiz.bizSlide.slideimg_obj[id].height - 550) / 2) + 40;
		
		//사이즈 조정 width : 600 -> 660, height : 550 -> 585 by luna
		rightgap = Math.round((YAHOO.Ybiz.bizSlide.slideimg_obj[id].width - 660));
		bottomgap = Math.round((YAHOO.Ybiz.bizSlide.slideimg_obj[id].height - 585) / 2);
		topgap = Math.round((YAHOO.Ybiz.bizSlide.slideimg_obj[id].height - 585) / 2) + 37;
	}
	else{
		rightgap = Math.round((YAHOO.Ybiz.bizSlide.slideimg_obj[id].width - 660));
		topgap = 35;
		bottomgap = Math.round((YAHOO.Ybiz.bizSlide.slideimg_obj[id].height - 585));
	}
}

function resizeLargeImage(){
	var temp = null;
	var photoimg = null;
	for(var x = 0; x < img_count ; x++){
		photoimg = document.getElementById("photoimg"+x);
		if(x == document.form1.mainimg_idx.value){
			photoimg.width = YAHOO.Ybiz.bizSlide.slideimg_obj[x].width;
			photoimg.height = YAHOO.Ybiz.bizSlide.slideimg_obj[x].height;
			if(navigator.appName == "Microsoft Internet Explorer"){
				photoimg.style.paddingTop = 0;
				photoimg.style.pixelLeft = 0;
				photoimg.style.pixelTop = 0;
			}
			else{
				photoimg.style.paddingTop = 0 + "px";
				photoimg.style.left = 0 + "px";
				photoimg.style.top = 35 + "px";
				tempX = 0;
				tempY = 0;
			}
			YAHOO.Ybiz.bizSlide.resizedragapproved = true;
			
			if((photoimg.height < 550)){
				if(navigator.appName == "Microsoft Internet Explorer"){
					
				}
				else{
					photoimg.style.paddingTop = Math.round((515/2) - (photoimg.height/2)) + "px";
				}
			}
			photoimg.setAttribute("alt", "더블클릭하면 최적화 사이즈로 볼 수 있습니다.\n마우스 드래그를 통해  이미지를 이동할 수 있습니다.");
			isLargeSize = true;
		}
	}
	

}

function resizeSmallImage(){
	var temp = null;
	var reduceW = 0, reduceH = 0;
	var photoimg = null;
	var imgratio = 0;
	var returnArray = new Array();
	
	for(var x = 0; x < img_count ; x++){
		 photoimg = document.getElementById("photoimg"+x);
		 if(x == document.form1.mainimg_idx.value){
			//alert("width = " +" : "+ photoimg.width+" height : "+photoimg.height);
			//alert('here');
			if(photoimg.width >= 600 || photoimg.height >= 550){
				//alert('here1');
				returnArray = resizeImage(photoimg.width, photoimg.height);
				photoimg.width = returnArray[0];
				photoimg.height = returnArray[1];
//				reduceW = photoimg.width;
//				reduceH = photoimg.height;
//				if(reduceW >= reduceH){
//					imgratio = reduceH/reduceW;
//					while(reduceW >= 600){
//						reduceW = reduceW - 10;
//					}
//					
//					photoimg.width = reduceW;
//					photoimg.height = Math.round(reduceW * imgratio);					
//				}
//				else{
//					imgratio = reduceW/reduceH;
//					//아래 top 35 밀어내므로 550보다 더 낮게 줄인다.
//					while(reduceH >= 515){
//						reduceH = reduceH - 10;
//					}
//					
//					photoimg.width = Math.round(reduceH * imgratio);
//					photoimg.height = reduceH;
//				}
				
				if(navigator.appName == "Microsoft Internet Explorer"){
					photoimg.style.pixelLeft = 0;
					photoimg.style.pixelTop = 0;
				}
				else{
					photoimg.style.left = 0 + "px";
					photoimg.style.top = 35 + "px";
				}
			}
			YAHOO.Ybiz.bizSlide.resizedragapproved = false;
			if((photoimg.height < 550)){
				if(navigator.appName == "Microsoft Internet Explorer"){
					
				}
				else{
					photoimg.style.paddingTop = Math.round((515/2) - (photoimg.height/2)) + "px";
				}
			}
			photoimg.setAttribute("alt", "더블클릭하면 원본 사이즈로 볼 수 있습니다.");
			isLargeSize = false;
		}
	}
}

function resizeImage(w, h){
	var reduceW = 0, reduceH = 0;
	var imgratio = 0;
	var returnArray = new Array();
	
	reduceW = w;
	reduceH = h;
	if(reduceW >= reduceH){
		imgratio = reduceH/reduceW;
		while(reduceW >= 600){
			reduceW = reduceW - 10;
		}
		
//		photoimg.width = reduceW;
//		photoimg.height = Math.round(reduceW * imgratio);
		returnArray[0] = reduceW;
		returnArray[1] = Math.round(reduceW * imgratio);
	}
	else{
		imgratio = reduceW/reduceH;
		//아래 top 35 밀어내므로 550보다 더 낮게 줄인다.
		while(reduceH >= 515){
			reduceH = reduceH - 10;
		}
		
//		photoimg.width = Math.round(reduceH * imgratio);
//		photoimg.height = reduceH;
		returnArray[0] = Math.round(reduceH * imgratio);
		returnArray[1] = reduceH;
	}
	return returnArray;
}

var temp1, temp2, tempX = 0, tempY = 0;
if(navigator.appName == "Microsoft Internet Explorer"){
	var currentX = 0, correntY = 0;
}
else{
	var currentX = 0, correntY = 35;
}

function imgmove(e){
	if(!e) var e = e || window.event;
	if (e.preventDefault) { 
        e.preventDefault();  //ff 
    } else { 
        e.returnValue = false;  //ie 
    }
	
	//alert(correntY);
	vecx = e.clientX - YAHOO.Ybiz.bizSlide.img_posx;
	vecy = e.clientY - YAHOO.Ybiz.bizSlide.img_posy;
	
	currentX = temp1 + e.clientX - YAHOO.Ybiz.bizSlide.img_posx;
	currentY = temp2 + e.clientY - YAHOO.Ybiz.bizSlide.img_posy;	
	
	//alert(currentY);
	
	if(navigator.appName == "Microsoft Internet Explorer"){
		if (e.button == 1 && YAHOO.Ybiz.bizSlide.dragapproved && YAHOO.Ybiz.bizSlide.resizedragapproved){		
			
			if(currentX > 0 || currentX < (rightgap * -1)){
				
			}
			else{
				YAHOO.Ybiz.bizSlide.target_img.style.pixelLeft = currentX;
			}
			
			if(currentY > topgap){
				
			}
			else if(currentY < (bottomgap * -1)){
				currentY = bottomgap * -1;
			}
			else{
				YAHOO.Ybiz.bizSlide.target_img.style.pixelTop = currentY;	
			}
			
			return false;
			
		}
	}
	else{
		if (YAHOO.Ybiz.bizSlide.dragapproved && YAHOO.Ybiz.bizSlide.resizedragapproved){
			
			//alert(YAHOO.Ybiz.bizSlide.target_img.style.top + " : " +YAHOO.Ybiz.bizSlide.target_img.style.left);
			
			if(currentX > 0){
				currentX = 0;
			}
			else if(currentX < ((rightgap) * -1)){
				currentX = rightgap * -1;	
			}
			else{
				YAHOO.Ybiz.bizSlide.target_img.style.left = currentX + "px";
			}
			
			if(currentY > topgap){
				currentY = topgap;
			}
			else if(currentY < (bottomgap * -1)){
				currentY = bottomgap * -1;
			}
			else{
				YAHOO.Ybiz.bizSlide.target_img.style.top = currentY + "px";
			}
			
			tempX = parseInt(currentX);
			tempY = parseInt(currentY);

			return false;
		}
	}	
}
function imgdrags(e){	
	//if (!document.all) return;
	if(!e) var e = e || window.event;	
	if (e.preventDefault) { 
        e.preventDefault();  //ff 
    } else { 
        e.returnValue = false;  //ie 
    }	
	
	if(navigator.appName == "Microsoft Internet Explorer"){
		if (e.srcElement.className == "drag"){
			YAHOO.Ybiz.bizSlide.dragapproved = true;
			YAHOO.Ybiz.bizSlide.target_img = e.srcElement;
			temp1 = YAHOO.Ybiz.bizSlide.target_img.style.pixelLeft;
			temp2 = YAHOO.Ybiz.bizSlide.target_img.style.pixelTop;
			YAHOO.Ybiz.bizSlide.img_posx = e.clientX;
			YAHOO.Ybiz.bizSlide.img_posy = e.clientY;
			document.onmousemove=imgmove;			
		}
	}
	else{
		if(e.target.getAttribute("class") == "drag"){
			YAHOO.Ybiz.bizSlide.dragapproved = true;
			YAHOO.Ybiz.bizSlide.target_img = e.target;			
			if(!tempX) tempX = 0;
			if(!tempY) tempY = 35;
			temp1 = tempX;
			temp2 = tempY;
			YAHOO.Ybiz.bizSlide.img_posx = e.clientX;
			YAHOO.Ybiz.bizSlide.img_posy = e.clientY;
			document.onmousemove=imgmove;	
		}
	}	
}

function imgDbClickResize(e){
	if(!e) var e = e || window.event;	
	if (e.preventDefault) { 
        e.preventDefault();  //ff 
    } else { 
        e.returnValue = false;  //ie 
    }	
	if(navigator.appName == "Microsoft Internet Explorer"){
		if (e.srcElement.className == "drag"){
			if(isLargeSize == false) {
				resizeLargeImage();
			}
			else{
				resizeSmallImage();	
			}
		}
	}
	else{
		if(e.target.getAttribute("class") == "drag"){
			if(isLargeSize == false) {
				resizeLargeImage();
			}
			else{
				resizeSmallImage();	
			}
		}
	}	
}

function setDragApprove(e){
	if(!e) var e = e || window.event;	
	if (e.preventDefault) { 
        e.preventDefault();  //ff 
    } else { 
        e.returnValue = false;  //ie 
    }
	vecx = 0, vecy = 0;
	YAHOO.Ybiz.bizSlide.dragapproved=false;
}
var map = null;
function viewMap(){
	// Create a map object
	if(map == null){
		map = new YMap(document.getElementById('mapimg'));
	}	
	//	for(var xxx in map){
	//		alert(xxx);
	//	}

	// Add map type control
	//map.addTypeControl();

	// Add map zoom (long) control
	//map.addZoomLong();
	map.addZoomShort();

	// Add the Pan Control
	//map.addPanControl();

	// Set map type to either of: YAHOO_MAP_SAT, YAHOO_MAP_HYB, YAHOO_MAP_REG
	map.setMapType(YAHOO_MAP_REG);
	// Display the map centered on a geocoded location
	var currentGeoPoint = new YGeoPoint( YAHOO.Ybiz.bizSlide.lat, YAHOO.Ybiz.bizSlide.lon );

	//map.drawZoomAndCenter(encodeURIComponent("서울"), 7);
	map.drawZoomAndCenter(currentGeoPoint, 1);
	var marker = new YMarker(currentGeoPoint);
	map.addOverlay(marker);

	//새이미지 생성
	var new_image = new YImage();
	new_image.src = 'https://kr.sec.yimg.com/local/2007/pin.gif';

	marker.changeImage(new_image);
	marker.closeSmartWindow();
	
	var idx = document.form1.mainimg_idx.value;
	
	document.getElementById("photoimg"+idx).parentNode.parentNode.parentNode.style.display = "none";
	document.getElementById("mapimg").style.visibility = "visible";
	if(navigator.appName == "Microsoft Internet Explorer"){
		document.getElementById("gapdiv").style.paddingTop = 38;
	}
	else{
		document.getElementById("gapdiv").style.paddingTop = 38+"px";
	}
	
	//기존 이미지
	//map.addMarker(currentGeoPoint);
	
	ysixe = new YSize(660,535);
	map.resizeTo(ysixe);
	
}