// JavaScript Document
/***********************************************
* AnyLink Drop Down Menu- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

//Contents for menu 1
var ifenceproducts=new Array()
ifenceproducts[0]='<a href="stylegallery.php">Fence Styles</a>'
ifenceproducts[1]='<a href="pool.php">Pool Fences</a>'
ifenceproducts[2]='<a href="residential.php">Residential Fences</a>'
ifenceproducts[3]='<a href="commercial.php">Commercial Fences</a>'
ifenceproducts[4]='<a href="customfence.php">Custom Fences</a>'
ifenceproducts[5]='<a href="gates.php">Gates</a>'
ifenceproducts[6]='<a href="handrailing.php">Hand Railing</a>'
ifenceproducts[7]='<a href="accessories.php">Options &amp; Accessories</a>'

var ifenceservice=new Array()
ifenceservice[0]='<a href="FREEquote.php">Free Quote</a>'
ifenceservice[1]='<a href="smarttools.php">SmartTools&trade;</a>'
ifenceservice[2]='<a href="planning.php">Planning Advice</a>'
ifenceservice[3]='<a href="planningpool.php">Pool Project Advice</a>'
ifenceservice[4]='<a href="advice.php">Installation Advice</a>'
ifenceservice[5]='<a href="largeprojects.php">Large Projects</a>'
ifenceservice[6]='<a href="customfence.php">Custom Fence Solutions</a>'
ifenceservice[7]='<a href="schematics.php">Architectural Schematics</a>'

var ifenceabout=new Array()
ifenceabout[0]='<a href="aboutus.php">Our Company</a>'
ifenceabout[1]='<a href="advantage.php">Our Products</a>'
ifenceabout[2]='<a href="contactus.php">Contact Us</a>'

var ifencefaq=new Array()
ifencefaq[0]='<a href="faq.php">Frequent Questions</a>'
ifencefaq[1]='<a href="glossary.php">Glossary</a>'
ifencefaq[2]='<a href="gettingstarted.php">Getting Started</a>'
ifencefaq[3]='<a href="savemoney.php">Saving Money</a>'
ifencefaq[4]='<a href="poolsafety.php">Pool Safety</a>'
ifencefaq[5]='<a href="powdercoat.php">Powder Coating</a>'
ifencefaq[6]='<a href="smartrail.php">SmartRail&trade;</a>'
ifencefaq[7]='<a href="verticals.php">iFence Verticals&trade;</a>'

var ifenceshopping=new Array()
ifenceshopping[0]='<a href="powdercoat.php">Login</a>'
ifenceshopping[1]='<a href="powdercoat.php">My Account</a>'
ifenceshopping[2]='<a href="powdercoat.php">View Cart</a>'
ifenceshopping[3]='<a href="powdercoat.php">Checkout</a>'
ifenceshopping[4]='<a href="powdercoat.php">Track An Order</a>'

var ifenceGalleries=new Array()
ifenceGalleries[0]='<a href="idesignstudio.php">iDesign&trade; Fence Studio</a>'
ifenceGalleries[1]='<a href="photogallery.php">Photo Gallery</a>'
ifenceGalleries[2]='<a href="videogallery.php">Video Gallery</a>'

var ifencefreequote=new Array()
ifencefreequote[0]='<a href="FREEquote.php">Free Quote Worksheet</a>'
ifencefreequote[1]='<a href="planning.php">Free Quote Tutorial</a>'

var ifenceproducts2=new Array()
ifenceproducts2[0]='<a href="stylegallery.php">Fence Styles</a>'
ifenceproducts2[1]='<a href="pool.php">Pool Fences</a>'
ifenceproducts2[2]='<a href="residential.php">Residential Fences</a>'
ifenceproducts2[3]='<a href="commercial.php">Commercial Fences</a>'
ifenceproducts2[4]='<a href="customfence.php">Custom Fences</a>'
ifenceproducts2[5]='<a href="handrailing.php">Hand Railing</a>'
ifenceproducts2[6]='<a href="accessories.php">Options &amp; Accessories</a>'

var ifencegates=new Array()
ifencegates[0]='<a href="residentialgates.php">Residential</a>'
ifencegates[1]='<a href="poolgates.php">Pool Safe</a>'
ifencegates[2]='<a href="commercialgates.php">Commercial</a>'
ifencegates[3]='<a href="estategates.php">Estate Gates</a>'
ifencegates[4]='<a href="cantilever.php">Cantilever Slide Gates</a>'

var ifencefeatures=new Array()
ifencefeatures[0]='<a href="advantage.php">iFence Advantage&trade;</a>'
ifencefeatures[1]='<a href="smartrail.php">SmartRail&trade;</a>'
ifencefeatures[2]='<a href="verticals.php">iFence Verticals&trade;</a>'
ifencefeatures[3]='<a href="accessories.php#grades">Colors and Grade Specs</a>'
ifencefeatures[4]='<a href="accessories.php">Product Gallery</a>'
ifencefeatures[5]='<a href="powdercoat.php">Powder Coating</a>'

var ifencetips=new Array()
ifencetips[0]='<a href="planning.php">Planning</a>'
ifencetips[1]='<a href="planningpool.php">Pool Projects</a>'
ifencetips[2]='<a href="poolsafety.php">Pool Safety</a>'
ifencetips[3]='<a href="savemoney.php">Saving Money</a>'
ifencetips[4]='<a href="advice.php">Installation</a>'
 
var ifenceresources=new Array()
ifenceresources[0]='<a href="smarttools.php">SmartTools&trade;</a>'
ifenceresources[1]='<a href="faq.php">FAQ</a>'
ifenceresources[2]='<a href="glossary.php">Glossary</a>'
ifenceresources[3]='<a href="shipping.php">Shipping Info</a>'
ifenceresources[4]='<a href="contactus.php">Quick Answers</a>'
		
var menuwidth='125px' //default menu width
var menubgcolor='#4dbcd7'  //menu bgcolor
var disappeardelay=350  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

/////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:'+menuwidth+';background-color:'+menubgcolor+'" 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="-500px"
if (menuwidth!=""){
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 < 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 up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}


function dropdownmenu(obj, e, menucontents, menuwidth, sidemenu){
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, sidemenu)

if (sidemenu){
dropmenuobj.x=getposOffset(obj, "left")+155
dropmenuobj.y=getposOffset(obj, "top")-20
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}
else {
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"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)
}

if (hidemenu_onclick=="yes")
document.onclick=hidemenu

// Fence Style Tabs

function showCategory(tab,category) {
	var tabs=document.getElementById('tabs');
	var tablist=tabs.getElementsByTagName('li');
	for (var i=0, allTabs=tablist.length; i<allTabs; i++) {
		tablist[i].className='';
	}
	tab.className='current';
	category=document.getElementById(category);
	var overview=document.getElementById('overview');
	var gates=document.getElementById('gates');
	var theOptions=document.getElementById('options');
	var specs=document.getElementById('specs');
	var price=document.getElementById('price');
	var sample=document.getElementById('sample');
	overview.className=gates.className=theOptions.className=specs.className=price.className=sample.className='hide';
	category.className='show';
	tab.firstChild.firstChild.blur();
}