/***********************************************
* 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_01 (About Us)
var menu_01=new Array()
menu_01[0]='<div class="dropdown"><a href="http://www.georgehills.com/about/news.php" title="News" class="dropdown">News</a></div>'
menu_01[1]='<div class="dropdown"><a href="http://www.georgehills.com/about/leadership.php" title="Leadership" class="dropdown">Leadership</a></div>'
menu_01[2]='<div class="dropdown"><a href="http://www.georgehills.com/about/culture.php" title="Culture" class="dropdown">Culture</a></div>'
menu_01[3]='<div class="dropdown"><a href="http://www.georgehills.com/about/history.php" title="History" class="dropdown">History</a></div>'

// contents for menu_02 (Our Team)
var menu_02=new Array()
menu_02[0]='<div class="dropdown"><a href="http://www.georgehills.com/about/partners.php" title="Our Partners" class="dropdown">Our Partners</a></div>'

// contents for menu_03 (Assignment Forms)
var menu_03=new Array()
menu_03[0]='<div class="dropdown"><a href="http://www.georgehills.com/forms/aoe_coe.php" title="AOE / COE Assignment Form" class="dropdown">AOE/COE Assignment Form</a></div>'
menu_03[1]='<div class="dropdown"><a href="http://www.georgehills.com/forms/casualty.php" title="Casualty Assignment Form" class="dropdown">Casualty Assignment Form</a></div>'
menu_03[2]='<div class="dropdown"><a href="http://www.georgehills.com/forms/employment_practices.php" title="Employment Practices Assignment Form" class="dropdown">Employment Practices Assignment Form</a></div>'
menu_03[3]='<div class="dropdown"><a href="http://www.georgehills.com/forms/property.php" title="Property Assignment Form" class="dropdown">Property Assignment Form</a></div>'
menu_03[4]='<div class="dropdown"><a href="http://www.georgehills.com/forms/sub_rosa.php" title="Sub Rosa Assignment Form" class="dropdown">Sub Rosa Assignment Form</a></div>'
menu_03[5]='<div class="dropdown"><a href="http://www.georgehills.com/forms/email.php" title="Submit Via Email" class="dropdown">Submit Via Email</a></div>'

// contents for menu_04 (Locations / Contact)
var menu_04=new Array()
menu_04[0]='<div class="dropdown"><a href="http://www.georgehills.com/locations/fairfield.php" title="Fairfield" class="dropdown">Fairfield</a></div>'
menu_04[1]='<div class="dropdown"><a href="http://www.georgehills.com/locations/fremont.php" title="Fremont" class="dropdown">Fremont</a></div>'
menu_04[2]='<div class="dropdown"><a href="http://www.georgehills.com/locations/lakeport.php" title="Lakeport" class="dropdown">Lakeport</a></div>'
menu_04[3]='<div class="dropdown"><a href="http://www.georgehills.com/locations/long_beach.php" title="Long Beach" class="dropdown">Long Beach</a></div>'
menu_04[4]='<div class="dropdown"><a href="http://www.georgehills.com/locations/rancho_cordova_sacramento.php" title="Rancho Cordova / Sacramento" class="dropdown">Rancho Cordova / Sacramento</a></div>'
menu_04[5]='<div class="dropdown"><a href="http://www.georgehills.com/locations/san_bernardino.php" title="San Bernardino" class="dropdown">San Bernardino</a></div>'
menu_04[6]='<div class="dropdown"><a href="http://www.georgehills.com/locations/san_jose.php" title="San Jose" class="dropdown">San Jose</a></div>'

// global menu settings
var menuwidth='160px' // default menu width
var menubgcolor='#002664'  // 588C08 menu bgcolor
var disappeardelay=250  // menu disappear speed onMouseout (in milliseconds)
var hidemenu_onclick="yes" // hide menu when user clicks within menu?

// no further editing 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=-500
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 windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
}
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")+"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