
function pop_umap(x,y,locale) {
	
	var lang = "kor";
	
	if(locale == 'kr') {
		lang = 'kor';
	}else if(locale == 'en') {
		lang = 'eng';
	}else if(locale == 'jp') {
		lang = 'jan';
	}else if(locale == 'ck') {
		lang = 'china_g';
	}else if(locale == 'cb') {
		lang = 'china_b';
	}
	
	
	window.open("http://maps.visitseoul.net/index.jsp?centerX="+x+"&centerY="+y+"&lang="+lang+"&poiX="+x+"&poiY="+y,"map",'');
}



function popupGallery(locale, type, art_id, lang){
	
	var gallery_url = "/"+locale+"/gallery/gallery.do?_method="+type;
	var w = "985";
	var h = "607";
	
	if(type=="movie"){
		w = "828";
		h = "500";
	}	
	
	popupWindow("gallery",gallery_url +"&art_id="+art_id+"&lang="+lang,w,h)
	
}

function setClipboardData(data){
	
	/*
	var frm = document.createElement("form");
	frm.name = "clipFrm";
	frm.id = "clipFrm";
	frm.action = "/common/clip.do?";
	frm.target = "iFrmBlank";
	frm.method = "post";
	
	var i = document.createElement("input");
	i.type = "hidden";
	i.name = "data";
	i.value = data;
	
	frm.appendChild(i);
	document.body.appendChild(frm);
	
	var form = document.forms["clipFrm"];
	form.submit();
	
	document.body.removeChild(form);
	*/
	
	var domain = location.href;
	
	var msg = "Copy URL Address";
	
	if(domain.indexOf("/kr/") > -1)
		msg = " URL이 복사 되었습니다.";
	if(domain.indexOf("/ck/") > -1)
		msg = "复制";
	if(domain.indexOf("/cb/") > -1)
		msg = "複製";
	if(domain.indexOf("/jp/") > -1)
		msg = "URLをクリップボードにコピー";
	
	var browserType = navigator.appName;
	
	if(browserType.indexOf("Explorer") > -1){
		window.clipboardData.setData('Text', data);
		alert("["+data + "] "+ msg );
	}else{
		var a = document.getElementById("trbLoc");
		popupWindow('',a.value,480,320);
	}
}

function fitImageSizeArticle(obj, href, maxWidth, maxHeight) {
	   var image = new Image();
	 
	    image.onload = function(){
	     
	    	var width = image.width;
	        var height = image.height;
	         
	        var scalex = maxWidth / width;
	        var scaley = maxHeight / height;
	         
	        var scale = (scalex < scaley) ? scalex : scaley;
	        if (scale > 1){
	            scale = 1
	        };
	        
	        if((scale * height) < 102){
	        	//obj.style.marginTop = 52 - (height /2) +"px";
	        	//obj.parentNode.style.paddingTop = 57 - ((scale * height) /2 );
		        obj.width = scale * width;
		        obj.height = scale * height;	

	        }else{
		        obj.width = scale * width;
		        obj.height = scale * height;	        	
	        }
	         
	        obj.style.display = "block";
	        obj.style.margin = "0 auto";   // center
	        
	    }
	    image.src = href;
}

function fitImageSizeArticleView(obj, href) {
	   var image = new Image();
	 
	    image.onload = function(){
	     
	    	var width = image.width;
	        var height = image.height;
	         
	        if(width>665){
	        	obj.width = 665;
	        }
	         
	        obj.style.display = "block";
	    }
	    image.src = href;
}


