﻿ //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Open Window
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function MoveWindowToCenter(w_width,w_height)
{
	var xpos = ( screen.width -  w_width  ) / 2;
	var ypos = ( screen.height - w_height )  / 2;
	
	var brVer   = navigator.userAgent;//브라우져 정보
    var brVerId = brVer.indexOf('MSIE');//브라우져 정보에서 'MSIE'라는 부분의 문자열
    
    brNum   = brVer.substr(brVerId,8);//브라우져 버전('MSIE' 포함..)..
    brNum2  = brNum.substr(5,3)//브라우져 버번. 숫자만..
    
    if(brNum2 > 6.0)
    {
        w_height = w_height - 50;
    }
    
	window.moveTo(xpos, ypos);
	window.focus();
}
function OpenWindow(target1,w_width,w_height)	
{
	var xpos = ( screen.width -  w_width  ) / 2;
	var ypos = ( screen.height - w_height )  / 2;
	
    var brVer   = navigator.userAgent;//브라우져 정보
    var brVerId = brVer.indexOf('MSIE');//브라우져 정보에서 'MSIE'라는 부분의 문자열
    
    brNum   = brVer.substr(brVerId,8);//브라우져 버전('MSIE' 포함..)..
    brNum2  = brNum.substr(5,3)//브라우져 버번. 숫자만..
    
    if(brNum2 > 6.0)
    {
        w_height = w_height - 50;
    }
    
	popWindow=window.open(target1,'popWindow','toolbar=no,status=no,top='+ ypos +',left='+ xpos +',width=' + w_width + ',height=' + w_height +',directories=no,scrollbars=no,location=no,resizable=no,border=0,menubar=no');
	popWindow.focus();
}

function OpenWindowShadow(target1,w_width,w_height)		
{
	var xpos = 10000;
	var ypos = 10000;
	
	var brVer   = navigator.userAgent;//브라우져 정보
    var brVerId = brVer.indexOf('MSIE');//브라우져 정보에서 'MSIE'라는 부분의 문자열
    
    brNum   = brVer.substr(brVerId,8);//브라우져 버전('MSIE' 포함..)..
    brNum2  = brNum.substr(5,3)//브라우져 버번. 숫자만..
    
    if(brNum2 > 6.0)
    {
        w_height = w_height - 50;
    }
	
	shWindow=window.open(target1,'shWindow','toolbar=no,status=no,top='+ ypos +',left='+ xpos +',width=' + w_width + ',height=' + w_height +',directories=no,scrollbars=no,location=no,resizable=no,border=0,menubar=no');
	shWindow.focus();
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Open Modal Window
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function OpenModalWindow(target1,w_width,w_height)	
{
    var xPos,yPos; 
	
    var xPos = (screen.width-w_width)/2;
	var yPos = (screen.height-w_height)/2;
    
    var brVer   = navigator.userAgent;//브라우져 정보
    var brVerId = brVer.indexOf('MSIE');//브라우져 정보에서 'MSIE'라는 부분의 문자열
    
    brNum   = brVer.substr(brVerId,8);//브라우져 버전('MSIE' 포함..)..
    brNum2  = brNum.substr(5,3)//브라우져 버번. 숫자만..
    
    if(brNum2 > 6.0)
    {
        w_height = w_height - 50;
    }

    var param = "dialogWidth:"+w_width+"px; dialogHeight:"+w_height+"px; dialogLeft:"+ xPos +"px; dialogTop:"+ yPos +"px; toolbar:no;status:no;help:no;directories:no;location:no;scrollbars:no";
	
	vReturnValue = window.showModalDialog(target1 , window, param);
	
	return vReturnValue;

    //--------------------------------------------------------------------------------------------------------------------	
    //	var xpos = ( screen.width -  w_width  ) / 2;
    //	var ypos = ( screen.height - w_height )  / 2;

    //	vReturnValue = window.showModalDialog(target1 ,'toolbar=no,status=no,directories=no,scrollbars=no,location=no,resizable=no,border=0,menubar=no' , "dialogHeight: " + w_height + "px; dialogWidth:" + w_width + "dialogLeft:" + xpos + "dialogLeft:" + ypos);
    //	
    //	return vReturnValue;
    //--------------------------------------------------------------------------------------------------------------------
}
function OpenModalWindow2(target1,w_width,w_height)	
{
	var xpos = ( screen.width -  w_width  ) / 2;
	var ypos = ( screen.height - w_height )  / 2;
	
	var brVer   = navigator.userAgent;//브라우져 정보
    var brVerId = brVer.indexOf('MSIE');//브라우져 정보에서 'MSIE'라는 부분의 문자열
    
    brNum   = brVer.substr(brVerId,8);//브라우져 버전('MSIE' 포함..)..
    brNum2  = brNum.substr(5,3)//브라우져 버번. 숫자만..
    
    if(brNum2 > 6.0)
    {
        w_height = w_height - 50;
    }
	
	var param = "status:no;resizable:yes;scroll:yes;dialogWidth:" + w_width + "px;dialogHeight:" + w_height + "px;";
	
	vReturnValue = window.showModalDialog(target1 , '', param);
	
	return vReturnValue;
}
function OpenModalScrollWindow(target1,w_width,w_height)	
{
	var xpos = ( screen.width -  w_width  ) / 2;
	var ypos = ( screen.height - w_height )  / 2;
	
	var brVer   = navigator.userAgent;//브라우져 정보
    var brVerId = brVer.indexOf('MSIE');//브라우져 정보에서 'MSIE'라는 부분의 문자열
    
    brNum   = brVer.substr(brVerId,8);//브라우져 버전('MSIE' 포함..)..
    brNum2  = brNum.substr(5,3)//브라우져 버번. 숫자만..
    
    if(brNum2 > 6.0)
    {
        w_height = w_height - 50;
    }

	vReturnValue = window.showModalDialog(target1 ,'toolbar=no,status=no,directories=no,scrollbars=yes,location=no,resizable=yes,border=0,menubar=no' , "dialogHeight: " + w_height + "px; dialogWidth:" + w_width + "dialogLeft:" + xpos + "dialogLeft::" + ypos);
	
	return vReturnValue;
}
function OpenModalShadowWindow(target1,w_width,w_height)	
{
	var xpos = 10000;
	var ypos = 10000;
	
    var brVer   = navigator.userAgent;//브라우져 정보
    var brVerId = brVer.indexOf('MSIE');//브라우져 정보에서 'MSIE'라는 부분의 문자열
    
    brNum   = brVer.substr(brVerId,8);//브라우져 버전('MSIE' 포함..)..
    brNum2  = brNum.substr(5,3)//브라우져 버번. 숫자만..
    
    if(brNum2 > 6.0)
    {
        w_height = w_height - 50;
    }
	
	vReturnValue = window.showModalDialog(target1 , 'popup', 'toolbar=no,status=no,directories=no,scrollbars=no,location=no,resizable=yes,border=0,menubar=no,dialogHeight:' + w_height + 'px; dialogWidth:' + w_width + 'px; dialogLeft:' + xpos + 'dialogTop:' + ypos);
	
	return vReturnValue;
}

function WindowOpener(target1, w_width, w_height, PopupName, resizable) {
    var xpos = (screen.width - w_width) / 2;
    var ypos = (screen.height - w_height) / 2;
    var strResizable = 'no';

    var brVer = navigator.userAgent; //브라우져 정보
    var brVerId = brVer.indexOf('MSIE'); //브라우져 정보에서 'MSIE'라는 부분의 문자열

    brNum = brVer.substr(brVerId, 8); //브라우져 버전('MSIE' 포함..)..
    brNum2 = brNum.substr(5, 3)//브라우져 버번. 숫자만..

    if (brNum2 > 6.0) {
        w_height = w_height;
    }

    if (resizable == true) {
        //window.open(target1, PopupName, 'toolbar=no,status=no,top=' + ypos + ',left=' + xpos + ',width=' + w_width + ',height=' + w_height + ',directories=no,scrollbars=yes,location=no,resizable=yes ,border=0,menubar=no').focus();
        window.open(target1, PopupName, 'toolbar=no,status=no,top=' + ypos + ',left=' + xpos + ',width=' + w_width + ',height=' + w_height + ',directories=no,scrollbars=yes,location=no,resizable=yes ,border=0,menubar=no');
    }
    else {
        window.open(target1, PopupName, 'toolbar=no,status=no,top=' + ypos + ',left=' + xpos + ',width=' + w_width + ',height=' + w_height + ',directories=no,scrollbars=yes,location=no,resizable=no,border=0,menubar=no');
    }
}

