/***********************************************
* 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 Media
var menu1=new Array()
menu1[0]='<a href="video.php?next=watch">Videos</a>'
menu1[1]='<a href="pictures.php">Pictures</a>'


//Contents for Colleges
var menu2=new Array()
menu2[0]='<a href="list_college.php">View Colleges</a>'
menu2[1]='<a href="rated_colleges.php">View Rated Colleges</a>'


//Contents for Bars N' Clubs
var menu3=new Array()
menu3[0]='<a href="list_allbar.php">Bars & Clubs</a>'
//menu3[1]='<a href="list_clubs.php">Clubs</a>'
menu3[1]='<a href="list_mybar.php">View My Bars & Clubs</a>'
//menu3[3]='<a href="list_myclub.php">View My Clubs</a>'
menu3[2]='<a href="view_statewise.php?type=bars">View Bars & Clubs By State</a>'
//menu3[5]='<a href="view_statewise.php?type=bars&cat=Club">View Clubs By State</a>'
menu3[3]='<a href="add_bar.php">Add Bar & Club</a>'
//menu3[7]='<a href="add_bar.php">Add Club</a>'
menu3[4]='<a href="add_party.php">Add Party</a>'
menu3[5]='<a href="list_myparty.php">View My Party</a>'
menu3[6]='<a href="list_allparty.php">View All Parties</a>'

//Contents for Drinks
var menu4=new Array()
menu4[0]='<a href="list_alldrinks.php?category=Domestic Beer">Domestic Beers</a>'
menu4[1]='<a href="list_alldrinks.php?category=Imported Beer">Imported Beers</a>'
menu4[2]='<a href="list_alldrinks.php?category=Micro Beer">Micro Beers</a>'
menu4[3]='<a href="list_alldrinks.php?category=Mixed Drinks">Mixed Drinks</a>'
menu4[4]='<a href="list_alldrinks.php?category=Shots">Shots</a>'
menu4[5]='<a href="list_alldrinks.php?category=Liquors">Liquors</a>'
menu4[6]='<a href="list_mydrinks.php">My Drinks</a>'
menu4[7]='<a href="add_drinks.php">Add Drinks</a>'

//Contents for Games
var menu5=new Array()
menu5[0]='<a href="list_allgame.php">View Games</a>'
menu5[1]='<a href="list_mygame.php">View My Games</a>'
menu5[2]='<a href="add_game.php">Add Game</a>'
menu5[3]='<a href="rated_game.php">Games by Rank</a>'

//Contents for Beer Pong
var menu6=new Array()
menu6[0]='<a href="beerpong.php">What is Beer Pong?</a>'
menu6[1]='<a href="ourrules.php">View House Rules</a>'
menu6[2]='<a href="houserulesgen.php">House Rules Generator</a>'
menu6[3]='<a href="#">Other BP Sites</a>'

//Contents for Models
var menu7=new Array()
menu7[0]='<a href="#">View WF Models</a>'
menu7[1]='<a href="#">How to Become a WF Model</a>'

//Contents for Upload
var menu8=new Array()
menu8[0]='<a href="upload.php">Upload Video</a>'
menu8[1]='<a href="add_picture.php">Upload Pictures</a>'
menu8[2]='<a href="add_bar.php">Add Bar & Club</a>'
//menu8[3]='<a href="add_bar.php">Add Club</a>'
menu8[3]='<a href="add_drinks.php">Add Drink</a>'
menu8[4]='<a href="add_game.php">Add Game</a>'
menu8[5]='<a href="add_party.php">Add Party</a>'
		
var menuwidth='150px' //default menu width
var menubgcolor='657886'  //menu bgcolor
var disappeardelay=90  //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){
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


  var browserOK = false;
  var pics;

  browserOK = true;
  pics = new Array();

var objCount = 0; // number of (changing) images on web-page

function preload(name, first, second) {  

  // preload images and place them in an array

  if (browserOK) {     
    pics[objCount] = new Array(25);
    pics[objCount][0] = new Image();
    pics[objCount][0].src = first;
    pics[objCount][1] = new Image();
    pics[objCount][1].src = second;
    pics[objCount][2] = name;
    objCount++;
  }
}

function on(name){
  if (browserOK) {
     for (i = 0; i < objCount; i++) {
      if (document.images[pics[i][2]] != null)
        if (name != pics[i][2]) { 
          // set back all other pictures
          document.images[pics[i][2]].src = pics[i][0].src;
        } else {
           // show the second image because cursor moves across this image
           document.images[pics[i][2]].src = pics[i][1].src;
        }
    }
  }
}

function off(){
  if (browserOK) {
     for (i = 0; i < objCount; i++) {
      // set back all pictures
      if (document.images[pics[i][2]] != null) 
        document.images[pics[i][2]].src = pics[i][0].src;
    }
  }
}

preload("images/wfnavbarsnclubs2.gif","images/wfnavhome2.gif" , "images/wfnavbeerpong2.gif" , "images/wfnavcolleges2.gif" , "images/wfnavdrinks2.gif" , "images/wfnavgames2.gif" , "images/wfnavmedia2.gif" , "images/wfnavmodels2.gif" , "images/wfnavupload2.gif");

