ie = document.all?1:0
ns4 = document.layers?1:0
browserName = navigator.appName;
browserVer = parseInt(navigator.appVersion);

ns3up = (browserName == "Netscape" && browserVer >= 3);
ie4up = (browserName.indexOf("Microsoft") >= 0 && browserVer >= 4);


function pop(url, name, w, h, rs, sb, mn, st, oth) {
	var resize = ((rs) ? "resizable="+rs+"," : "");
	var scroll = ((sb) ? "scrollbars="+sb+"," : "");
	var menu = ((mn) ? "toolbar="+mn+",location="+mn+",menubar="+mn+"," : "");
	var sts = ((st) ? "status="+st+"," : "");

	var popupWin = window.open(url, name, resize + scroll + menu + sts + "width=" + w + ",height=" + h + " " + oth);
	if (document.layers) {
		popupWin.focus();
	}
}

function loadImage(no,dir,no_img){
	arr = new Array("","1","2","3","4","5","6","7","8","9","10");

	for(x=1;x<=no_img;x++){
		//imgTemp = "i0" + x;
		imgString = 'imgTemp = document.getElementById("i0'+x+'")';
		eval(imgString);
		if(x == no){
			imgTemp.src = "/images/rooms/button_0" + arr[x] + "_on.gif";
		}else{
			imgTemp.src = "/images/rooms/button_0" + arr[x] + ".gif";
		}
	}
	imgString = 'imgTemp = document.getElementById("middle")';
	eval(imgString);
	imgTemp.src = "/images/"+dir+"small_0" + no + ".jpg";
}

function doPic(imgName) {
	if (ns3up || ie4up) {
		imgOn = ("" + imgName);
		document.large.src = imgOn;
   }
}

function preload() { 
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=preload.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function openLayer(id, onpos) {
	document.getElementById(id).style.left = onpos;
}

function closeLayer(id) {
	document.getElementById(id).style.left = "-1000px";
}