var cpath = "default";
var onameold;
var inith = 0;
var location_top = '0';

var brwin = navigator.appName;
var brver =  navigator.appVersion;
brver = brver.substring(0,1);

function getpath(hsid){
	var thsid = "h" + hsid;
	if (document.layers){
		cpath = eval('document.' + thsid);
	}else if (document.all){
		cpath = eval('document.all.' + thsid + '.style');
	}else if (document.getElementById){
		cpath = eval('document.getElementById("' + thsid + '").style');		
	}
}

function initrow(rnum){
	var trnum;
	if (document.layers){
		onameold = eval('document.r' + rnum);
	}else if (document.all){
		onameold = eval('document.all.r' + rnum);		
	}else if (document.getElementById){
		trnum = 'r' + rnum;
		onameold = eval('document.getElementById("' + trnum + '")');		
	}
	
}

function shrow(oname){
	if (onameold != null){
		onameold.bgColor = "#FFFFFF";
	}	
	oname.bgColor = "#FFFFCC";
	onameold = oname;
}

// Boris: to place the house details in the view despite vertical scrolling
function placehomedetails( location ) {
	cpath.top = location;
}

function next_location() {
	var homedetailstopinit = 0;
	var homedetailstopgap = 0;
	var voffset = 0;
	// Boris: to update the position of the new image
	if ((brwin=="Netscape") && (brver == "4")) {
		if (homedetailstopinit > window.pageYOffset) {
			voffset = homedetailstopinit - window.pageYOffset;
		}
		return String( cpath.top + voffset + homedetailstopgap + eval(window.pageYOffset) );
	}
	else{
		if (homedetailstopinit > document.body.scrollTop) {
			voffset = homedetailstopinit - document.body.scrollTop;
		}
		return String( voffset + homedetailstopgap + eval(document.body.scrollTop) )+"px";
	}
}


// Boris: to keep the house details in the view despite the vertical scrolling
function show_photo(){
	// refresh the image
	location_top = next_location();
	placehomedetails( location_top );
	cpath.visibility = 'visible';
}

function hide_photo(){
	// hide the image
	cpath.visibility = 'hidden';
}

function showhide(hid){
	if (inith == 0){
		inith = 1;	
	}else{	
		cpath.visibility = 'hidden';
	}	
	
	getpath(hid);
	placehomedetails( location_top );
	cpath.visibility = 'visible';
}

function binit(){
//	if ((brwin=="Netscape") && (brver == "4")) {
	init();
//	}	
}

function init(){
	getpath(document.forms[0].inithse.value);
	inith = 1;
	cpath.visibility = 'visible';
}
