//****************************functions for the drop down menu ****************************
			// Determine browser and version.
			function Browser(){
			  var ua, s, i;
			  this.isIE    = false;  
			  this.isNS    = false;  
			  this.version = null;
			
			  ua = navigator.userAgent;
			
			  s = "MSIE";
			  if ((i = ua.indexOf(s)) >= 0){
			    this.isIE = true;
			    this.version = parseFloat(ua.substr(i + s.length));
			    return;
			  }
			
			  s = "Netscape6/";
			  if ((i = ua.indexOf(s)) >= 0){
			    this.isNS = true;
			    this.version = parseFloat(ua.substr(i + s.length));
			    return;
			  }
			
			  s = "Gecko";
			  if ((i = ua.indexOf(s)) >= 0){
			    this.isNS = true;
			    this.version = 6.1;
			    return;
			  }
			}
			
			var browser = new Browser();
			var currentButton = null;
			
			if (browser.isIE)
			  document.onmousedown = isMousedown; 	
			if (browser.isNS)
			  document.addEventListener("mousedown", isMousedown, true);
			 
			//find out if user clicked outside the menu or drop menu
			function isMousedown(event) {
			  var elmnt;
			  if (!currentButton){
			    return;
			  }
			  if (browser.isIE){
			    elmnt = window.event.srcElement;
			    //alert(elmnt.document.title)
			  }
			  else{
			    elmnt = (event.target.className ? event.target : event.target.parentNode);
			  }
			  if (elmnt == currentButton){
			    return;
			  }
			  if (elmnt.className != "menuButton" && elmnt.className != "menuItem" &&
			      elmnt.className != "menuItemSep" && elmnt.className != "menu"){
			    cleanButton(currentButton);
			    subClose(elmnt);
			  }
			
			}
			//click button to show menu and depress button
			function buttonClick(button, menuName) {
				button.blur();
			  if (!button.menu){
			    button.menu = document.getElementById(menuName);
				}
				  if (currentButton && currentButton != button){www.yahoo.com/
				    cleanButton(currentButton);
					}
						if (button.isDepressed){
						 cleanButton(button);
						}
						else{
						 depressButton(button);
						}	
			  return false;
			}
			//add border
			function buttonMouseover(button, menuName) {
			  if (currentButton && currentButton != button) {
			    cleanButton(currentButton);
			    if (menuName){
			      buttonClick(button, menuName);
			    }
			  }
			}
			//make the button look depressed :-(
			function depressButton(button) {
			  var w, dw, x, y;
			  button.className = "menuButtonActive";
			  if (browser.isIE && !button.menu.firstChild.style.width) {
			    w = button.menu.firstChild.offsetWidth;
			    button.menu.firstChild.style.width = w + "px";
			    dw = button.menu.firstChild.offsetWidth - w;
			    w -= dw;
			    button.menu.firstChild.style.width = w + "px";
			  }
			
			  x = getPageOffsetLeft(button);
			  y = getPageOffsetTop(button) + button.offsetHeight;
			  if (browser.isIE) {
			    x += 2;
			    y += 2;
			  }
			  if (browser.isNS && browser.version < 6.1){
			    y--;
			  }
			  // Position/show.www.yahoo.com/
			  button.menu.style.left = x + 'px';
			  button.menu.style.top  = y + 'px';
			  button.menu.style.visibility = 'visible';
			  button.isDepressed = true;
			  currentButton = button;
			}
			//reset button
			function cleanButton(button) {
			  button.className = "menuButton";
			  if (button.menu)
			    button.menu.style.visibility = "hidden";
			    subCloseOff();
			  
			  button.isDepressed = false;
			  currentButton = null;
			}
			
			function getPageOffsetLeft(elmnt) {
			  return elmnt.offsetLeft + (elmnt.offsetParent ? getPageOffsetLeft(elmnt.offsetParent) : 0);
			}
			
			function getPageOffsetTop(elmnt) {
			  return elmnt.offsetTop + (elmnt.offsetParent ? getPageOffsetTop(elmnt.offsetParent) : 0);
			}
			//sub menus 
			function menuRoll(which, choice, xPos, yPos){
				var x1 = xPos + "px";
				var y1 = yPos + "px";
				document.getElementById(choice).style.left = x1;
				document.getElementById(choice).style.top = y1
				document.getElementById(choice).style.visibility = "visible";
			}
			function menuOff(which,choice){
				document.getElementById(choice).style.visibility = "hidden";
			}
			// (for now)it only works with one sub menu per page named "subMenu"
			function subClose(elmnt){
				if(document.getElementById('subMenu')){
					if(elmnt.className != "menuButton"  && elmnt.className != "menuItem" && elmnt.className != "menu"){
						document.getElementById('subMenu').style.visibility = "hidden";
					}
				}	
			}
			function subCloseOff(){
				if(document.getElementById('subMenu')){
				document.getElementById('subMenu').style.visibility = "hidden";
				}
			}

//**************** slidshow  *******************************************************************


Pic = new Array;
Pic[0] = 'images/lrgGrayHouse.jpg'
Pic[1] = 'images/dualFireplace.jpg'
Pic[2] = 'images/ceiling.jpg'


Text = new Array;
Text[0] = '<p><span style="font-weight:bold">Photo One Title</span><br>text to describe photo one</p>'
Text[1] = '<p><span style="font-weight:bold">Photo Two Title</span><br>text to describe photo two</p>'
Text[2] = '<p><span style="font-weight:bold">Photo Three Title</span><br>text to describe photo three</p>'

	thisPic = 0;
	thisText = 0;
	imgCt = Pic.length - 1
	textCt = Text.length - 1
	function chgSlide(direction) {
		if (document.images) {
			thisPic = thisPic + direction
			thisText = thisText + direction
			if (thisPic > imgCt) {
				thisPic = 0
				thisText = 0
			}
			if (thisPic < 0) {
				thisPic = imgCt
				thisText = textCt
			}
			document.SlideShow.src=Pic[thisPic]
			document.getElementById("blah").innerHTML = Text[thisText] 
		}
	}
	
function HomePic(){
	document.SlideShow.src=Pic[0]
	document.getElementById("blah").innerHTML = Text[0] 
}

function pageRefresh(name){
	document.location.href=name
}


function popLarger(name){
	window.open('largePic.php?picToShow=' + name,'gallery','height=550,width=500,screenX=200,screenY=100,menubar=no,location=no,resizable=yes,scrollbars=yes,status=no')
}

function changeColor(item){
	document.getElementById(item).className="photoGallOver";
	//alert(document.item.className);
	//alert(item)
}

function changeColorBack(item){
	document.getElementById(item).className="photoGall";
	//alert(document.item.className);
	//alert(this)
}

function popFullTestimonial(name){
	window.open(name,'gallery','height=550,width=500,screenX=200,screenY=100,menubar=no,location=no,resizable=yes,scrollbars=yes,status=no')
}


function submitSearch(){
	var firstName = document.form_main.searcher_name.value;
	var lastName = document.form_main.searcher_last.value;
	var email = document.form_main.searcher_email.value;
		if(firstName == ""){
			alert("Required Field - Please Enter First Name.")
			return false;
		}
		if(lastName == ""){
			alert("Required Field - Please Enter Last Name.")
			return false;
		}
		if(email == ""){
			alert("Required Field - Please Enter Email Address.")
			return false;
		}
		if (checkEmail(email)){
	    		return true;
	    	}
	    	else{
	    		return false;
	    	}
}


function checkEmail(eAddress) {
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(eAddress)){
	return (true)
	}
	alert("Invalid E-mail Address! Please re-enter.")
	return (false)
}













