// JavaScript Document
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function open_win(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
// Function to Clear intial value in a form field
function clearText(thefield){
if (thefield.defaultValue==thefield.value)
thefield.value = ""
}
function close_window() {
    window.close();
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
// Begin Drop Menus
var mmOpenContainer = null;
var mmOpenMenus = null;
var mmHideMenuTimer = null;
var activeLink = null;

function MM_menuStartTimeout(hideTimeout) {
	mmHideMenuTimer = setTimeout("MM_menuHideMenus()", hideTimeout);	
}

function MM_menuResetTimeout() {
	if (mmHideMenuTimer) clearTimeout(mmHideMenuTimer);
	mmHideMenuTimer = null;
}

function MM_menuHideMenus() {
	MM_menuResetTimeout();
	if(mmOpenContainer) {
		var c = document.getElementById(mmOpenContainer);
		c.style.visibility = "inherit";
		mmOpenContainer = null;
	}
	if( mmOpenMenus ) {
		for(var i in mmOpenMenus) {
			var m = document.getElementById(mmOpenMenus[i]);
			m.style.visibility = "hidden";			
		}
		mmOpenMenus = null;
	}
	if(activeLink) {
		var l = document.getElementById(activeLink);
		if (l.className == "hover") {
			l.className = "";
		}
		activeLink = null;
	}
}

function MM_menuHideSubmenus(menuName) {

	if( mmOpenMenus ) {
		var h = false;
		var c = 0;
		for(var i in mmOpenMenus) {			
			if( h ) {
				var m = document.getElementById(mmOpenMenus[i]);
				m.style.visibility = "hidden";
			} else if( mmOpenMenus[i] == menuName ) {
				h = true;
			} else {
				c++;
			}
		}
		mmOpenMenus.length = c+1;
	}
}

function MM_menuOverMenuItem(menuName, subMenuSuffix) {
	MM_menuResetTimeout();
	MM_menuHideSubmenus(menuName);
	if( subMenuSuffix ) {
		var subMenuName = "" + menuName + "_" + subMenuSuffix;
		MM_menuShowSubMenu(subMenuName);
	}
}

function MM_menuShowSubMenu(subMenuName) {
	MM_menuResetTimeout();
	var e = document.getElementById(subMenuName);
	e.style.visibility = "inherit";
	if( !mmOpenMenus ) {
		mmOpenMenus = new Array;
	}
	mmOpenMenus[mmOpenMenus.length] = "" + subMenuName;
}

function MM_menuShowMenu(containName, menuName, xOffset, yOffset, triggerName, linkName) {
	MM_menuHideMenus();
	MM_menuResetTimeout();
	MM_menuShowMenuContainer(containName, xOffset, yOffset, triggerName, linkName);
	MM_menuShowSubMenu(menuName);
	pad(linkName);
}

function MM_menuShowMenuContainer(containName, x, y, triggerName, linkName) {	
	var c = document.getElementById(containName);
	var s = c.style;
	s.visibility = "inherit";
	
	mmOpenContainer = "" + containName;
	activeLink = linkName;
}
// End Drop Menus

function pad(linkName) {
	theLink = document.getElementById(linkName);
	if (theLink.className == "") {
		theLink.className = "hover";
	}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

// Random Testimonial Quotes

var quotes = new Array(10);
quotes[0] = 'We would like to extend a big "THANK YOU" to you and to all the associates at Bob Schmitt Homes.  We love the home that you designed for us; it is beautiful and so comfortable to live in.  From the moment we visited the idea homes we knew we had made the right decision to choose a home in Ridgefield.<img src="/images/bg/right-quote.gif" width="17" height="15" border="0" id="right-quote" /></p><p class="sig-link">Marv &amp; Cathy';
quotes[1] = 'Thank you to each and every one of you, for such a beautiful house and for making this process a fantastic experience.<img src="/images/bg/right-quote.gif" width="17" height="15" border="0" id="right-quote" /></p><p class="sig-link">Ron &amp; Trish';
quotes[2] = 'The craftsmanship in our home is excellent.  We could not have asked for a more professional group of individuals to work with.  Each craftsman desires personal recognition for his or her contribution.  Again - thank you one and all.<img src="/images/bg/right-quote.gif" width="17" height="15" border="0" id="right-quote" /></p><p class="sig-link">Diane &amp; Bruce';
quotes[3] = 'From the first day we drove through, we were impressed by the landscaping and the appearance of the homes.  We look forward to many more years enjoying the surroundings, the neighbors, and the ambiance of Ridgefield.<img src="/images/bg/right-quote.gif" width="17" height="15" border="0" id="right-quote" /></p><p class="sig-link">Bob &amp; Loretta';
quotes[4] = 'I would like to thank you for the wonderful job you did on building our home, and development.  I am very fortunate to live in such a great community.  Thank you very much for all that you&rsquo;ve done to my neighborhood.<img src="/images/bg/right-quote.gif" width="17" height="15" border="0" id="right-quote" /></p><p class="sig-link">Caitlyn';
quotes[5] = 'We cannot thank everyone enough that was involved in creating and building our home.<img src="/images/bg/right-quote.gif" width="17" height="15" border="0" id="right-quote" /></p><p class="sig-link">Jerry';
quotes[6] = 'With your guidance and suggestions we have a home that is attractive, functional, practical and charming!  We never felt pushed into upgrading or doing more than we really wanted with the upgrades.  The Schmitt standards are outstanding and the upgrades that we did are perfect.<img src="/images/bg/right-quote.gif" width="17" height="15" border="0" id="right-quote" /></p><p class="sig-link">Jane &amp; Joe';
quotes[7] = 'We love our new home!  The workmanship is excellent and the house was clean and move in ready right on time.  You can be sure that as we show off our new home to friends we will extol the merits of the Bob Schmitt experience.<img src="/images/bg/right-quote.gif" width="17" height="15" border="0" id="right-quote" /></p><p class="sig-link">Ray &amp; Linda';
quotes[8] = 'Theresa and I have now been in our home for one year.  I just wanted to thank you and the rest of the staff again for building such a wonderful home.<img src="/images/bg/right-quote.gif" width="17" height="15" border="0" id="right-quote" /></p><p class="sig-link">Earl';
quotes[9] = 'We want to express our sincere pleasure with our new home and with all of the people we have dealt with at Bob Schmitt Homes.  Without exception this has been a really positive experience for us.<img src="/images/bg/right-quote.gif" width="17" height="15" border="0" id="right-quote" /></p><p class="sig-link">Ken &amp; Sylvia';

function randomQuote() {
	var num = Math.floor(Math.random()*quotes.length);
	document.write(quotes[num]);
}

// Copyright year snippet
function setCopyright(element)
{
var date = parseInt(element.innerText);
var year = new Date().getFullYear();
if(year > date)
element.innerText = date + "-" + year;
else
element.innerText = date;
}
