/***********************************************
* 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
***********************************************/
//I am making this one work with jquery!!


//Contents for menu 1
var betcom_menu=new Array()
betcom_menu[0]='<a href="http://www.bet.com/">BET.com home</a>'
betcom_menu[1]='<a href="http://www.bet.com/onblast">video</a>'
betcom_menu[2]='<a href="http://www.bet.com/music">music</a>'
betcom_menu[3]='<a href="http://www.bet.com/ontv">on tv</a>'
betcom_menu[4]='<a href="http://www.bet.com/news">news</a>'
betcom_menu[5]='<a href="http://www.bet.com/entertainment">entertainment</a>'
betcom_menu[6]='<a href="http://www.bet.com/lifestyle">lifestyle</a>'
//betcom_menu[7]='<a href="http://www.bet.com/health">health</a>'
betcom_menu[7]='<a href="http://www.bet.com/community">community</a>'


var blog_menu=new Array()
blog_menu[0]='Music Blogs'
blog_menu[1]='<a href="http://blogs.bet.com/music/hhvsa">Hip Hop vs. America</a>'
blog_menu[2]='<a href="http://blogs.bet.com/music/screamfest07">Screamfest 07</a>'

blog_menu[3]='On TV Blogs'
blog_menu[4]='<a href="http://blogs.bet.com/ontv/chinterns">College Hill Interns</a>'
blog_menu[5]='<a href="http://blogs.bet.com/ontv/helldate">Hell Date</a>'
blog_menu[6]='<a href="http://blogs.bet.com/ontv/keyshiacole">Keyshia Cola</a>'
blog_menu[7]='<a href="http://blogs.bet.com/shows/meetthefaith">Meet The Faith</a>'
blog_menu[8]='<a href="http://blogs.bet.com/ontv/theword">The Word</a>'

blog_menu[9]='BETJ Blogs'
blog_menu[10]='<a href="http://blogs.bet.com/betj/underdog">Beneath The Underdog</a>'

blog_menu[11]='News Blogs'
blog_menu[12]='<a href="http://blogs.bet.com/news/newsyoushouldknow">News You Should Know</a>'
blog_menu[13]='<a href="http://blogs.bet.com/news/pamela">Pamela on Politics</a>'
blog_menu[14]='<a href="http://blogs.bet.com/news/weekinmylife">Week In My Life</a>'


blog_menu[15]='Entertainment Blogs'
blog_menu[16]='<a href="http://blogs.bet.com/entertainment/spotlight">Spotlight</a>'
blog_menu[17]='<a href="http://blogs.bet.com/entertainment/stay">Stay Tuned</a>'
blog_menu[18]='<a href="http://blogs.bet.com/entertainment/whattheflick">What The Flick?</a>'

blog_menu[19]='Lifestyle Blogs'
blog_menu[20]='<a href="http://blogs.bet.com/lifestyle/collegeinsider">College Insider</a>'
blog_menu[21]='<a href="http://blogs.bet.com/lifestyle/dollaroutof">Dollar Out Of</a>'
blog_menu[22]='<a href="http://blogs.bet.com/lifestyle/heaadoverheels">Head Over Heels</a>'
blog_menu[23]='<a href="http://blogs.bet.com/lifestyle/swagger">Swagger</a>'
blog_menu[24]='<a href="http://blogs.bet.com/lifestyle/vitalsigns">Vital Signs</a>'




			
var menuwidth='165px' //default menu width
var menubgcolor='#393939'  //menu bgcolor
var disappeardelay=250  //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;z-index:1999999;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 dropdownmenutop(obj, e, menucontents, menuwidth){
    if(menucontents == null || menucontents.length == 0) return;
    if (window.event) event.cancelBubble=true
    else if (e.stopPropagation) e.stopPropagation()
    clearhidemenu()
    dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
    populatemenu(menucontents)

    //dropmenuobj._currentTabObj = obj;
    var login_box = document.getElementById('home_holder');
    // unhighlight the old selected tab if existant
    dropmenuobj._currentTabObj = obj;
    if(dropmenuobj._currentTabObj != null){
			jQuery(".tab_image").removeClass("tab_image");
    	   jQuery(obj).addClass("tab_image");
    }
    // highlight the tab
    //if(!(addClass === undefined)){	// make sure the function is available

	    //this.addClass("tab_image");
	    //$("login_box").addClass("tab_image");
    //}
    // set the new selected tab
    dropmenuobj._currentTabObj = obj;
    if (ie4||ns6){
    showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth);
    dropmenuobj.x=getposOffset(obj, "left");
    dropmenuobj.y=getposOffset(obj, "top");
    var adjustX = 0;
    var adjustY = 0;
    if (ns6)
    {
	    var adjustY = 0;
    }
    dropmenuobj.style.left=(adjustX+dropmenuobj.x-clearbrowseredge(obj, "rightedge"))+"px";
    dropmenuobj.style.top=(adjustY+dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight)+"px";
    //dropmenuobj.style.background-color: #393939;}");
    jQuery("dropmenudiv").css("background-color","#393939");
    }

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";
		}
		if(dropmenuobj._currentTabObj != null){
			jQuery(".tab_image").removeClass("tab_image");
		    
			//if(removeClass){
				//Element.removeClassName(dropmenuobj._currentTabObj, 'tab_image');
			//}
		}
	}
}

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

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

if (hidemenu_onclick=="yes")
document.onclick=hidemenu
