
function popup_window(url,width,height){
var features="status=0,menubar=0,location=0,toolbar=0";
if (!isNaN(parseInt(width))){features+=",width="+width;}
if (!isNaN(parseInt(height))){features+=",height="+height;}
if (typeof(window.screenLeft)!="undefined"){
features+=",left="+window.screenLeft;
features+=",left="+Math.round(window.screenLeft+((document.body.clientWidth/2)-(width/2)));
}else if (typeof(window.screenX)!="undefined"){
features+=",left="+Math.round(window.screenX+((window.outerWidth/2)-(width/2)));
}
if (typeof(window.screenTop)!="undefined"){
features+=",top="+window.screenTop;
features+=",top="+Math.round(window.screenTop+150);
}else if (typeof(window.screenY)!="undefined"){
features+=",top="+Math.round(window.screenY+((window.outerHeight-window.innerHeight)+150));
}
var popupWin=window.open(url,"popupWin",features);
if (popupWin.focus){popupWin.focus();}
}
function toggle_imagetabs(){
if (document.getElementById(arguments[0])){
toggle_display(arguments[0],true);
toggle_tab_image(arguments[0],true);
if (arguments.length>1){
for (var i=1;i<arguments.length;i++){
if (document.getElementById(arguments[i]) && arguments[i]!=arguments[0]){
toggle_display(arguments[i],false);
toggle_tab_image(arguments[i],false);
}
}
}
}
}
var maxmini_photo=new Array(),activemini_photo=new Array();
function swapmini_photo(id,direction){
if (typeof(maxmini_photo[id])=="undefined" && document.getElementById("mini_photo"+id+"."+1)){
maxmini_photo[id]=activemini_photo[id]=1;
while (document.getElementById("mini_photo"+id+"."+(++maxmini_photo[id]))){}
maxmini_photo[id]--;
}
if (maxmini_photo[id]>1){
toggle_display("mini_photo"+id+"."+activemini_photo[id],false);
if (direction=="next"){
if (document.getElementById("mini_photo"+id+"."+(activemini_photo[id]+1))){
toggle_display("mini_photo"+id+"."+(++activemini_photo[id]),true);
}else{
toggle_display("mini_photo"+id+"."+(activemini_photo[id]=1),true);
}
}else if (direction=="previous"){
if (document.getElementById("mini_photo"+id+"."+(activemini_photo[id]-1))){
toggle_display("mini_photo"+id+"."+(--activemini_photo[id]),true);
}else{
toggle_display("mini_photo"+id+"."+(activemini_photo[id]=maxmini_photo[id]),true);
}
}
document.getElementById("mini_photoTally"+id).innerHTML=activemini_photo[id]+"/"+maxmini_photo[id];
}
}
var activeYousaidit=0;
function toggle_yousaidit(){
if (document.getElementById("yousaidit"+(activeYousaidit+1))){
toggle_display("yousaidit"+activeYousaidit,false);
toggle_display("yousaidit"+(++activeYousaidit),true);
}else{
toggle_display("yousaidit"+activeYousaidit,false);
toggle_display("yousaidit"+(activeYousaidit=0),true);
}
}
function toggle_tab_image(id,state){
if (document.getElementById(id+"Tab")){
var src=document.getElementById(id+"Tab").src.substr(0,document.getElementById(id+"Tab").src.lastIndexOf(".")+1);
if (state && src.indexOf("off.")>0){
document.getElementById(id+"Tab").src=src.substr(0,src.length-4)+"on";
}else if (!state && src.indexOf("on.")>0){
document.getElementById(id+"Tab").src=src.substr(0,src.length-3)+"off";
}
}
}
function toggle_hottabs(url,tab){
if (document.getElementById("whatsHotContent")){
if (document.getElementById("whatsHotContent").className.indexOf(" "+tab)==-1){
document.getElementById("whatsHotContent").className="content "+tab;
if (document.getElementById("whatsHotFrame")){
document.getElementById("whatsHotFrame").src=url;
}
}
}
}
function toggle_display(id,state){
if (document.getElementById(id)){
if (typeof(state)=="undefined"){state=document.getElementById(id).style.display=="block"?false:true;}
document.getElementById(id).style.display=state?"block":"none";
}
}
function toggle_visibility(id,state){
if (document.getElementById(id)){
if (typeof(state)=="undefined"){state=document.getElementById(id).style.visibility=="visible"?false:true;}
if (state){var x=document.getElementById(id).offsetLeft;}
document.getElementById(id).style.visibility=state?"visible":"hidden";
}
}
function test_browser_animation_caps(){
return true;
}
var dlStories, dlStoriesInterval=8;
var dlStoriesLooped=false;
function is_dynamiclead_moving(){
var i=0;
while ((story=document.getElementById("dlStory"+i))!=null){
if (story.animInt!=null && typeof(story.animInt)!="undefined"){return true;}
i++;
}
return false;
}
function is_dynamiclead_hover(){
return dlStories.isHover;
}
function dynamiclead_hover(e){
e=e?e:event;
if (dlStories){
var obj=dlStories;
var eventClientX=e.clientX;
var eventClientY=e.clientY;
if (navigator.userAgent.toLowerCase().indexOf("safari")==-1){
eventClientX+=(typeof(window.pageXOffset)!="undefined"?window.pageXOffset:document.body.scrollLeft);
eventClientY+=(typeof(window.pageYOffset)!="undefined"?window.pageYOffset:document.body.scrollTop);
}
if ((eventClientX > obj.boundaryLeft && eventClientX < obj.boundaryRight) && (eventClientY > obj.boundaryTop && eventClientY < obj.boundaryBottom)){
dlStories.isHover=true;
}else{
if (dlStories.isHover){dynamiclead_init();}
dlStories.isHover=false;
}
}
}
function dynamiclead_init(){
if (!dlStories){
if (document.getElementById("dlStories")){dlStories=document.getElementById("dlStories");}
}
if (dlStories){
if (typeof(dlStoriesInterval)=="undefined" || isNaN(parseInt(dlStoriesInterval))){dlStoriesInterval=8;}
if (typeof(dlStories.boundaryLeft)=="undefined"){
dlStories.boundaryLeft=dlStories.offsetLeft+4;
dlStories.boundaryRight=dlStories.boundaryLeft+dlStories.offsetWidth;
dlStories.boundaryTop=dlStories.offsetTop+document.getElementById("content").offsetTop;
if (dlStories.parentNode.id!="content" && (dlStories.parentNode.offsetTop-dlStories.offsetTop)>0){
var obj=dlStories.parentNode.parentNode;
while (obj.id!="content"){
if (obj.id!="a" && obj.id!="c" && obj.id!="d" && obj.id!="s"){dlStories.boundaryTop+=obj.offsetTop;}
obj=obj.parentNode;
}
}
dlStories.boundaryBottom=dlStories.boundaryTop+dlStories.offsetHeight;
}
dlStories.animInt=null;
dlStories.isHover=false;
if (typeof(dlStories.currentStoryID)=="undefined"){dlStories.currentStoryID=0;}
if (dlStories.addEventListener){
dlStories.addEventListener("mouseover",dynamiclead_hover,false);
//document.body.addEventListener("mousemove",dynamiclead_hover,false);
}else{
dlStories.onmouseover=dynamiclead_hover;
//document.body.onmousemove=dynamiclead_hover;
}
dynamiclead_toggle_advance();
}
}
function dynamiclead_clear(){
if (dlStories){
window.clearTimeout(dlStories.animInt);
dlStories.animInt=null;
}
}
function dynamiclead_toggle_advance(){
if (!is_dynamiclead_hover() && !is_dynamiclead_moving() && !dlStoriesLooped){dlStories.animInt=window.setTimeout("dynamiclead_advance()",1000*dlStoriesInterval);}
}
function dynamiclead_advance(){
if (!is_dynamiclead_hover() && !is_dynamiclead_moving() && dlStories){
dlStories.currentStoryID++;
if (!document.getElementById("dlStory"+dlStories.currentStoryID)){
dlStories.currentStoryID=0;
dlStoriesLooped=true;
}
dynamiclead_toggle(dlStories.currentStoryID);
}
}
function dynamiclead_toggle(storyID){
if (typeof(storyID)=="object"){
storyID=storyID.parentNode.parentNode.id.substr(7);
}
var i=0, alternateClass="", storyHeight=150;
if (document.getElementById("dlStory"+storyID).offsetHeight){storyHeight=document.getElementById("dlStory"+storyID).offsetHeight-19;}
if (!is_dynamiclead_moving()){
dynamiclead_clear();
dlStories.currentStoryID=storyID;
while ((story=document.getElementById("dlStory"+i))!=null){
dynamiclead_toggle_tease(i,storyID);
if (!test_browser_animation_caps()){
if (i){story.style.top=((i>storyID)?((i*19)+storyHeight):(i*19))+"px";}
}else{
if (typeof(document.getElementById("dlStory"+i).style.top)=="undefined" || document.getElementById("dlStory"+i).style.top==""){document.getElementById("dlStory"+i).style.top=document.getElementById("dlStory"+i).offsetTop+"px";}
if (i){dynamiclead_init_animate(i,((i>storyID)?((i*19)+storyHeight):(i*19)),storyID);}
}
i++;
}
}
}
function dynamiclead_toggle_tease(storyID,clickID){
if (!document.getElementById("dlStoryTease"+storyID)){
if (document.getElementById("dlStory"+storyID).getElementsByTagName("h4").length){document.getElementById("dlStory"+storyID).getElementsByTagName("h4")[0].id="dlStoryTease"+storyID;}
}
if (document.getElementById("dlStoryTease"+storyID)){document.getElementById("dlStoryTease"+storyID).className=(storyID==clickID?"open":"closed");}
}
function dynamiclead_init_animate(storyID,y){
if (document.getElementById("dlStory"+storyID)){
document.getElementById("dlStory"+storyID).animInt=null;
document.getElementById("dlStory"+storyID).animInt=window.setInterval("dynamiclead_animate("+storyID+","+y+")",50);
}
}
function dynamiclead_animate(storyID,y){
if ((story=document.getElementById("dlStory"+storyID))!=null){
var top=parseInt(story.style.top);
if (top>(y+4)){
document.getElementById("dlStory"+storyID).style.top=(top-Math.round(Math.abs(top-y)*0.2))+"px";
}else if (top<(y-4)){
document.getElementById("dlStory"+storyID).style.top=(top+Math.round(Math.abs(top-y)*0.2))+"px";
}else{
document.getElementById("dlStory"+storyID).style.top=y+"px";
window.clearInterval(document.getElementById("dlStory"+storyID).animInt);
document.getElementById("dlStory"+storyID).animInt=null;
if (!is_dynamiclead_hover() && !is_dynamiclead_moving()){dynamiclead_toggle_advance();}
}
}
}
var activeButton, playingForward, playingBackward, photoPlayer, playControlActive, storyControlActive, maxStory
var timeDelay = 10;
var autoPlay = "on";
var playDirection = "forward";
var x = 0;
var offImg = new Array("info_btn_1_off","info_btn_2_off","info_btn_3_off","info_btn_4_off","info_btn_5_off","info_btn_6_off","info_btn_7_off","info_btn_8_off","info_btn_9_off","info_btn_10_off","info_btn_11_off","info_btn_12_off","info_btn_prev_off","info_btn_pause_off","info_btn_next_off");
var onImg = new Array("info_btn_1_on","info_btn_2_on","info_btn_3_on","info_btn_4_on","info_btn_5_on","info_btn_6_on","info_btn_7_on","info_btn_8_on","info_btn_9_on","info_btn_10_on","info_btn_11_on","info_btn_12_on","info_btn_prev_on","info_btn_pause_on","info_btn_next_on");
function photoLead_playPhotos(seconds,onOff,direction){
if (document.getElementById("photoGalleryParent")){
if (seconds!=undefined){timeDelay = seconds}
timeDelay = timeDelay * 1000;
if (typeof(maxStory)=="undefined"){
maxStory = 0;
while (document.getElementById("pic"+maxStory)){
maxStory++;
}
//maxStory-=3;
}
if (onOff!=undefined){autoPlay=onOff.toLowerCase()}
else{autoPlay=autoPlay.toLowerCase()}
if (direction!=undefined){playDirection=direction.toLowerCase();}
   else{playDirection=playDirection.toLowerCase();}
if (playDirection=="forward"){
playingForward=true;
playingBackward=false;
playControlActive=14;
}
else{
playingForward=false;
playingBackward=true;
playControlActive=12;
}
if (autoPlay=="on"){photoLead_startTimer()}
else (photoLead_changePhotoStory(1));
}
}
function photoLead_startTimer(){
if (playingForward==true){
if (document.getElementById("pic14")){document.getElementById("pic14").src = "http://cdn.channel.aol.com/ch_sports/" + onImg[14]}
if (document.getElementById("photostory" + (x+1)) && document.getElementById("pic" + x)){x=x+1}
 else{
  maxStory=x;
x=1;
}
}
if (playingBackward==true){
if (document.getElementById("pic12")){document.getElementById("pic12").src = "http://cdn.channel.aol.com/ch_sports/" + onImg[12]}
x=x-1;
if (x<1){x=maxStory}
}
if (document.getElementById("photodefault") && document.getElementById("photostory" + x + "photo") && document.getElementById("photostory" + x + "photo").innerHTML!=""){document.getElementById("photodefault").innerHTML=document.getElementById("photostory" + x + "photo").innerHTML}
if (document.getElementById("textdefault") && document.getElementById("photostory" + x + "text") && document.getElementById("photostory" + x + "text").innerHTML!=""){document.getElementById("textdefault").innerHTML=document.getElementById("photostory" + x + "text").innerHTML}
if (document.getElementById("linkWrapperDefault") && document.getElementById("linkWrapper" + x) && document.getElementById("linkWrapper" + x).innerHTML!=""){document.getElementById("linkWrapperDefault").innerHTML=document.getElementById("linkWrapper" + x).innerHTML}
storyControlActive=x-1;
photoLead_makeActive(x);
photoPlayer=setTimeout("photoLead_startTimer()", timeDelay);
}
function photoLead_stopTimer(){
if (playingForward==true && document.getElementById("pic14")){document.getElementById("pic14").src = "http://cdn.channel.aol.com/ch_sports/" + offImg[14]}
if (playingBackward==true && document.getElementById("pic12")){document.getElementById("pic12").src = "http://cdn.channel.aol.com/ch_sports/" + offImg[12]}
playingForward=false;
playingBackward=false;
playControlActive=-1;
if (photoPlayer){
clearTimeout(photoPlayer);
}else{
if (photoPlayer==undefined && document.getElementById("pic13")){document.getElementById("pic13").src = "http://cdn.channel.aol.com/ch_sports/" + offImg[13]}
}
}
function photoLead_rollover(buttonID,buttonNumber,buttonState){
if (document.getElementById(buttonID)){
switch (buttonState){
case "on":
document.getElementById(buttonID).src = "http://cdn.channel.aol.com/ch_sports/" + onImg[buttonNumber];
break;
case "off":
if (activeButton!=buttonNumber && playControlActive!=buttonNumber && storyControlActive!=buttonNumber){
document.getElementById(buttonID).src = "http://cdn.channel.aol.com/ch_sports/" + offImg[buttonNumber];
}
break;
}
}
}
function photoLead_makeActive(isActiveNum){
activeButton = isActiveNum - 1;
if (activeButton==13){}
else{
for (i=0;i<15;i++){
if (playingForward==true && i!=14 && document.getElementById("pic" + i)){document.getElementById("pic" + i).src = "http://cdn.channel.aol.com/ch_sports/" + offImg[i]}
else if (playingBackward==true && i!=12 && document.getElementById("pic" + i)){document.getElementById("pic" + i).src = "http://cdn.channel.aol.com/ch_sports/" + offImg[i]}
else if (playingForward==false && playingBackward==false && document.getElementById("pic" + i)){document.getElementById("pic" + i).src = "http://cdn.channel.aol.com/ch_sports/" + offImg[i]}
}
}
if (document.getElementById("pic" + activeButton)){document.getElementById("pic" + activeButton).src = "http://cdn.channel.aol.com/ch_sports/" + onImg[activeButton]}
}
function photoLead_changePhotoStory(photStorNumber){
if (photStorNumber>maxStory){photStorNumber=maxStory}
storyControlActive=photStorNumber-1;
x=photStorNumber;
photoLead_makeActive(photStorNumber);
if (document.getElementById("photodefault") && document.getElementById("photostory" + photStorNumber + "photo") && document.getElementById("photostory" + photStorNumber + "photo").innerHTML!=""){document.getElementById("photodefault").innerHTML=document.getElementById("photostory" + photStorNumber + "photo").innerHTML}
if (document.getElementById("textdefault") && document.getElementById("photostory" + photStorNumber + "text") && document.getElementById("photostory" + photStorNumber + "text").innerHTML!=""){document.getElementById("textdefault").innerHTML=document.getElementById("photostory" + photStorNumber + "text").innerHTML}
if (document.getElementById("linkWrapperDefault") && document.getElementById("linkWrapper" + photStorNumber) && document.getElementById("linkWrapper" + photStorNumber).innerHTML!=""){document.getElementById("linkWrapperDefault").innerHTML=document.getElementById("linkWrapper" + photStorNumber).innerHTML}
}
function toggle_image(id, src){
if (document.getElementById(id)){
document.getElementById(id).src=src;
}
}


function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

MM_reloadPage(true);

intImage = 2;
function swapImage() {
switch (intImage) {
 case 1:
    IMG1.src = "http://www.superstallionbev.com/images/stallion-girls-card2.jpg"
    intImage = 2
     return(false);
 case 2:
    IMG1.src = "http://www.superstallionbev.com/images/stallion-girls-card1.jpg"
    intImage = 1
   return(false);
    }
}

