// gives up and down scroll buttons to images, spans, ... named up_name, down_name, respectively.
// will keep the default scroll_box's style overflow if it encounters errors (so make overflow: auto;)

// usage: put this after the scrollbox div:  var div_scroll1 = new TextScroll('div_scroll1', 'scroll_box');
function TextScroll(scrollname, div_name, up_name, down_name)
{
    this.div_name = div_name;
    this.name = scrollname;
    this.scrollCursor = 0;
    this.speed = 10;
    this.timeoutID = 0;
    this.div_obj = null;
    this.up_name = up_name;
    this.dn_name = down_name;

{
        if (document.getElementById) {
            div_obj = document.getElementById(this.div_name);
            if (div_obj) {
                this.div_obj = div_obj;
                this.div_obj.style.overflow = 'hidden';
            }
            div_up_obj = document.getElementById(this.up_name);
            div_dn_obj = document.getElementById(this.dn_name);
            if (div_up_obj && div_dn_obj) {
			
			
			
			
			
			
			
				
				
				
				
div_up_obj.onmouseover = function() { eval(scrollname + ".scrollUp();") };
div_up_obj.onmouseout = function() { eval(scrollname + ".stopScroll();") };

div_dn_obj.onmouseover = function() { eval(scrollname + ".scrollDown();") };
div_dn_obj.onmouseout = function() { eval(scrollname + ".stopScroll();") };
				
				
				
				
            }
        }
    }
this.stopScroll = function() {
        clearTimeout(this.timeoutID);
    }

this.scrollUp = function() {
        if (this.div_obj) {
            this.scrollCursor = (this.scrollCursor - this.speed) < 0 ? 0 : this.scrollCursor - this.speed;
            this.div_obj.scrollTop = this.scrollCursor;
            this.timeoutID = setTimeout(this.name + ".scrollUp()", 60);
        }
    }

this.scrollDown = function() {
        if (this.div_obj) {
            this.scrollCursor += this.speed;
            this.div_obj.scrollTop = this.scrollCursor;
			if (this.div_obj.scrollTop == this.scrollCursor) {
            this.timeoutID = setTimeout(this.name + ".scrollDown()", 60);
			} else {
			this.scrollCursor = this.div_obj.scrollTop;
        }
    }
	}

this.resetScroll = function() {
        if (this.div_obj) {
            this.div_obj.scrollTop = 0;
            this.scrollCursor = 0;
        }
    }
}

// hide div show div
// this function allows pop up preview windows to appear
function hideDiv(pass) {
		var divs = document.getElementsByTagName('div');
		for(i=0;i<divs.length;i++){
			if(divs[i].id.match(pass)){//if they are 'see' divs
			if (document.getElementById) // DOM3 = IE5, NS6
			divs[i].style.visibility="hidden";// show/hide
		else
			if (document.layers) // Netscape 4
			document.layers[divs[i]].display = 'hidden';
		else // IE 4
			document.all.hideshow.divs[i].visibility = 'hidden';
		}
		}
		}

	function showDiv(pass) {
		var divs = document.getElementsByTagName('div');
		for(i=0;i<divs.length;i++){
			if(divs[i].id.match(pass)){
			if (document.getElementById)
			divs[i].style.visibility="visible";
		else
			if (document.layers) // Netscape 4
			document.layers[divs[i]].display = 'visible';
		else // IE 4
		document.all.hideshow.divs[i].visibility = 'visible';
		}
		}
		}

		
// show page/close page functionality
// this function allows for the quick search to expand/collapse	
		
	var objPage = null;
		function showPage(pagename) {
			if (objPage) objPage.style.display = 'none';
			objPage=document.getElementById(pagename);
			objPage.style.display = 'block';
			}
		
			
		function closePage(pagename) {
			if (objPage) objPage.style.display = 'block';
			objPage=document.getElementById(pagename);
			objPage.style.display = 'none';
			}
		
		
// iframe scroll functions

startList = function() {
	var nodes = document.getElementById("mainnav").getElementsByTagName("LI");
	for (var i=0; i<nodes.length; i++) {
		nodes[i].onmouseover = function() {
			this.className += " over";
		}
		nodes[i].onmouseout = function() {
			this.className = this.className.replace(new RegExp(" over\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", startList);

/*************************************************************************
  This code is from Dynamic Web Coding at http://www.dyn-web.com/
  See Terms of Use at http://www.dyn-web.com/bus/terms.html
  regarding conditions under which you may use this code.
  This notice must be retained in the code as is!
*************************************************************************/

var timer_id;
function scroll_iframe(frm,inc,dir) {
  if (timer_id) clearTimeout(timer_id);
  if (window.frames[frm]) {
    if (dir == "v") window.frames[frm].scrollBy(0, inc);
    else window.frames[frm].scrollBy(inc, 0);
    timer_id = setTimeout("scroll_iframe('" + frm + "'," + inc + ",'" + dir + "')", 20);
  }
}

function stopScroll() { if (timer_id) clearTimeout(timer_id); }



function hideSelect()
{if (document.all){
document.all.formselect.style.visibility="hidden";
document.all.formselectState.style.visibility="hidden";
document.all.formselectBed.style.visibility="hidden";
document.all.formselectBath.style.visibility="hidden";
document.all.formselectMinPrice.style.visibility="hidden";
document.all.formselectMaxPrice.style.visibility="hidden";
document.all.formselectAgent.style.visibility="hidden";
}}

function unhideSelect()
{if (document.all){
document.all.formselect.style.visibility="visible";
document.all.formselectState.style.visibility="visible";
document.all.formselectBed.style.visibility="visible";
document.all.formselectBath.style.visibility="visible";
document.all.formselectMinPrice.style.visibility="visible";
document.all.formselectMaxPrice.style.visibility="visible";
document.all.formselectAgent.style.visibility="visible";
}}