// Tagcloud colors
var customSettings = {
        tagCloudGradient: {
            topColor: 'CA1818',
            bottomColor: '8A0000'
        },
        tagCloudCorners: {
        	radius: '0'
        }
};
jQuery(document).ready(function(){
	//jQuery("body:not[#media-transcript]").children("div").css("width","980").css("margin","0 auto");
	jQuery(".ez-snippetMod-block").each(function(){
		jQuery(this).children(".ez-snippetMod-item:last").css("border-bottom","0");
		//Added by JB to remove unnecessary padding under last items in a list
		jQuery(this).children(".ez-snippetMod-item:last").css("margin-bottom","0")   
	});
	
	//highjacking the ESPN Search Video box
	try {
		document.forms[1].elements[0].name='q';
		document.forms[1].action = EVERYZING.baseSearchUrl;
	} catch (e) {}
});

// This is to override some defective menu behavior
jQuery(document).ready(function() {
	window.ShowLayer = function(el) {
	  var showEl = "gn" + el;
	  if (!DOM) return;
	  clearTimeout(timer);
	  HideAllLayers();
	  isOver = true;
	  var w_El = document.getElementById(showEl);
	  w_Anchor = "nav_" + el;
	  if (document.getElementById(w_Anchor)){
	    myObject = document.getElementById(w_Anchor);
	    //ddLeft = myObject.offsetLeft;
	    while (myObject.offsetParent) {
	      ddTop += myObject.offsetTop;
	      ddLeft += myObject.offsetLeft;
	      myObject = myObject.offsetParent;
	    }
	    ddTop += 21;
	    ddLeft -= 1;
	  }
	  if (w_El.className == "dd1") {var w_ElWidth = 130;}
	  else if (w_El.className == "dd2") {var w_ElWidth = 130;}
	  
	  if ((ddLeft + w_ElWidth) > document.body.clientWidth) {
	    ddLeft = document.body.clientWidth - w_ElWidth;
	  }
	  //console.log(ddLeft, document.body.clientWidth);
	  w_El.style.top = ddTop+"px";
	  w_El.style.left = ddLeft +"px";
	  ToggleSelect('hidden');
	  for (i = 0; i < tt.length; i++) {
	    w_nav = "nav_" + tt[i][1];
	    if (document.getElementById(w_nav)) {
	      w_nav = document.getElementById(w_nav);
	      if (w_nav.className == "navElOn") w_nav.className = "navElOnOver";
	    }
	  }
	  document.getElementById(w_Anchor).className = "navElOver";
	  w_El.style.visibility = "visible";
	  ddTop = 0; ddLeft = 0;
	}
});


jQuery(document).ready(function() {
	window.ShowChildLayer = function(childm, mItem) {
	  var childm = "gn" + childm;
	  clearTimeout(timer);
	  HideChildLayers();
	  var w_El = document.getElementById(childm);
	  if (document.getElementById(mItem)){
	    var myObject = document.getElementById(mItem);
	    while (myObject.offsetParent) {
	      ddTop = ddTop + myObject.offsetTop;
	      ddLeft = ddLeft + myObject.offsetLeft;
	      myObject = myObject.offsetParent;
	    }
	  }
	  if (w_El.className == "dd1") {var w_ElWidth = 130;}
	  else if (w_El.className == "dd2") {var w_ElWidth = 130;}
	  if ((ddLeft + (2*w_ElWidth)) > document.body.clientWidth) {
	    w_El.style.top = ddTop - 2+"px";
	    w_El.style.left = ddLeft - 127 +"px";
	  }
	  else {
	    w_El.style.top = ddTop - 2+"px";
	    w_El.style.left = ddLeft + 117+"px";
	  }
	
	  w_El.style.visibility = "visible";
	  ddTop = 0; ddLeft = 0;
	}
});
