// JavaScript Document
//<![CDATA[

/***********************************************
* 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 menu1=new Array()
menu1[0]='<a href="dates.php" title="Dates and Prices">Dates and Prices</a>'
menu1[1]='<a href="location.php" title="Location">Location</a>'
menu1[2]='<a href="public-notices.php" title="Public Notices">Public Notices</a>'
menu1[3]='<a href="safety-policy.php" title="Safety Policy">Safety Policy</a>'
menu1[4]='<a href="history.php" title="History of the Show">History of the Show</a>'

//Contents for menu 2, and so on
var menu2=new Array()
menu2[0]='<a href="attractions.php" title="Attractions ">Attractions </a>'
menu2[1]='<a href="events.php" title="Events ">Events </a>'
menu2[2]='<a href="showground-map.php" title="Map of Showground ">Showground Map</a>'
menu2[3]='<a href="trade-stands.php" title="Map of Trade Stands ">Trade Stands</a>'
	
//Contents for menu 3, and so on
var menu3=new Array()
menu3[0]='<a href="awards.php" title="Awards ">Award Categories</a>'
menu3[1]='<a href="results.php" title="Results">Results</a>'
menu3[2]='<a href="events.php" title="Events ">Events</a>'
menu3[3]='<a href="entry-details.php" title="Entry Details">Entry Details</a>'
menu3[4]='<a href="contestants-form.php" title="Entry Forms ">Entry Forms</a>'

//Contents for menu 4, and so on
var menu4=new Array()
menu4[0]='<a href="contact.php" title="Contact Details ">Contact Details </a>'
menu4[1]='<a href="events.php" title="Events ">Events </a>'
menu4[2]='<a href="enquiry-form.php" title="Enquiry Form  ">Enquiry Form</a>'
menu4[3]='<a href="survey.php" title="Visitor Survey">Visitor Survey</a>'

var menu5=new Array()
menu5[0]='<a href="gallery-2011.htm" title="2010 Gallery">2011 Gallery </a>'
menu5[1]='<a href="gallery-2010.htm" title="2010 Gallery">2010 Gallery </a>'
menu5[2]='<a href="gallery-2009.htm" title="2009 Gallery">2009 Gallery </a>'
menu5[3]='<a href="gallery-2008.htm" title="2008 Gallery">2008 Gallery </a>'
menu5[4]='<a href="members-gallery.htm" title="2007 Gallery">2007 Gallery</a>'
menu5[5]='<a href="agm.php" title="Annual Dinner and AGM">Annual Dinner + AGM</a>'

var menu6=new Array()
menu6[0]='<a href="links.php" title="External Links  ">External Links </a>'
menu6[1]='<a href="sponsors.php" title="Sponsors  ">Sponsors </a>'
menu6[2]='<a href="blogs.php" title="Blogs"> Blogs </a>'
menu6[3]='<a href="community-projects.php" title="Community Projects">Community Projects</a>'

var menu7=new Array()
menu7[0]='<a href="http://www.dataservices-uk.net/laddiy//mem-login.asp" title="Members" target="_blank">Log-in</a>'
menu7[1]='<a href="http://www.dataservices-uk.net/laddiy/registration/default.asp" title="Register" target="_blank"> Register</a>'

var menu8=new Array()
menu8[0]='<a href="trade-stand.php" title="Application">Application</a>'
menu8[1]='<a href="advertising.php " title="Advertising">Advertising</a>'
menu8[2]='<a href="http://mothership.eu.org/stats/camborne-show.org.uk/" title="Web Stats" target="_blank">Website Statistics</a>'
menu8[3]='<a href="http://www.camborne-show.org.uk/stats/" title="Stats Pre May 2011" target="_blank">Stats Pre May 2011</a>'
menu8[4]='<a href="safety-policy.php" title="Safety Policy">Safety Policy</a>'

var menuwidth='135px' //default menu width
var menubgcolor='#FEFCD7'  //menu bgcolor
var disappeardelay=550  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="no" //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=-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-10
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){
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=130+getposOffset(obj, "left")  //Javascript edited to include a 130px offset on the x-axis
dropmenuobj.y=getposOffset(obj, "top")-20    //Javascript edited to include a -20px offset on the y-axis
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
//]]>
