
//Contents for menu 1
var menu1=new Array()
menu1[0]='<a href="timberframe_homes.html">Timberframe Homes</a>'
menu1[1]='<a href="sips.html">Structural Insulated Panels (SIPs)</a>'
menu1[2]='<a href="heavy_timber_trusses.html">Heavy Timber Trusses</a>'
menu1[3]='<a href="architectural_accents.html">Architectural Accents</a>'
menu1[4]='<a href="steel_bronze.html">Steel and Bronze</a>'
menu1[5]='<a href="commercial_heavy_timber.html">Commercial Heavy Timber</a>'
menu1[6]='<a href="a_b_r_arenas.html">Agricultural Buildings and Riding Arenas</a>'
menu1[7]='<a href="material_choices.html">Material Choices</a>'


//Contents for menu 2, and so on
var menu2=new Array()
menu2[0]='<a href="cnc_robotic_timber_joinery.html">CNC Robotic Timber Joinery</a>'
menu2[1]='<a href="home_design_engg.html">Home Design and Engineering</a>'
menu2[2]='<a href="comp_aided_draftin.html">Computer Aided Drafting</a>'
menu2[3]='<a href="installation.html">Installation</a>'
menu2[4]='<a href="worldwide_shipping.html">Worldwide Shipping</a>'


//Contents for menu 3, and so on
var menu3=new Array()
menu3[0]='<a href="faq.html">Timberframe FAQ</a>'
menu3[1]='<img src="images/pdf.gif" width="15" height="15" hspace="2"><a href="pdf/TimberframeDesignGuide.pdf" target="new">Timberframe Design Guide</a>'
menu3[2]='<img src="images/pdf.gif" width="15" height="15" hspace="2"><a href="pdf/OurBrochure.pdf" target="new">Our Brochure</a>'
menu3[3]='<img src="images/pdf.gif" width="15" height="15" hspace="2"><a href="pdf/InsulspanSIPbrochure.pdf" target="new">Insulspan SIP Brochure</a>'
menu3[4]='<img src="images/pdf.gif" width="15" height="15" hspace="2"><a href="pdf/SIPInstallationManual.pdf" target="new">SIP Installation Manual</a>'
menu3[5]='<img src="images/pdf.gif" width="15" height="15" hspace="2"><a href="pdf/SIP_ICC_Report.pdf" target="new">SIP ICCE Report</a>'
menu3[6]='<a href="doc/SIP_Architectual_Specs.doc">SIP Architectual Specs</a>'
menu3[7]='<a href="comparisons.html">Commercial Timber Cost Comparisons</a>'
menu3[8]='<a href="contactus.html">Request More Info</a>'
menu3[9]='<a href="links/helpfulbuildinglinks.html">Other Building Resources</a>'
menu3[10]='<a href="links/selectmountainandwaterfrontrealestatelinks.html">Land Resources and Opportunities</a>'

//Contents for menu 4, and so on
var menu4=new Array()
menu4[0]='<a href="our_advantage.html">Our Advantage</a>'
menu4[1]='<a href="timberframe_homes.html">Timberframe Homes</a>'
menu4[2]='<a href="sips.html">Structural Insulated Panels (SIPs)</a>'
menu4[3]='<a href="heavy_timber_trusses.html">Heavy Timber Trusses</a>'
menu4[4]='<a href="architectural_accents.html">Architectural Accents</a>'
menu4[5]='<a href="steel_bronze.html">Steel and Bronze</a>'
menu4[6]='<a href="commercial_heavy_timber.html">Commercial Heavy Timber</a>'
menu4[7]='<a href="a_b_r_arenas.html">Agricultural Buildings and Riding Arenas</a>'
menu4[8]='<a href="material_choices.html">Material Choices</a>'


var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var horizontaloffset=2 //horizontal offset of menu from default location. (0-5 is a good value)

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width: 160px" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top=-500
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x-obj.offsetWidth < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure+obj.offsetWidth
}
else{
var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move menu up?
edgeoffset=dropmenuobj.contentmeasure-obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either? (position at top of viewable window then)
edgeoffset=dropmenuobj.y
}
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}


function dropdownmenu(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+obj.offsetWidth+horizontaloffset+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+"px"
}

return clickreturnvalue()
}

function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}
