var address="The Westminster";
var realter1="";  /// will be in larger font
var realter2="<table width=50% border='0' align='center'>  <tr>     <td bgcolor='#FFFFFF' valign=top height='330'>       <div align='center'>         <p>&nbsp;</p>        <p><img src='Knocker-100x289-final.jpg' width='156' height='283' border='0'></p>      </div>    </td>    <td bgcolor='FFFFFF' width=10% height='330'>       <p align='center'><font face='Arial, Helvetica, sans-serif'><img src='McNaughtonHomes2.jpg' width='294' height='62'><br>        4400 Deer Path Road Suite 201 Harrisburg, PA 17110<br>        Phone (717) 234-4000<br>        Fax (717) 234-2000 </font></p>      </td>  </table>"
var google_map=""; /// do not use
var address_for_email= "Westminster VFP%20";
var realter_email="mailto:vshannon@mcnaughtonco.com?subject=Westminster VFP";
var realter_url="http://www.mcnaughtonhomes.com";
var floor_name= new Array;
var floor_file= new Array;

floor_name[0]="First Floor";
floor_file[0]="index.html";
floor_name[1]="Second Floor";
floor_file[1]="floor2.html";


var NL=  (document.location.search=="?nl");
var current_image;
var current_dot,floorplan_x,floorplan_y;
var index=0;
var old_x=0;
var old_y=0;

function change(room) {
current_image.src='green.jpg';
document.camera.src=room;
current_image=document.getElementById(dot_from_image[room]);
current_image.src='blue.jpg';

};






function print_address(){
     document.writeln(address);
}


function print_realter(){

if (NL)
{

}
else
{
document.write("<td bgcolor='#FFFFFF' colspan=2><div align='center'><span style='color:6D0904'>");
if (realter1.length>0)
{
   document.write("<p><font face='Arial, Helvetica, sans-serif'><b>");
   document.write("<font color='#6D0904' size='5'>");
   document.write(realter1);
   document.writeln("<br></font></b></font>");
};
document.write("<font face='Arial, Helvetica, sans-serif'><font color='#6D0904'><b>");
document.writeln(realter2);
document.writeln("</font></b></font></p></span></div>");
document.writeln("</td>");

}; // end of if (NL)


};

function print_buttons(){

document.writeln("<td colspan='2'><table width='100%'><tbody><tr><td><p>");
document.write("<a href='flier.pdf'><img src='floorplan.jpg' border='1' height='77' width='72'></a>");
document.write("<a href=\"javascript:change('houseinfo.jpg')\"><img src='infosheet.jpg' border='1' height='77' width='72'></a>");
document.write("<a href='flierphoto.pdf'><img src='flyer.jpg' border='1' height='77' width='72'></a>");
if (google_map.length>0)
 {
document.write("<a href='");
document.write(google_map);
document.write("'><img src='areamap.jpg' border='1' height='77' width='72'></a>");
  };
document.write("<a href='http://www.shephill.com/forward.php?address=");
document.write(address_for_email);
document.write("'><img src='tellafriend.jpg' border='1' height='77' width='72'></a>");
if (!NL) {
document.write("<a href='");
document.write(realter_email);
document.write("'><img src='contactme.jpg' border='1' height='77' width='72'></a>");
document.write("<a href='");
document.write(realter_url);
document.write("'><img src='website.jpg' border='1' height='77' width='72'></a>");
   }; // don't print these buttons in the no-logo_version
document.writeln("</p></td>"); 


};

function floors(){
document.writeln("<td valign='top' width='44%'><form name='form1' method='post' action=''>"); 
document.writeln("<table border='1' cellpadding='0' cellspacing='0' height='78' width='98%'><tbody><tr>");
document.writeln("<td height='59' valign='middle'><div align='center'>");
document.writeln("<select name='select' onchange=\"window.open(this.options[this.selectedIndex].value,'_self')\">");
for (var n=0;n<floor_file.length;n++)
   {
    document.write("<option value='",floor_file[n]);
    if(NL){ document.write("?nl"); };
    document.write("'");
   if (document.location.href.indexOf(floor_file[n] )>0)
                {document.write(" selected='SELECTED' ");};
    document.write(">",floor_name[n],"</option>");

   };

document.writeln("</select><img src='pointer.jpg' height='23' width='42'>Select Additional Views Here </div></td>");
document.writeln("</tr></tbody></table></form></td></tr></tbody></table></td>");


};


function getOffsetLeft (el) {
var ol = el.offsetLeft;
 while ((el = el.offsetParent) != null)
 ol += el.offsetLeft;
 return ol;
}
function getOffsetTop (el) {
 var ot = el.offsetTop;
 while((el = el.offsetParent) != null)
 ot += el.offsetTop;
 return ot;
}


function reset_dots() {
var n;
var dot;
floorplan_x=getOffsetLeft(document.floorplan);
floorplan_y=getOffsetTop(document.floorplan);
if (( floorplan_x == old_x)&&(floorplan_y == old_y))
   { 
     return; // don't bother if nothing has changed
   };
  
old_x=floorplan_x;old_y=floorplan_y;
for(n in dot_xpos)
   {
   //  alert(n);
     dot = document.getElementById(n);
     dot.style.left = floorplan_x+dot_xpos[n] + "px"
     dot.style.top = floorplan_y+dot_ypos[n] + "px"

   };
};



function create_dots() {
var n;
var dot;
floorplan_x=getOffsetLeft(document.floorplan);
floorplan_y=getOffsetTop(document.floorplan);

for(n in dot_xpos)
    {
    document.write("<img id='",n,"' src='red.jpg' style='position:absolute;left:", floorplan_x+dot_xpos[n]);
    document.write("px;top:",floorplan_y+dot_ypos[n],"px;'");
    document.write(" onclick=\"javascript:change('",dot_image[n],"')\">");
    dot_from_image[dot_image[n]]=n;
    };
current_image=document.getElementById(dot_from_image[DEFAULT_IMAGE]);
current_image.src='blue.jpg';
}

