  var $j = jQuery.noConflict();
  var contestIndex = 0;
  var videoIndex = 0;
  var videodisabled = false;
  var featureIndex = 0;
  var roseindex = 0;
  // Call this function when the page has been loaded
  
  
  $j(document).ready(function() {
	  //Cufon.replace('#tempotv');
      $j($j('.contest_panel')[contestIndex]).fadeIn();
      $j($j('.video_panel')[videoIndex]).fadeIn();
	  $j($j('.rose_video_panel')[roseindex]).fadeIn();
      $j($j('.featurediv')[featureIndex]).fadeIn();

      var auto_refresh = setInterval(
        function ()
        {
            //alert('hit');
            $cur = $j('.contest_panel')[contestIndex++];
            

            if( contestIndex == $j('.contest_panel').length)
                {
                    contestIndex = 0;
                }
            

            //out with the old
            $j($cur).fadeOut('slow', function() {
                $cur = $j('.contest_panel')[contestIndex];
                $j($cur).fadeIn('slow');
            });

            

        }, 6000);

      var video_refresh = setInterval(
          function()
          {
              if( videodisabled ) {
                  clearInterval(video_refresh);
                  return;
              }
            $cur2 = $j('.video_panel')[videoIndex++];
            if( videoIndex == $j('.video_panel').length)
                {
                    videoIndex = 0;
                }
            $j($cur2).fadeOut('slow', function() {
                $cur2 = $j('.video_panel')[videoIndex];
                $j($cur2).fadeIn('slow');
            });
          }, 8000);

      var feature_refresh = setInterval(
          function()
          {
            $cur3 = $j('.featurediv')[featureIndex++];
            if( featureIndex == $j('.featurediv').length)
                {
                    featureIndex = 0;

                }
            $j($cur3).fadeOut('slow', function() {
                $cur3 = $j('.featurediv')[featureIndex];
                $j($cur3).fadeIn('slow');
            });
          }, 10000);
      
  });

  
  function switchRoseVid( index ) {
    
	$j($j('.rose_video_panel')[roseindex]).fadeOut('slow', function() {
		roseindex = index;
		$j($j('.rose_video_panel')[roseindex]).fadeIn('slow');
	});
  }


