$(document).ready(function()
{
	$("a[rel='lightbox']").colorbox();
    
    $('.externalLightbox').click(function(){
        $('.bigImage:visible').children('a').click();
        return false;
    });
        
    $('.innerfade').innerfade({
		speed: 750,
		timeout: 5000,
		type: 'random'
	});
    
    $(".validateForm").validate({
        errorPlacement: function(error, element) {
			error.prependTo( element.parent().next() );
		},
		// set this class to error-labels to indicate valid fields
		success: function(label) {
			// set &nbsp; as text for IE
			label.html("&nbsp;").addClass("checked");
		}
    });
    
    $('.clickTitle').click(function()
    {
        location.href = $(this).attr('title');
    });
    
    $('.smallPhoto').click(function()
    {
        if (this.id == 'main')
        {
            $id = 'mainImage';
        }
        else
        {
            $temp = this.id.split('_');
            $id = 'bigImage_' + $temp[1]; 
        }
        
        $('.bigImage:visible').fadeOut();
        $('#' + $id).fadeIn();
        return false;
    })
    
    $('#jcarrousel').jcarousel({
        animation: 250,
        scroll: 1
    });

});