var divsView=new Array('ImmList','StudioList', 'OneList', 'TwoList', 'ThreeList', 'FourList', 'FivePlusList', 'RoomList', 'HouseList', 'viewDetail', 'FormList', "OpenList");

function setPage(setH) { var setH = setH; document.getElementById("viewDetail").style.height = setH; 
			var rightDiv = document.getElementById("viewDetail").offsetHeight; 
			document.getElementById("MenuLeft").style.height = (rightDiv+3)+'px';   
		       }

function clearNext(div) { document.getElementById(div).style.display = 'none'; }

function setMenu(div, addSome) 
	{ 
	var rightDiv = document.getElementById(div).offsetHeight; var setLeftDiv; //alert(rightDiv);
	var addSome = new String(addSome);
	if(addSome!="") { rightDiv+=20; }else { rightDiv+=1.09; }
	if(rightDiv<400){ setLeftDiv = 300; }
	//document.getElementById("MenuLeft").style.height = setLeftDiv+'px'; 
	//document.getElementById("MenuLeft").style.height = rightDiv+'px'; 	

	}
	
function overOn(id, area)
	{
	if(area=="menu") { document.getElementById(id).style.background = 'url(imgs/_n.jpg)'; 
		}else if(area=="menu2") { document.getElementById(id).style.background = 'url(imgs/_n2.jpg)'; 
			}else if(area=="loc"){ 	document.getElementById(id+'_top').style.background = 'url(imgs/11_top_n.jpg)';
						document.getElementById(id+'_middle').style.background = 'url(imgs/11_middle_n.jpg)';
						document.getElementById(id+'_bottom').style.background = 'url(imgs/11_bottom_n.jpg)';
				}else if(area=="next") { document.getElementById(id).style.background = 'url(imgs/n_n.jpg)';  
				        }else if(area=="open") { document.getElementById(id).style.background = 'url(imgs/bb_n.jpg)';  }
	}
	
function overOff(id, area)
	{
	if(area=="menu") { document.getElementById(id).style.background = 'url(imgs/_f.jpg)'; 
		}else if(area=="menu2") { document.getElementById(id).style.background = 'url(imgs/_f2.jpg)'; 	
			}else if(area=="loc"){ 	document.getElementById(id+'_top').style.background = 'url(imgs/11_top_f.jpg)';
						document.getElementById(id+'_middle').style.background = 'url(imgs/11_middle_f.jpg)';
						document.getElementById(id+'_bottom').style.background = 'url(imgs/11_bottom_f.jpg)';
				}else if(area=="next") { document.getElementById(id).style.background = 'url(imgs/n_f.jpg)';  
				        }else if(area=="open") { document.getElementById(id).style.background = 'url(imgs/bb_f.jpg)';  }
	}

function DivsView(id)
	{
	var id = id;
 	hideallDivsView();
 	showDivsView(id);

	function hideallDivsView()
	{
	 for (var i=0;i<divsView.length;i++)
	 	{ 
	 	hideDivsView(divsView[i]);
	 	}   
	}
	
	function hideDivsView(id) 
	{
	 if (document.getElementById) 
		 { 
		 document.getElementById(id).style.display = 'none';  //IE5, NS6 
		if(document.getElementById("AvailDiv")) {document.getElementById("AvailDiv").style.display = 'none';}
		document.getElementById("NextLoc").style.display = 'none';
		document.getElementById("PrevLoc").style.display = 'none';	
	 	} else {
	  		if (document.layers) 
	  		{ 
	  		document.id.display = 'none'; // NS4 
	  		} else 
	  			{ 
	  			document.all.id.style.display = 'none'; // IE 4 
	  			}
	     	}
	}

	function showDivsView(id) 
	{
   	 if (document.getElementById) 
   	 { 
   	 document.getElementById(id).style.display = 'block';//IE5, NS6 
		var rightDiv = document.getElementById(id).offsetHeight; 
		document.getElementById("MenuLeft").style.height = (rightDiv+4)+'px';  
   	 } else {
	  	if (document.layers) 
	  	{ 
	  	document.id.display = 'block'; // Netscape 4 
	  	} else { 
	  		document.all.id.style.display = 'block';  // IE 4 
	  		}
	      }
	}
	
}	


	
function ViewLoc(idurl, div){
var xhr=false;
var lurl = idurl;
var divD = div;

getNewFile(lurl);


function getNewFile() {
	makeRequest(lurl);
	return false;
	}
	
		
function makeRequest(url) {
	
	if(window.XMLHttpRequest) {
		xhr = new XMLHttpRequest();
		}
	else {
		if(window.ActiveXObject) {
		try {
			xhr = new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(e) { }
		}
	}
	
	if(xhr) {
		xhr.onreadystatechange = showContents;
		xhr.open("GET", url, true);
		xhr.send(null);
		
		}
		else {
			document.getElementById(divD).innerHTML = "Sorry, but I couldn't Create a XMLHttpRequest.";
			}
}

	
function showContents() {
	if(xhr.readyState==4) {
		if(xhr.status==200) {
			var outMsg = xhr.responseText;
			}
			else {
				var outMsg = "There was a problem with the Request  - " + xhr.status;
				}
				document.getElementById(divD).innerHTML = outMsg;
				document.getElementById(divD).style.display = 'block';	
				}
		}

		
}

function genCall(eleOne) {
if(eleOne=="print"){
	
	// open new window to generate printable list	
	window.open('makeLists.php?action=print');
	
	}
	
if(eleOne=="model"){
	
	// open new window to generate printable list	
	window.open('makeLists.php?action=model');
	
	}
	
}
