    function showVideo(str) {
    
      var url = 'throwback.php?q=' + str;
      new Ajax.Request(url, {
        method: 'get',
        onSuccess: function(transport) {
        var notice = $('txtHint');
        
        notice.update(transport.responseText);
        
        } 
      });
    
    }
    
    function flashCompleteCallback()
    {
    	WWE.Video.isReady = true;
    }
    
    function dimPage()
    {
      var element = document.getElementsByTagName("div");
      alert('Elements ' + elements.length());
      for (var string in element) {
    	  if (element[string].id != 'toughflashep') {
    		  element[string].setStyle({
    			  'opacity':'.50',
    			  'filter':'alpha(opacity=50)',
    			  '-moz-opacity':'0.5'
    		  });
    	  }
      }
      /**
      var overlay = $('overlay');
      if (typeof(overlay) != 'undefined' && overlay != null)
      {
	      var dims = $(document.body).getDimensions();
  	    overlay.setStyle({width:dims.width + 'px', height:dims.height + 'px', zIndex:1});
    	  overlay.show();
      }**/
    }
    
    function revealPage() {
    	
      var overlay = $('overlay');
      if (typeof(overlay) != 'undefined' && overlay != null)
      {
	      overlay.hide();
  	    overlay.setStyle({zIndex:90});
    	}  
    }
    
    function thisMovie(movieName) {
      if (navigator.appName.indexOf("Microsoft") != -1) {
        return window[movieName];
      } else {
        return document[movieName];
      }
    }
  
    function videoCycleComplete() {
      //Play Next Video
      WWE.Video.advancePlayList();
    }
    
    function truncate(input, newLength) {   
            if (input.length <= newLength) {
                return input;
            }
            return input.trim().substring(0, newLength) + '...';
    }
    
  /// <summary>
  ///   Flash calls this method when it needs to display a lightning cast ad. Lightning 
  ///   cast ad is display in the right banner ad location, and the DoubleClick 720x90 ad is reset
  /// </summary>
  /// 
  /// <param name="adUrl">Url of the ad to display</param>
  /// <param name="clickThroughUrl">Link to redirect to when the user clicks on ad</param> 
  ///
  function showLightningCastAd(adUrl, clickThroughUrl)
  {
  	var adContainerElement = $('ad-300x250-Right');
  	
  	if (adContainerElement != null)
  	{
	  	showNullCompanionAd('728x90');
	  	
	  	if ((typeof(adUrl) != 'undefined') && (adUrl != null) && (adUrl != ''))
	  	{
	  		if (adUrl.endsWith('.swf'))
	  		{
	  			generateLightningCastSwf(adContainerElement, adUrl);
	  		}
	  		else if (adUrl.endsWith('.html'))
	  		{
	  			generateLightningCastIFrame(adContainerElement, adUrl);
	  		}
	  		else
	  		{
	  			generateLightningCastClickThru(adContainerElement, adUrl, clickThroughUrl);
	  		}
	  	}
  	}
  	
  }	// end method showLightningCastAd
  
  /// <summary>
  ///   Called by showLightningCastAd() when the ad to display is a flash movie
  /// </summary>
  ///
  /// <param name="adContainerElement">Container element to place flash movie in</param>
  /// <param name="adUrl">Url of the ad to display</param> 
  ///
  function generateLightningCastSwf(adContainerElement, adUrl)
  {
		var swfObject = new SWFObject(adUrl, "lcAdSwf", "300", "250", "10.0", "#000000");
		swfObject.addParam("allowFullScreen", "false");
		swfObject.addParam("allowScriptAccess", "false"); 
		swfObject.addParam("WMode", "Opaque");
		adContainerElement.innerHTML = '';
    swfObject.write(adContainerElement.id);  
  } //end method generateLightningCastSwf
  
  /// <summary>
  ///   Called by showLightningCastAd() when the ad to display is HTML content
  /// </summary>
  ///
  /// <param name="adContainerElement">Container element to place html content in</param>
  /// <param name="adUrl">Url of the ad to display</param> 
  ///
  function generateLightningCastIFrame(adContainerElement, adUrl)
  {
  	var adIFrame = new Element('iframe', 
  		{
  			src : adUrl,
  			id : 'lcAdIFrame',
  			width: '300',
  			height: '250',
  			marginwidth: '0',
  			marginheight: '0', 
  			hspace: '0', 
  			vspace: '0', 
  			frameborder: '0',
  			scrolling: 'no'			
  		});
  	
  	adContainerElement.innerHTML = '';
  	adContainerElement.appendChild(adIFrame);
  	//alert('videoGallery::generateLightningCastIFrame()');
  }	// end method generateLightningCastSwf
   
  /// <summary>
  ///   Called by showLightningCastAd() when the ad to display is an anchor/image tag clickthru
  /// </summary>
  ///
  /// <param name="adContainerElement">Container element to place html content in</param>
  /// <param name="adUrl">Url of the ad to display</param> 
  /// <param name="clickThroughUrl">Link to redirect to when the user clicks on ad</param> 
  ///	 
  function generateLightningCastClickThru(adContainerElement, adUrl, clickThroughUrl)
  {
  	if ((typeof(clickThroughUrl) != 'undefined') && (clickThroughUrl != null) && (clickThroughUrl != ''))
  	{
	  	var adImage = new Element('img', {src : adUrl, alt : 'Click here to find out more!', width : '300', height : '250'}); 
	  	
	  	var adAnchor = new Element('a', {target : '_blank', href : clickThroughUrl})
	  	
	  	adAnchor.appendChild(adImage);
	  	
	  	adContainerElement.innerHTML = '';
	  	
	  	adContainerElement.appendChild(adAnchor);  
		}	  	
  } // end method generateLightningCastClickThru
    
    
/**
 * <summary>
 *  Flash calls this method when it does not have an ad to show for a specific target element
 * </summary>
 * <param name="adWidth">Width of targetted ad</param>
 */ 
function showNullCompanionAd(adWidth, adHeight) {
	var adInfo = {adSize : adWidth+'x'+adHeight, adType : 'adf', dCopt : false};
  	var adUrl = WWE.DoubleClick.getAdUrl(adInfo);
    syncRoadBlock(adUrl);
}

function syncRoadBlock(adTag) {
	//alert('videoGallery::syncRoadBlock');
	var a = adTag.split(';');
	if (a.length>0) {
      for (x=0; x<=a.length-1; x++)
			{
				if (a[x].indexOf('sz=') == 0)
				{
					size = a[x].substring(3);
    			dims = size.split('x');
    			height = dims[1];
     			width = dims[0];
         	adId = '';
          
         	if (width == 300) {	
         		loadRBs('ad-300x250-Right',width, height, adTag);
         	}
         	
         	if (width == 728) {
         		loadRBs('ad-728x90-Top',width, height, adTag);
         	}
         	
         	if (width == 0) {
         		loadBGs(adTag + ';dcopt=ist;');
         	}
        }
      } 
	}
}
	function loadBGs(adUrl)
	{
		adUrl = encodeURIComponent('/proxy?url=' + adUrl);
    /*
    new Ajax.Request(adUrl, 
      { 
        method : 'get', 
        onSuccess : function(transport)
        {
          alert(transport.responseText);
        },
        onFailure : function(ajaxRequest, myFailure)
        { 
          alert('Something went wrong...') 
        },
   
        onException : function(ajaxRequest, myException) 
        { 
          alert(myException) 
        }
        
        
      });      
     */
    //AJAX call to get content in tag
		//Parse out content inside <script></script>
		//Set BG
	}

  
	function loadRBs(s,w,h,adTag) 
  {
		//alert('videoGallery::loadRBs '+adTag);
		document.getElementById(s).innerHTML = '<iframe src="' + adTag  +'" id="ifr_companion" width="'+w+'" height="'+h+'" marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no>' + '</iframe>';
	}
  
  /// <summary>
  ///   Called by the flash player when an error is raised in the DC component
  /// </summary>
  ///
  /// <param name="adUrl">Url of the ad call that was made to doubleclick</param> 
  ///
  function handleDoubleClickError(adUrl)
  {
  		//alert('videoGallery::hideDoubleClickError');
	  	var url = 'http://gen.wwe.com/trac/gif.php?PIXID=22&Str1=' + encodeURIComponent(adUrl);
		new Ajax.Request(url);
  } //end method handleDCError
    
  function setOmnitureTracker(videoFullName, showName)
  {
    s.channel = 'Mediaplayer:flv';
    s.hier1 = s.channel;
    s.prop3 = s.channel;
    
    s.prop27 = videoFullName;
    
    s.prop28 = showName;
    s.products = 'Mediaplayer;' + videoFullName + ';;;event9=1,Ad;Video Pre-roll;;;event8=1,Ad;300x250;;;event8=1';
        
    s.t();  
  }    
  
  function openWmvPlayer(videoUrl) 
  {
    var wmvUrl = wwevideoplayer(videoUrl, 'overlay');
    
    $('lbFrame').style.height = '650px';
    
    Lightbox.initFrame();  
    Lightbox.showBoxByIFrame(wmvUrl, 800, 650);
  }
  
  function closeWmvPlayer()
  {
    Lightbox.hideBox(false);
    $('lbFrame').height = '525px';
    $('lbFrame').style.height = '525px';
  }     
  
  
 /**
  * Tremor Media banner ad callbacks
  */
function displayFallbackBanners(banners, x300, x728) {
	if (!x300) { showNullCompanionAd(300, 250); }
	if (!x728) { showNullCompanionAd(728, 90); }	
}

function displayCompanionBanners(banners) {
	var x300 = false;
	var x728 = false;
	for (var i in banners) {
		if (banners[i].width == '300') {
			tmDisplayBanner(banners, "ad-300x250-Right", 300, 250);
			x300 = true;
		} else if (banners[i].width == '728') {
			tmDisplayBanner(banners, "ad-728x90-Top", 728, 90);
			x728 = true;
		}
	}

	displayFallbackBanners(banners, x300, x728);
}
