document.write('<DIV style="POSITION: absolute; DISPLAY: none; TOP: 0px; LEFT: 0px; border: 2px outset LIGHTSKYBLUE" id=floating_div></DIV>');

function show_plan(area) {
	dn_img=getEle('downstairs_img'); up_img=getEle('upstairs_img');
	up_vtours=getEle('upstairs_vtours');
	switch(area) {
		case 'upstairs': { 
							float_picture('floorplan_upstairs_720.jpg');
//							float_picture('floorplan-upstairs-530.gif');
//	   					 dn_img.style.display='none'; up_img.style.display='inline';
//		                   up_vtours.style.display='inline';
		                   break; }
		case 'downstairs': { 
							float_picture('floorplan_downstairs_720.jpg');
//							float_picture('floorplan-downstairs-530.gif');
//							up_img.style.display='none'; dn_img.style.display='inline';
//		                   up_vtours.style.display='none';
		                   break; }
	}
}

function show_tour(vtour) {
	var shref='http://www.sleeping-out.co.za/VTours.asp?MemberID=3450';
	SmallWindow(shref,'','scrollbars=no,resizable',595,510)
}

function SmallWindow(theURL,winName,features,width,height){
	var screenx=768;
	var screeny=1024;
	if (window.screen){
		screenx = screen.availHeight;
		screeny = screen.availWidth;
		}
	if(features==null || typeof(features)=="undefined"){
		var oWin = window.open(theURL);
		}
	else{
		var top = screenx/2-height/2;
		var left = screeny/2 - width/2;
		var winsize ='width='+width+',height='+height+',top='+top+',left='+left+'';
		var oWin = window.open(theURL,winName,features+','+winsize);
		}
	if (oWin==null || typeof(oWin)=="undefined") alert("This popup was blocked. Please allow popups by selecting this option from your Tools menu and/or Anti Virus software.");
	return false;
}

var s_img_title='';

function float_picture(img) {
	var floating_div=getEle('floating_div');
	if (img.indexOf('upstairs')>=0) { s_img_title='Upstairs Floor Plan'; } else { s_img_title='Downstairs Floor Plan'; }
	var src='pics/'+img;

 	var p = getElePosi(getEle("fp_icon"));
//	floating_div.style.top=p.y;
	floating_div.style.top=2;

	floating_div.style.backgroundColor='#F5F5F5';
	floating_div.innerHTML='<IMG id=pic src=pics/aniloading.gif border=0 onload=picLoaded(this);>';
	floating_div.style.display='inline';
	floating_div.style.left=(parseInt(screen.availWidth)-parseInt(floating_div.offsetWidth))/2;
	var pic=getEle('pic'); pic.src=src;
	if (img.indexOf('floorplan_upstairs_720')==0) { pic.useMap="#floorplan_upstairs_720"; } else { pic.useMap=''; }
	floating_div.style.left=(parseInt(screen.availWidth)-parseInt(floating_div.offsetWidth))/2;

//	var s='<TABLE class=pics_hdr cellSpacing=0 cellPadding=0 width="'+(floating_div.offsetWidth-40)+'" height=20>';
	var s='<TABLE class=pics_hdr cellSpacing=0 cellPadding=0 width="720" height=20>';
//	s+='<TR><TD width=6></TD><TD id=img_title>'+s_img_title+'</TD><TD width=18>';
	s+='<TR><TD width=6></TD><TD id=img_title width=99%>.. loading '+s_img_title+' ..</TD><TD width=18>';
	s+='<A href="javascript:hide_floating_div();"><IMG title=Close border=0 alt=pics_close.gif src="pics/pics_close.gif" width=14 height=14></A></TD></TR></TABLE>';
	floating_div.innerHTML=s+floating_div.innerHTML;

	floating_div.style.zIndex=9999;
}

function picLoaded(img) {
	if (img.src.indexOf('aniloading.gif')>0) return;

	var floating_div=getEle('floating_div');
	try {
		getEle('img_title').innerHTML=s_img_title;
//		img_title.width=(parseInt(floating_div.offsetWidth)-24)+'px';
	} catch(e) { }
	floating_div.style.left=(parseInt(screen.availWidth)-parseInt(floating_div.offsetWidth))/2;
}

function hide_floating_div() { getEle('pic').src='pics/aniloading.gif'; getEle('floating_div').style.display='none'; }

