// JavaScript Document
function showCasa(id) {
	var lista_div = document.getElementsByTagName("div");
	var lista_select = document.getElementsByTagName("select");
	var windowHeight = document.documentElement.clientHeight;
	$("#backgroudOscura").css({"height": windowHeight});
	
	for(i=0; i < lista_div.length; i++) {
		if(lista_div.item(i).getAttribute("id") != null && lista_div.item(i).getAttribute("id").indexOf("bigbox_") != -1) {
		 document.getElementById(lista_div.item(i).getAttribute("id")).style.display='none';
		}
	}
	for(i=0; i < lista_select.length; i++) {
		lista_select.item(i).style.visibility='hidden';
	}
	if (document.all||document.getElementById) {
		if (document.getElementById(id).style.display=="none") {
			positionit(id);
			//document.getElementById(id).style.display='block';
			$("#backgroudOscura").fadeIn("slow");
			$("#"+id).fadeIn("slow");
		}
	}
};

function hideCasa(id) {
	//document.getElementById(id).style.display='none';
	$("#backgroudOscura").fadeOut("slow");
	$("#"+id).fadeOut("slow");
	var lista_select = document.getElementsByTagName("select");
	for(i=0; i < lista_select.length; i++) {
		lista_select.item(i).style.visibility='visible';
	}
};

function positionit(id){
	if (parseInt(navigator.appVersion)>3) {
		if (navigator.appName=="Netscape") {
			winW = window.innerWidth;
			winH = window.innerHeight;
		}
		if (navigator.appName.indexOf("Microsoft")!=-1) {
			winW = document.body.offsetWidth;
			winH = document.body.offsetHeight;
		}
	}
	var iebody=(document.compatMode && document.compatMode != "BackCompat")? document.documentElement : document.body;
	var dsoctop=document.all? iebody.scrollTop : pageYOffset;
	if (document.all||document.getElementById) {
		document.getElementById(id).style.left=parseInt(winW/2)-260+"px";
		document.getElementById(id).style.top=dsoctop+100+"px";
	}
};