﻿try {
    document.execCommand('BackgroundImageCache', false, true);
} catch (e) { }

/********************************************************************************************************
팝업 수동 Open 정의
변수 정의 : pop - 파일명, width - 가로사이즈, height - 세로사이즈, flag - 0:스크롤없음, 1:스크롤있음
********************************************************************************************************/
function popfix(pop,tname,width,height,flag)
{
  var url = pop;
  var wd = width;
  var he = height;
  var tn = tname;

  if ((window.navigator.userAgent.indexOf("SV1") != -1) || (window.navigator.userAgent.indexOf("MSIE 7") != -1)) {
    wd = wd + 8;
    he = he + 10;
        
    if (flag == "0" )    {  
      winObj =  window.open(url,tn,"toolbar=0,menubar=0,scrollbars=no,resizable=no,width=" + wd + ",height=" + he + ";");  
	  winObj.focus(); 	}
    else  {  
      winObj =  window.open(url,tn,"toolbar=0,menubar=0,scrollbars=yes,resizable=no,width=" + wd + ",height=" + he + ";");  
	  winObj.focus();  }
  }
  
  else {
  if (flag == "0" )    {  
    winObj =  window.open(url,tn,"toolbar=0,menubar=0,scrollbars=no,resizable=no,width=" + wd +",height=" + he + ";");  
	winObj.focus();   }
  else  {  
    winObj =  window.open(url,tn,"toolbar=0,menubar=0,scrollbars=yes,resizable=no,width=" + wd +",height=" + he + ";");  
	winObj.focus();   }  
  }
}

/*********** 팝업창 오픈  **********/
function uf_popOpen(url,wname) {
	var positionX = 0;
	var positionY = 0;
	winStr = window.open(url,wname,"left="+positionX+",top="+positionY+",width=100,height=100,toolbar=no,scrollbars=no" );
	winStr.focus();
}

/****** 팝업창 자동 리사이즈 **************************************************************/
function uf_popResize() {
	
	var Station = {   
        check : function (type, checkStr, checkPoint)   
        {   
            var name = "ETC";          
            for ( var list in checkPoint )   
            {   
                if (checkStr.indexOf(list) != -1)    
                {   
                    name = checkPoint[list];   
                }              
            }   
            escape("this." + type + " = function () { return name }") ;   
            return name;   
        },   
        os : function ()    
        {    
            var checkStr = navigator.platform.toLowerCase();   
            var checkPoint =    
            {    
                "win" : "WINDOW", "mac" : "MAC", "unix" : "UNIX",    
                "linux" : "LINUX"    
            }   
            return this.check("os", checkStr, checkPoint );    
        },   
        browser : function ()    
        {    
            var checkStr = navigator.userAgent.toLowerCase();   
            var checkPoint =    
            {    
                "msie 6" : "IE6" , "msie 7" : "IE7",    
                "firefox" : "FF", "navigator" : "NETSCAPE",    
                "opera" : "OPERA" , "msie 8" : "IE8"
            }   
												return this.check("browser", checkStr, checkPoint);    
           
        }   
    } 	/*browser Check*/
	
	var thisX = document.getElementById("offsetTable").offsetWidth;
	var thisY = document.getElementById("offsetTable").offsetHeight;
	var maxThisX = screen.width - 50;
	var maxThisY = screen.height - 80;
		
	if (Station.browser() == "IE7") {
		var marginY = 78; 
	}
	else if (Station.browser() == "IE6") {
		var marginY = 65; 
	}
	else if (Station.browser() == "FF") {
		var marginY = 98; 
	}
		else if (Station.browser() == "IE8") {
		var marginY = 90; 
	}
	else  {
		var marginY = 46; 
	}
	
	if (thisX > maxThisX) {
		window.document.body.scroll = "yes";
		thisX = maxThisX;
	}
	if (thisY > maxThisY - marginY) {
		window.document.body.scroll = "yes";
		thisX += 19;
		thisY = maxThisY - marginY;
	}
	
	var windowX = (screen.width - (thisX+10))/2;
	var windowY = (screen.height - (thisY+marginY))/2 - 20;
	//window.moveTo(windowX,windowY);
		if (Station.browser() == "IE6") {
		window.resizeTo(thisX+18,thisY+marginY);
	}
	else {
		window.resizeTo(thisX+11,thisY+marginY);
	}
}

	//png
	function setPng24(obj) {
			obj.width=obj.height=1;
			obj.className=obj.className.replace(/\bpng24\b/i,'');
			obj.style.filter =
			"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src

		+"',sizingMethod='image');"
			obj.src='';
			return '';
		}
	////////////

	/****** 팝업창 자동 리사이즈 width,height 지정된 값으로 고정**************************************************************/
	function up_popResize2(){
		return uf_popResize2('','');
	}

	function uf_popResize2(pWidth,pHeight) {
		
		var Station = {   
	        check : function (type, checkStr, checkPoint)   
	        {   
	            var name = "ETC";          
	            for ( var list in checkPoint )   
	            {   
	                if (checkStr.indexOf(list) != -1)    
	                {   
	                    name = checkPoint[list];   
	                }              
	            }   
	            escape("this." + type + " = function () { return name }") ;   
	            return name;   
	        },   
	        os : function ()    
	        {    
	            var checkStr = navigator.platform.toLowerCase();   
	            var checkPoint =    
	            {    
	                "win" : "WINDOW", "mac" : "MAC", "unix" : "UNIX",    
	                "linux" : "LINUX"    
	            }   
	            return this.check("os", checkStr, checkPoint );    
	        },   
	        browser : function ()    
	        {    
	            var checkStr = navigator.userAgent.toLowerCase();   
	            var checkPoint =    
	            {    
	                "msie 6" : "IE6" , "msie 7" : "IE7",    
	                "firefox" : "FF", "navigator" : "NETSCAPE",    
	                "opera" : "OPERA" , "msie 8" : "IE8"
	            }   
				return this.check("browser", checkStr, checkPoint);    
	           
	        }   
	    } 	/*browser Check*/
		
		var thisX = parseInt(pWidth) > 0  ? pWidth : document.getElementById("offsetTable").offsetWidth; 
		var thisY = parseInt(pHeight) > 0 ? pHeight : document.getElementById("offsetTable").offsetHeight;
		
		var maxThisX = screen.width - 50;
		var maxThisY = screen.height - 80;
			
		if (Station.browser() == "IE7") {
			var marginY = 78; 
		}
		else if (Station.browser() == "IE6") {
			var marginY = 65; 
		}
		else if (Station.browser() == "FF") {
			var marginY = 98; 
		}
			else if (Station.browser() == "IE8") {
			var marginY = 90; 
		}
		else  {
			var marginY = 46; 
		}
		
		
		if (thisY > maxThisY - marginY) {
			window.document.body.scroll = "yes";
			thisX += 19;
			thisY = maxThisY - marginY;
		}
		
		var windowY = (screen.height - (thisY+marginY))/2 - 20;
		//window.moveTo(windowX,windowY);
		if (Station.browser() == "IE6") {
			window.resizeTo(thisX+28,thisY+marginY);
		}else if (Station.browser() == "IE7") {
			window.resizeTo(thisX+28,thisY+marginY);
		}
		else if (Station.browser() == "IE8"){
			window.resizeTo(thisX+11,thisY+marginY);
		}else{
			window.resizeTo(thisX+28,thisY+marginY);
		}
	}
	/////////
	
	
	function openSendMail() { 
		window.open('/email/email.jsp', '_email', 'width=553,height=500,scrollbars=no,location=0,status=0');
	}
	
	
