////////////////////////////////////////////////////////////
// project name
////////////////////////////////////////////////////////////
var SITE_ID = "sited";


////////////////////////////////////////////////////////////
// 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;


////////////////////////////////////////////////////////////
// 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, SITE_ID + "_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, SITE_ID + "_Pop" + popWidth + "x" + popHeight + "", "toolbar=0,location=0,directories=0,scrollbars=0,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;
	}


////////////////////////////////////////////////////////////
// ARGV
////////////////////////////////////////////////////////////
var ARGV = new Object;
if ( document.location.href.indexOf('?') != -1 ) {
	var argvsStr = (document.location.href.substr( document.location.href.indexOf("?")+1, document.location.href.length ) ).split("&");
	for ( i=0; i < argvsStr.length; i++ ) {
		var temp = argvsStr[i].split('=');
		ARGV[temp[0]] = temp[1];
	}
}


