

/***********************************************
* 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
***********************************************/

    // Sridhar : added condition to fix relative url issue for BET Internal servers.
    // add the internal server name to the array below
    var serverList = ['172.20.20.24', 'betcma01', 'betcma01.web.bet.com' , '172.20.20.55' , 'stage.bet.com' ,
                      'betdevimage01' ,'localhost' , '127.0.0.1'];
                      
    var IsInternalServer = false;

    for (i=0; i<serverList.length; i++)
    {
        // test if the host server is internal or public.
        if(location.host == serverList[i] )
         IsInternalServer = true;
    }
    
    //condition to test whether the server is internal or public
    if(IsInternalServer)
    {
        //Contents for menu 1
        var betcom_menu=new Array()
        betcom_menu[0]='<a href="/www.bet.com/">BET.com home</a>'
        betcom_menu[1]='<a href="/www.bet.com/onblast">video</a>'
        betcom_menu[2]='<a href="/www.bet.com/music">music</a>'
        betcom_menu[3]='<a href="/www.bet.com/ontv">on tv</a>'
        betcom_menu[4]='<a href="/www.bet.com/news">news</a>'
        betcom_menu[5]='<a href="/www.bet.com/entertainment">entertainment</a>'
        betcom_menu[6]='<a href="/www.bet.com/lifestyle">lifestyle</a>'
        //betcom_menu[7]='<a href="http://www.bet.com/health">health</a>'
        betcom_menu[7]='<a href="/www.bet.com/community">community</a>'
    }
    else
    {
        //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 home_menu=new Array()
//home_menu[0]='<a href="http://www.javascriptkit.com">news & interviews</a>'
//home_menu[1]='<a href="http://www.freewarejava.com">videos</a>'
//home_menu[2]='<a href="http://codingforums.com">new music</a>'
//home_menu[3]='<a href="http://www.cssdrive.com">community</a>'

var video_menu=new Array()
//video_menu[0]='<a href="http://www.javascriptkit.com">news & interviews</a>'
//video_menu[1]='<a href="http://www.freewarejava.com">videos</a>'
//video_menu[2]='<a href="http://codingforums.com">new music</a>'
//video_menu[3]='<a href="http://www.cssdrive.com">community</a>'

//Contents for menu 2, and so on
var music_menu=new Array()
music_menu[0]='<a href="http://www.bet.com/music/news">news</a>'
music_menu[1]='<a href="http://www.bet.com/music/newmusic">new music</a>'
music_menu[2]='<a href="http://www.bet.com/music/videos">videos</a>'
music_menu[3]='<a href="http://www.bet.com/music/community">features</a>'


var ontv_menu=new Array()
ontv_menu[0]='<a href="http://www.bet.com/OnTV/BETshows">bet shows</a>'
ontv_menu[1]='<a href="http://www.bet.com/betj">betj</a>'
ontv_menu[2]='<a href="http://www.bet.com/OnTV/Specials">specials</a>'
ontv_menu[3]='<a href="http://www.bet.com/OnTV/Schedule">schedule</a>'
ontv_menu[4]='<a href="http://www.bet.com/OnTV/CastingCall">casting call</a>'
		
var news_menu=new Array()
news_menu[0]='<a href="http://www.bet.com/News/Features">features</a>'
news_menu[1]='<a href="http://www.bet.com/News/Blogs">blogs</a>'


var entertainment_menu=new Array()
entertainment_menu[0]='<a href="http://www.bet.com/entertainment/news">news</a>'
entertainment_menu[1]='<a href="http://www.bet.com/entertainment/movies">movies</a>'
entertainment_menu[2]='<a href="http://www.bet.com/entertainment/dvd">dvd</a>'
entertainment_menu[3]='<a href="http://www.bet.com/entertainment/photos">photos</a>'

var lifestyle_menu=new Array()
lifestyle_menu[0]='<a href="http://www.bet.com/lifestyle/style">style</a>'
lifestyle_menu[1]='<a href="http://www.bet.com/lifestyle/careers">careers</a>'
lifestyle_menu[2]='<a href="http://www.bet.com/lifestyle/b-girls">b-girls</a>'
lifestyle_menu[3]='<a href="http://www.bet.com/lifestyle/blogs">blogs</a>'

//var health_menu=new Array()
//health_menu[0]='<a href="http://cnn.com">CNN</a>'
//health_menu[1]='<a href="http://msnbc.com">MSNBC</a>'
//health_menu[2]='<a href="http://news.bbc.co.uk">BBC News</a>'



var community_menu=new Array()
community_menu[0]='<a href="http://shine.bet.com">shine</a>'
community_menu[1]='<a href="http://yaheard.bet.com">ya heard</a>'
community_menu[2]='<a href="http://www.bet.com/dating">dating</a>'
community_menu[3]='<a href="http://mobile.bet.com">mobile</a>'

				
var menuwidth='165px' //default menu width
var menubgcolor='lightyellow'  //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:999999;width:'+menuwidth+';background-color:'+menubgcolor+';z-index:233000;" 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(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)

// unhighlight the old selected tab if existant
//if(dropmenuobj._currentTabObj != null){
//	if(removeClass){
//		removeClass(dropmenuobj._currentTabObj, "primaryNavigationHover");
//	}
//}
// highlight the tab
//if(!(addClass === undefined)){	// make sure the function is available
//	addClass(obj, "primaryNavigationHover");
//}
// 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";
}

return clickreturnvalue()
}

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){
//	if(removeClass){
		Element.removeClassName(dropmenuobj._currentTabObj, 'tab_image');
		//Element.removeClassName(login_box, 'tab_image');
//	}
//}
// highlight the tab
//if(!(addClass === undefined)){	// make sure the function is available

	Element.addClassName(obj, "tab_image");
	//Element.addClassName(login_box, "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 = 13;
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";
Element.setStyle(dropmenuobj, "{background-color: #393939;}");
dropmenuobj.style.backgroundColor="#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){
			//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