

//alert('Soccer2');
var sshow_Soccer2 = function () {
// Slide show name space

    // Local Variables
    var timer = 0;
    var currImg = 0;
    var myName = "";    
    var delay = 5000;
    var parLyr = null; //(document.layers && parLyr ? eval(parLyr) : window);
    var data = new Array();
    
    
    // Print the html that we will manipulate to rotate the images
    document.write("<span style='margin: 0px;'><a name='picRotateSoccer2Lnk' id='picRotateSoccer2Lnk' href='#' style='margin: 0px; padding: 0px;'><img name='picRotateSoccer2Img' id='picRotateSoccer2Img'  src='/App_Themes/DefaultTheme/art/loading.gif' style='filter:blendTrans(duration=1)'   border='0' style='z-index: 1; margin: 0px; padding: 0px;' width='450px' height='528px'></a><div name='picRotateSoccer2Div' id='picRotateSoccer2Div' style='visibility: visible; width: 450px; height: 32px; z-index: 1000; margin: 0px; padding: 0px; text-align: left; font-weight: normal; font-size: 12pt; vertical-align: middle; font-family: Arial;'></div></span>");
    
    _init('picRotateSoccer2', '7000', null, '~/get_image.aspx?id=3871|#|John Troka makes his move|Black|Gold|0', '~/get_image.aspx?id=4101|#|Cory Matthews turns upfield|White|Black|0', '~/get_image.aspx?id=3873|#|Jubril Gude dribbles past defenders|Black|Gold|0', '~/get_image.aspx?id=4314|#|Coachs Anderson, Chapman and Tucker|White|Black|0', '~/get_image.aspx?id=4315|#|Cody Sloan takes a shot on PC\'s rainsoaked field|Black|Gold|0', '~/get_image.aspx?id=4316|#|Patrick Wolverton battles for the ball|White|Black|0', '~/get_image.aspx?id=4317|#|West Region Co-Champions|Black|Gold|0', '~/get_image.aspx?id=4320|#|Steve Williams takes a shot|White|Black|0', '~/get_image.aspx?id=4311|#|Steve Prevost heads the ball|Black|Gold|0', '~/get_image.aspx?id=4321|#|Jay Kang looks up field|White|Black|0' );         
 //'red.gif', 'yellow.gif', 'green.gif', 'blue.gif'
    
    // Don't call play automatically, need to wait for the global var is defined
    //_play();
        
    function _play() {        
        // Cycle one image forwards -- cycle() will stop an existing timeout if applied. 
        _cycle(1); 
        timer = setTimeout('sshow_Soccer2.Play()', delay);
    }
       
    function _stop() {
        clearTimeout(timer);
        timer = null;
    }
    
    function _init(item_name, item_delay, item_parLyr) {
        myName = item_name;
        parLyr = (document.layers && item_parLyr ? eval(item_parLyr) : window);
        delay = item_delay;
     
         for (var i = 3; i < arguments.length; i++)
         {
          // Preload images into an array before swapping.
          data[i - 3] = new Image();
          var txt = arguments[i];
          // imgurl|targeturl|text|textcolor|backgroundcolor|opacity
          parts = txt.split("|");
          data[i - 3].src = parts[0].replace("~", "");
          data[i-3].targeturl=parts[1];
          data[i-3].text=parts[2];
          data[i-3].textcolor=parts[3];
          data[i-3].bgcolor=parts[4];
          data[i-3].opacity=parts[5];  
         }
     }

    
    function _getRefToLink(lnkID, oDoc) {
        if( document.getElementById ) {
            return document.getElementById(lnkID); }
        if( document.all ) {
            return document.all[lnkID]; }
        if( !oDoc ) { oDoc = document; }
        alert('NO LINK!');
        return null;
    }
    
    function _getRefToDiv(divID,oDoc) {
      if( document.getElementById ) {
        return document.getElementById(divID); }
      if( document.all ) {
        return document.all[divID]; }
      if( !oDoc ) { oDoc = document; }
      if( document.layers ) {
        if( oDoc.layers[divID] ) { return oDoc.layers[divID]; } else {
          //repeatedly run through all child layers
          for( var x = 0, y; !y && x < oDoc.layers.length; x++ ) {
            //on success, return that layer, else return nothing
            y = _getRefToDiv(divID,oDoc.layers[x].document); }
        return y; } }    
      return false;
    }
    
    function _showDiv(divID_as_a_string) {
      //get a reference as above ...
      myReference = _getRefToDiv(divID_as_a_string);
      if( !myReference ) {
        window.alert('Nothing works in this browser');
        return; //don't go any further
      }
      //now we have a reference to it
      if( myReference.style ) {
        //DOM & proprietary DOM
        myReference.style.visibility = 'visible';
      } else {
        //layers syntax
        myReference.visibility = 'show';
      }
    }
    
    function _cycle(dir) {
     // Stop any exiting play function if this is called manually.
     _stop();

     // Increment and mod by the image array length.
     currImg += dir;
     currImg = currImg % data.length;
     if (currImg < 0) currImg += data.length;

     // The image in question -- perhaps nested within its parent layer for NS4.
     var imgRef = parLyr.document.images[myName + 'Img'];
     var lnkRef = _getRefToLink(myName + 'Lnk');
      lnkRef.href=data[currImg].targeturl;
     var divRef = _getRefToDiv(myName+'Div');
     _showDiv(myName+'Div');
     divRef.style.backgroundColor=data[currImg].bgcolor;
     divRef.style.color=data[currImg].textcolor;
     divRef.innerText=data[currImg].text; // set IE text
     divRef.textContent=data[currImg].text; // set FFox text
     //divRef.style.opacity="." + data[currImg].opacity;
     //divRef.style._mox_opacity="." + data[currImg].opacity;
     

     // IE filters active?
     var f = imgRef.filters;
     if (f&&f.length&&f[0]) f[0].Apply();
     // Swap the image, and play the filter if applicable.
     imgRef.src = data[currImg].src;
     if (f&&f.length&&f[0]) f[0].Play();
    }

    
 return {   
    Play: function() {
        _play();
    },
    Stop: function() {
        _stop();
    }
 };
}();
sshow_Soccer2.Play();