var arrSwf=[];
arrSwf[0]='<object zswf="off" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="84" height="156" id="bl" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="allowFullScreen" value="false" /><param name="movie" value="/images/shell3/bl.swf" /><param name="quality" value="high" /><param name="salign" value="rt" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#ffffff" />	<embed src="/images/shell3/bl.swf" quality="high" salign="rt" wmode="transparent" bgcolor="#ffffff" width="84" height="156" name="bl" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';
arrSwf[1]='<object zswf="off" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="877" height="356" id="blue-ridge-ga-real-estate" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="allowFullScreen" value="false" /><param name="movie" value="/images/shell3/blue-ridge-ga-real-estate.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#666699" />	<embed src="/images/shell3/blue-ridge-ga-real-estate.swf" quality="high" bgcolor="#666699" width="877" height="356" name="blue-ridge-ga-real-estate" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';
arrSwf[2]='<object zswf="off" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="371" height="103" id="sb" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="allowFullScreen" value="false" /><param name="movie" value="/images/shell3/sb.swf" /><param name="quality" value="high" /><param name="salign" value="lt" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#ffffff" />	<embed src="/images/shell3/sb.swf" quality="high" salign="lt" wmode="transparent" bgcolor="#ffffff" width="371" height="103" name="sb" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';
arrSwf[3]='<object zswf="off" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="75" height="170" id="br" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="allowFullScreen" value="false" /><param name="movie" value="/images/shell3/br.swf" /><param name="quality" value="high" /><param name="salign" value="lt" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#ffffff" />	<embed src="/images/shell3/br.swf" quality="high" salign="lt" wmode="transparent" bgcolor="#ffffff" width="75" height="170" name="bl" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';

var zArrObjectRegister=[];
var zAnimate=true;
var zId=false;
var zCurPos=0;
var zFinPos=0;
var zMoving=false;
var zYScroll=0;
var zTime=0;
var zBegin=0;
var zChange=0;
var zDuration=50;
var zInnerSidebar=null;
var zOuterSidebar=null;
var zSidebarBottom=null;
var zOuterPos=0;
var zInnerPos=0;
var zSBBPos=0;
var zCurUrl="";
var zScreenW=0;
var zScreenH=0;
var zMoveEnabled=true;
var zIEBrowserVersion = parseFloat(navigator.appVersion.split("MSIE")[1]);
function zSetOpacity(o,v){
	var j=o.style; 
	j.opacity=(v/100); 
	j.MozOpacity=(v/100); 
	j.KhtmlOpacity=(v/100); 
	j.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+v+",style=0)";
	if(v>=100){
		try{ j.removeAttribute("filter"); } catch(err) {}  
	}
}

function zFixPngAlpha(){
	var a=document.images;
	if ((zIEBrowserVersion >= 5.5) && (zIEBrowserVersion < 7) && (document.body.filters)) { 
		var n=0;
		for(var i=0;i<a.length;i++){
			n++;
			if(a[i].src.substr(a[i].src.length-4,4)=='.png'){
				a[i].outerHTML="<div style=\"width:160px;height:100px; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+a[i].src+"',sizingMethod='image');\"></div>";
				i--;
			}
			if(n>255) return;
		}
	}
}
//var zFixPngAlphaTempFunc=window.onload;window.onload=function(){if(typeof(zFixPngAlphaTempFunc)=="function"){try{zFixPngAlphaTempFunc();}catch(e){}}zFixPngAlpha();}
//zFixPngAlpha();
function zGetEventTarget(e){
	if(e==null){
		e=event;
		es=e.srcElement;
		ns=false;
	}else{
		ns=true;
		es=e.target;
	}
	return es;
}

function zSetObj(o,i){
	zArrObjectRegister[i]=o;
}
function zGetObj(i,m,a,a2,a3,a4,a5){
	zArrObjectRegister[i][m](a,a2,a3,a4,a5);
	/*try{
	//	eval('n.'+m+'(a,'+a2+','+a3+','+a4+','+a5+')');
	}catch(err){ alert("class id:"+i+"| method:"+m+"|"+a+"| zGetObj failed");
	ar=[];
	for(var n in zArrObjectRegister[i].arrR){
			ar.push(n+":"+zArrObjectRegister[i].arrR[n]);
	}
	alert('allobjects:'+ar);
	
	}*/
}




// Copyright (c)2005-2007 Matt Kruse (javascripttoolbox.com)
function findPos(o){
var fixBrowserQuirks = true;
var left = 0;
var top = 0;
var width = 0;
var height = 0;
var parentNode = null;
var offsetParent = null;
if(o==null){
	return;
}
offsetParent = o.offsetParent;
var originalObject = o;
var el = o; 
while (el.parentNode!=null){
  el = el.parentNode;
  if (el.offsetParent==null){
  }else{
	var considerScroll = true;
	if (fixBrowserQuirks && window.opera){
	  if (el==originalObject.parentNode || el.nodeName=="TR"){
		considerScroll = false;
	  }
	}
	if (considerScroll){
	  if (el.scrollTop && el.scrollTop>0){
		top -= el.scrollTop;
	  }
	  if (el.scrollLeft && el.scrollLeft>0){
		left -= el.scrollLeft;
	  }
	}
  }
  if (el == offsetParent){
	left += o.offsetLeft;
	
	if (el.clientLeft && el.nodeName!="TABLE"){ 
	  left += el.clientLeft;
	}
	top += o.offsetTop;
	if (el.clientTop && el.nodeName!="TABLE"){
	  top += el.clientTop;
	}
	o = el;
	if (o.offsetParent==null){
	  if (o.offsetLeft){
		left += o.offsetLeft;
	  }
	  if (o.offsetTop){
		top += o.offsetTop;
	  }
	}
	offsetParent = o.offsetParent;
  }
}
if (originalObject.offsetWidth){
  width = originalObject.offsetWidth;
}
if (originalObject.offsetHeight){
  height = originalObject.offsetHeight;
}
return [left, top, width, height];
}
function zupss(){
	zGetScreenSize();
	if ((zIEBrowserVersion >= 5.5) && (zIEBrowserVersion < 7) && (document.body.filters)) { 
		var d=document.getElementById('bgMidD');
		if(zScreenW<1005){
			if(zScreenW<955){
				d.style.width=955+'px';
			}else{
				d.style.width=zScreenW+'px';
			}
		}else{
			d.style.width=1005+'px';
		}
	}
}
window.onresize=zupss;
window.onload=zupss;
zupss();
function zscr3(){
	if(!zMoveEnabled) return;
	if(zInnerSidebar==null){
		if (navigator.userAgent.indexOf("Firefox")!=-1){
			zAnimate=false;	
		}
		zupss();
		zInnerSidebar=document.getElementById('iSidebar');
		zOuterSidebar=document.getElementById('oSidebar');
		zSidebarBottom=document.getElementById('zSidebarBottom');
	}
	zOuterPos=findPos(zOuterSidebar);
	zInnerPos=findPos(zInnerSidebar);
	zSBBPos=findPos(zSidebarBottom);	
	if(window.scrollY != null){
		zYScroll=window.scrollY;
	}else if(window.body != null && window.body.scrollTop != null){
		zYScroll=window.body.scrollTop;
	}else if(document.documentElement.scrollTop != null){
		zYScroll=document.documentElement.scrollTop;
	}else if(window.pageYOffset != null){
		zYScroll=window.pageYOffset;
	}
	if(zYScroll<100){
		zscr2();
		zCurPos=0;
		zFinPos=0;
		zTime=zDuration;
		zMoving=false;
		zInnerSidebar.style.top=zCurPos+'px';
		clearInterval(zId);
		zId=false;
		return;
	}
	if(zCurUrl!=window.location.href){
		zCurUrl=window.location.href;
		zscr2();
		zCurPos=zFinPos;
		zTime=zDuration;
		zInnerSidebar.style.top=zCurPos+'px';
		return;
	}
	if(zScreenH<zInnerPos[3]){
		return;
	}
	if(!zMoving){
		zMoving=true;
		setTimeout('zscr2()',300);
	}
}
function zscr2(){
	zMoving=false;
	zFinPos=zYScroll-zOuterPos[1];
	if(zFinPos>(zSBBPos[1]-zInnerPos[3])-zOuterPos[1]){
		zFinPos=(zSBBPos[1]-zInnerPos[3])-zOuterPos[1];
	}
	if(zFinPos<0){
		zFinPos=0;
	}
	zChange=zFinPos-zCurPos;
	if(zChange==0){
		return;
	}
	if(zId==false){
		zId=setInterval(zscr,1);
	}
	zDuration=Math.max(1,Math.round(Math.min(300,Math.abs(zFinPos-zCurPos))*0.2));
	zTime=0;
	zBegin=zCurPos;
	if(zAnimate==false){
		zCurPos=zFinPos;
		zTime=zDuration;
		zInnerSidebar.style.top=zCurPos+'px';
	}
	zscr();
}
function easeInOut (t, b, c, d) {
	if ((t/=d/2) < 1) return c/2*t*t*t + b;
	return c/2*((t-=2)*t*t + 2) + b;
}
function zscr(){
	zCurPos=easeInOut (zTime, zBegin, zChange, zDuration);
	zInnerSidebar.style.top=Math.round(zCurPos)+'px';
	if(zTime<zDuration){
		zTime++;
	}else{
		if(zId!=false){
			clearInterval(zId);
			zId=false;
		}
		zMoving=false;
	}
}
function zGetScreenSize(){
if (window.innerWidth) {
zScreenW=window.innerWidth;
}
else if (document.documentElement && document.documentElement.clientWidth) {
zScreenW=document.documentElement.clientWidth;
}
else if (document.body) {
zScreenW=document.body.clientWidth;
}
if (window.innerHeight) {
zScreenH=window.innerHeight;
}
else if (document.documentElement && document.documentElement.clientHeight) {
zScreenH=document.documentElement.clientHeight;
}
else if (document.body) {
zScreenH=document.body.clientHeight;
}
}


function insertComment(comm, fplan){
	var z=document.getElementById('zFooterDiv');
	z.style.display="block";
	commentArr = document.getElementById("inquiries_comments");
	var ih= document.getElementById("inquiryHeader");
	focusArr = document.getElementById("inquiries_first_name");
	if(fplan==null){
		commentArr.value = "I'm interested in the "+comm+" community.";
		ih.innerHTML='<h2>'+comm+' Community</h2>';
	}else{
		ih.innerHTML='<h2>'+comm+" Community<br>"+fplan+' Floorplan</h2>';
		commentArr.value = "I'm interested in the "+comm+" community and the "+fplan+" floorplan.";
		//document.getElementById("text").src = document.getElementById(fplan+"Text").src;
		//document.getElementById("text").style.display="inline";
		document.getElementById("thumb").src = document.getElementById(fplan+"Gif").src;
		document.getElementById("inquiryFeet").innerHTML = document.getElementById(fplan+"Feet").innerHTML;
		document.getElementById("thumb").style.display="inline";
		//document.getElementById("logos").style.display="block";
	}
	window.location.href='#contactForm';
	focusArr.focus();
}


// id is any string, pauseMS and fadeMS are times in milliseconds
function zSlideShow(arrImage,width,height,id,pauseMS,fadeFrames,bgColor){
	this.zId=id;
	this.zImg=arrImage;
	this.zImgPre=[];
	this.pauseMS=Math.max(10,pauseMS);
	this.fadeFrames=Math.max(1,fadeFrames);
    this.zCurImg=0;
	for(var i=0;i<this.zImg.length;i++){
		this.zImgPre[i]=new Image;
		this.zImgPre[i].src=this.zImg[i];
	}
	zSetObj(this,this.zId);
	// relative div with 2 children absolute divs on top of each other with 1 img child each
	u='<div style="position:relative;width:'+width+'px;height:'+height+'px;overflow:hidden;"><div style="z-index:1;position:absolute;width:'+width+'px;height:'+height+'px;top:0px;left:0px;z-index:1;background-color:'+bgColor+';"><img id="zSS'+this.zId+'-1" src="'+this.zImg[0]+'" width="'+width+'" height="'+height+'" /></div><div style="z-index:2;position:absolute;width:'+width+'px;height:'+height+'px;top:0;left:0;z-index:2;background-color:'+bgColor+';"><img id="zSS'+this.zId+'-2" src="'+this.zImg[0]+'" width="'+width+'" height="'+height+'"  /></div></div>';
	document.write(u);
    setTimeout('zGetObj("'+this.zId+'","nextImage")',10);
}
zSlideShow.prototype.nextImage=function(){
    var i1=document.getElementById("zSS"+this.zId+"-1");
    var i2=document.getElementById("zSS"+this.zId+"-2");
	// load image to bottom div->img (1 is bottom)
    if(i1.parentNode.style.zIndex==1){
    	this.c1=i1;
        this.c2=i2;
    }else{
    	this.c1=i2;
        this.c2=i1;
    }
	//this.c2.width=this.zImgPre[this.zCurImg].width;
	//this.c2.height=this.zImgPre[this.zCurImg].height;
	
    if(this.c1.src!=this.zImg[this.zCurImg]){
    	this.c1.src=this.zImg[this.zCurImg];
	}
	// make bottom the next image, reset to 0 and put it on top
    this.zCurImg++;
    if(this.zCurImg>=this.zImg.length){
    	this.zCurImg=0;
    }
    this.c1.src=this.zImg[this.zCurImg];
	this.c1.width=this.zImgPre[this.zCurImg].width;
	this.c1.height=this.zImgPre[this.zCurImg].height;
    zSetOpacity(this.c1.parentNode,0);
    this.c1.parentNode.style.zIndex=2;
    this.c2.parentNode.style.zIndex=1;
    setTimeout('zGetObj("'+this.zId+'","startFade")',this.pauseMS);
}
zSlideShow.prototype.startFade=function(){
	this.c1.width=this.zImgPre[this.zCurImg].width;
	this.c1.height=this.zImgPre[this.zCurImg].height;
    this.opacity=0;
    clearInterval(this.fadeIntervalId);
    this.fadeIntervalId=setInterval('zGetObj("'+this.zId+'","updateFade")',5);
}
zSlideShow.prototype.updateFade=function(){
	this.c1.width=this.zImgPre[this.zCurImg].width;
	this.c1.height=this.zImgPre[this.zCurImg].height;
    // fade in top div
	this.opacity+=101/this.fadeFrames;
    if(this.opacity>=101){
    	zSetOpacity(this.c1.parentNode,100);
    	clearInterval(this.fadeIntervalId);
    	setTimeout('zGetObj("'+this.zId+'","nextImage")',1);
    }else{
    	zSetOpacity(this.c1.parentNode,this.opacity);
	}
}

