var ns4 = (document.layers); 
var ie4 = (document.all && !document.getElementById); 
var ie5 = (document.all && document.getElementById); 
var ns6 = (!document.all && document.getElementById); 
function attach(id)
{
 var obj
  if(ns4) obj = document.layers[id];
  else if(ie4) obj = document.all[id];
   else if(ie5 || ns6) obj = document.getElementById(id);
  return obj
} //var hab1=new Image(); 
//hab1.src="misc/suite_big.jpg"; position: relative
//var hab2=new Image(); 
//hab2.src="misc/room_big.jpg";  visibility: visible;
 
function damunt(Imatge,img,lay,w,h,step_h,step_v) { 
	if (document.images) {  
		document[Imatge].src=img; 
		//rttreterte/
		//alert(lay);
		temp_Obj = attach(lay);
		//step_h = 10;
		//step_v = 10;
		//temp_Obj = attach(id); 
		if(ns4) { temp_Obj.visibility = "hidden";temp_Obj.zIndex = parseInt(2);document.parent.zIndex = parseInt(15);temp_Obj.top = parseInt(temp_Obj.top) - step_v; temp_Obj.left = parseInt(temp_Obj.left) - step_h; temp_Obj.visibility = "visible";
		}
		else {temp_Obj.style.visibility = "hidden";temp_Obj.style.zIndex = parseInt(2);temp_Obj.style.top = parseInt(temp_Obj.style.top) - step_v; temp_Obj.style.left = parseInt(temp_Obj.style.left) - step_h; temp_Obj.style.visibility = "visible";
		}
		document[Imatge].width=w;  
		document[Imatge].height=h;  
		//alert(temp_Obj.style.zIndex);
	} 
return temp_Obj;} 

function fora(Imatge,lay,w,h,step_h,step_v) {  
	if (document.images) { 
		temp_Obj = attach(lay);
		//step_h = 10;
		//step_v = 10;
		//temp_Obj = attach(id);
		if(ns4) {temp_Obj.zIndex = parseInt(1);temp_Obj.top = parseInt(temp_Obj.top) + step_v; temp_Obj.left = parseInt(temp_Obj.left) + step_h; }
		else {temp_Obj.style.zIndex = parseInt(1);temp_Obj.style.top = parseInt(temp_Obj.style.top) + step_v; temp_Obj.style.left = parseInt(temp_Obj.style.left) + step_h; }
		document[Imatge].width=w;
		document[Imatge].height=h;    
	} 
 return temp_Obj;} 


function popUpWindow(imag, left, top, width, height)
{
  popUpWin = open("../imagen.php?imag="+imag+"a.jpg", 'popUpWin', 'scrollbars=no,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
  popUpWin.focus();
}
function popUpWindow2(src, left, top, width, height)
{
  popUpWin2 = open(src, 'popUpWin2', 'scrollbars=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
  popUpWin2.focus();
}
