/*
* ÀüÃ¼ °æ·Î °¡Á®¿À´Â À¯Æ¿
* ex)http://naver.com/ or http://172.29.211.200:8302/
*/
function getUtl(mode) {
	//alert(location.port+'|'+location.hostname+'|');
	var url = "";
	var port = location.port;
	if (mode == 'http') {
		if(port==='' || port=='80') {
			url = mode+'://'+location.hostname+'/';
		} else {
			if(location.protocol=='http:') {
				url = mode+'://'+location.hostname+':'+port+'/';
			} else {
				port = parseInt(port)-2000;	
				url = mode+'://'+location.hostname+':'+port+'/';
			}
		}
	} else if (mode == 'https') {
		if(port==='' || port=='80') {
			url = mode+'://'+location.hostname+'/';
		} else {
			if(location.protocol=='https:') {
				url = mode+'://'+location.hostname+':'+port+'/';
			} else {
				port = parseInt(port)+2000;	
				url = mode+'://'+location.hostname+':'+port+'/';
			}
		}
	}
	
	return 	url;
}

function getTarget(mode) {
	var port = location.port;
	if(port==='' || port=='80') {
		return mode+'://'+location.hostname+'/';
	} else {
		if(location.protocol=='https:') {
			port = parseInt(port)-2000;
			return mode+'://'+location.hostname+':'+port+'/';
		} else {
			return mode+'://'+location.hostname+':'+port+'/';
		}
	}
}

function goTarget(protocol, target) {
	document.location.href=getUtl(protocol)+target;
}

