﻿var initCarousel = null;
$(document).ready(function()
{
	if (initCarousel) initCarousel();
	$("a[rel^='prettyPhoto']").prettyPhoto({theme:'my'});
	$(".menu_top a").corner("8px");  
	$('.cat_head').corner('10px');	
	$('.act_desc_head').corner('8px');
	if (!$.browser.msie)
	{
		$('#slideshow img').corner('30px');
		$('.cont_image img').corner('30px');
		$('#mycarousel img').corner('15px');
		$('.cat_unit img').corner('32px');
		$('.cat_img div img').corner('32px');
		$('.cat_img span img').corner('6px');
	}
	startSlideShow();
	roundedButtons();
});
function roundedButtons()
{
	$('.cat_button_on').corner('8px');
	$('.cat_button_off').corner('8px');
	$('.col_button_off').corner('8px');
	$('.col_button_on').corner('8px');
}
		
		   /*** 
    Simple jQuery Slideshow Script
    Released by Jon Raasch (jonraasch.com) under FreeBSD license: free to use or modify, not responsible for anything, etc.  Please link out to me if you like it :)
***/

function slideSwitch() {
    var $active = $('#slideshow IMG.active');
    if ( $active.length == 0 ) $active = $('#slideshow IMG:last');
    var $next = $active.next().length ? $active.next() : $('#slideshow IMG:first');
    
    $active.addClass('last-active');
    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 3500, function() {
            $active.removeClass('active last-active');
        });
}
var intervalID = null;
function startSlideShow()
{
	if (intervalID) return;
	intervalID = setInterval( "slideSwitch()", 5000 );
};
function showSlide(id)
{
	clearInterval(intervalID);
	intervalID = null;
	var $active = $('#slideshow IMG.active');
	var $next = $('#'+id);
    
	if ($active.attr('id') == id) return;
    
    $active.removeClass('active last-active');
    $next.addClass('active');
};
