function openImg(imgSrc)
{
	var image = new Image();
	image.onload=handler;
	
	function handler() {
	    window.open('image.php?imgSrc='+imgSrc, 'image' , 'width='+image.width+', height='+image.height+',scrollbars=0','toolbar=0, location=0, directories=0, status=1, menubar=0, scrollbars=0, resizable=0, copyhistory=0');
	 	
	}
	image.src = imgSrc;    //location is figurative here
//	window.open('image.php?imgSrc='+imgSrc, 'room10d' , 'width='+width+', height='+height+',scrollbars=0','toolbar=0, location=0, directories=0, status=1, menubar=0, scrollbars=0, resizable=0, copyhistory=0');

}
function openMap(obj)
{
	
	var image = new Image();
	image.onload=handler;
	
	function handler() {
	    window.open('image.php?imgSrc='+imgSrc, 'image' , 'width='+image.width+', height='+image.height+',scrollbars=0','toolbar=0, location=0, directories=0, status=1, menubar=0, scrollbars=0, resizable=0, copyhistory=0');
	 	
	}
	var imgSrc = 'images/maps/big/'+obj.src.substring(obj.src.lastIndexOf('/')+1,obj.src.lastIndexOf("."))+'.jpg';
	image.src = imgSrc;    //location is figurative here
//	window.open('image.php?imgSrc='+imgSrc, 'room10d' , 'width='+width+', height='+height+',scrollbars=0','toolbar=0, location=0, directories=0, status=1, menubar=0, scrollbars=0, resizable=0, copyhistory=0');

}
function openRoom(roomId)
{
	if(roomId <=11)
	 	window.open('room.php?id='+roomId, 'bedroom' , 'width=400, height=590,scrollbars=0','toolbar=0, location=0, directories=0, status=1, menubar=0, scrollbars=0, resizable=0, copyhistory=0');
	 else
	 	window.open('room.php?id='+roomId, 'bedroom' , 'width=400, height=370,scrollbars=0','toolbar=0, location=0, directories=0, status=1, menubar=0, scrollbars=0, resizable=0, copyhistory=0');
}

function loadImg(imgSrc,filename)
{
	
	document.getElementById('photo').src = imgSrc;
	document.getElementById('photo').name = filename;
}

function buttonOver(button)
{
	button.className = 'buttonOver';
}
function buttonOut(button)
{
	button.className = 'button';
}

function showSubMenu(menuId)
{
	var menu = document.getElementById(menuId);
	if(menu.style.display == 'none')
		menu.style.display = 'block';
	else
		menu.style.display = 'none';
}
function hideSubMenu(menuId)
{
	var menu = document.getElementById(menuId);
	menu.style.display = 'none';
}
function changeMap(mapName)
{
	var map = document.getElementById(mapName);	
	var locationMap = document.getElementById('locationMap');
	locationMap.src = "images/maps/"+mapName;
}
