
// slideshows
function slideSwitch() {
    var $active = $('#slideshow img.active');
    if ( $active.length == 0 ) $active = $('#slideshow img:last');
    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow  img:first');

    // uncomment the 3 lines below to pull the images in random order
    // var $sibs  = $active.siblings();
    // var rndNum = Math.floor(Math.random() * $sibs.length );
    // var $next  = $( $sibs[ rndNum ] );

    $active.addClass('last-active');
    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}
$(function() {
    setInterval( "slideSwitch()", 5000 );
});

// countdown


// slider
var gscroll_ = 0;

function gscroll(dir)

{

  if (4 >= $('#prizes-silder-place div.item').length) return;

  if (dir)

  {

    if (gscroll_ < $('#prizes-silder-place div.item').length - 4)

    {

      $('#prizes-silder-wrap').animate({'left': '-=227px'},'slow');

      gscroll_ += 1;

    }

  }

  else 

  {

    if (gscroll_ > 0)

    {

      $('#prizes-silder-wrap').animate({'left': '+=227px'},'slow');

      gscroll_ -= 1;

    }

  }

  $('#prizes-silder .prev').css({visibility: (gscroll_ > 0) ? 'visible' : 'hidden'});

  $('#prizes-silder .next').css({visibility: (gscroll_ < $('#prizes-silder-place div.item').length - 4) ? 'visible' : 'hidden'});

}

// popup
var profiles =
{
	window800:
	{
		height:800,
		width:800,
		status:0,
		scrollbars:1
	}
};

$( function(){
$("table tr:even").addClass("even");
$("table tr:odd").addClass("odd");
});
// $( function(){
// $(".popupwindow").popupwindow(profiles);
// });