////////////////////////////////////////////////////////////
// project nameĦĦ
////////////////////////////////////////////////////////////
var PROJECT_NAME = "jreasthotel";


////////////////////////////////////////////////////////////
// window Initialize
////////////////////////////////////////////////////////////
//if( !window.opener && top != window ) window.name = PROJECT_NAME + "_MAIN";


////////////////////////////////////////////////////////////
// checkUA
////////////////////////////////////////////////////////////
var isIe = (document.getElementById && document.all)? true:false;
var isIe4 = (document.all && !document.getElementById)? true:false;
var isNs4 = (document.layers)? true:false;
var isNs = (document.getElementById && navigator.userAgent.toLowerCase().indexOf("compatible") == -1)?	true:false;
var isMac = (navigator.appVersion.indexOf("PPC") != -1 || navigator.appVersion.indexOf("Mac") != -1)?	true:false;


////////////////////////////////////////////////////////////
// NS4 resize
////////////////////////////////////////////////////////////
function reloadResize(){
	var tempW = window.innerWidth-16;
	var tempH = window.innerHeight-16;
	if( tempW != winW && tempH != winH ){
		window.location.reload();
		winW = tempW;
		winH = tempH;
	}
}
if( isNs4 ){
	window.onresize = reloadResize;
	var winW = window.innerWidth-16;
	var winH = window.innerHeight-16;
}


////////////////////////////////////////////////////////////
// window open
////////////////////////////////////////////////////////////
function openWindow( targetRef, popWidth, popHeight ){
	popLeft = (screen.width - popWidth) / 2;
	popTop = (screen.height - popHeight) / 2;

	if( (arguments.length == 4) && (arguments[3] == 'scroll') ) {
		var refPopWin = window.open( targetRef, PROJECT_NAME + "_Pop" + popWidth + "x" + popHeight + "SB", "toolbar=0,location=0,directories=0,scrollbars=1,status=1,resizable=0,width=" + popWidth + ",height=" + popHeight + ",top=" + popTop + ",left=" + popLeft);
	}
	else {
		var refPopWin = window.open( targetRef, PROJECT_NAME + "_Pop" + popWidth + "x" + popHeight + "", "toolbar=0,location=0,directories=0,scrollbars=1,status=1,resizable=0,width=" + popWidth + ",height=" + popHeight + ",top=" + popTop + ",left=" + popLeft);
	}
	refPopWin.focus();
	return false;
}

////////////////////////////////////////////////////////////
// changeImage
////////////////////////////////////////////////////////////
var imgObj = new Array();
var imgReady = false;

function initImage(targetname, stat, src) {
	if(document.images) {
		if(typeof imgObj[targetname] == "undefined") imgObj[targetname] = new Array();
		imgObj[targetname][stat] = new Image();

		if(src != "" && src != null) imgObj[targetname][stat].src = src;
		else return false;

		return true;
	}
	return false;
}
function changeImage(imgname,stat) {
	if(document.images && imgReady) {
		var targetLayers = imgname.split(".");
		imageSrc = ( isNs4 )? targetLayers.pop(): targetLayers[ targetLayers.length - 1 ];
		if( arguments.length == 3 ) {
			targetImg = imageSrc + arguments[1];
			stat = arguments[2];
		}
		else targetImg = imageSrc;

		var targetDocument = document;
		if( isNs4 && targetLayers.length >= 1 ){
			for( i in targetLayers ){
				targetDocument = targetDocument.layers[ targetLayers[i] ].document;
			}
		}
		if(targetDocument.images[targetImg]) targetDocument.images[targetImg].src = imgObj[imageSrc][stat].src;
		return true;
	}
	return false;
}


////////////////////////////////////////////////////////////
// set Font Size
////////////////////////////////////////////////////////////
function setFontsize_kr(){
	var stylestr = '<'+'style type="text/css">\n';
	if (isNs4) {
		stylestr += 'body, th, td, li { font-size: 90%; }';
		stylestr += 'small, sup, .small { font-size: 80%;}';
	}
	else {
		stylestr += 'body, th, td, li { font-size: 80%; letter-spacing:1px;}';
		stylestr += 'small, sup, .small { font-size: 70%; letter-spacing:normal;}';
	}
	stylestr += '</'+'style>';

	document.write( stylestr );
}

////////////////////////////////////////////////////////////
// open Icon Window
////////////////////////////////////////////////////////////
function OpenIconWindow(){
	openWindow("http://www.jrhotelgroup.com/w_icon.htm",380,450);
}
/*---------------------------------------------------------------------------*/
