// JavaScript Document
$(document).ready(function() {
	//Controls toggle for spotlight feature
	$(function() {
	$("#caro").scrollable({
	circular: true
	})
	.navigator().autoscroll({
	interval: 10000
	});	
	
	});

///////////////////////////////////////////////////////////////////////

//This is a no longer needed function but worth keeping for future purposes 
	/*//left tog
	$('#left_tog').toggle(function(){

 	$('#left_content').show('slow');
 	},function(){

 	$('#left_content').hide('slow');

	 });
	
	//mid tog
	$('#mid_tog').toggle(function(){

 	$('#middle_content').show('slow');
 	},function(){

 	$('#middle_content').hide('slow');

	 });
	
	//right tog
	$('#right_tog').toggle(function(){

 	$('#right_content').show('slow');
 	},function(){

 	$('#right_content').hide('slow');

	 });*/
	
//////////////////////////////////////////////////////////////////

	//This script will auto generate alt tags and title tags
	$( 'img' ).each( function( index ){
	var $this = $( this );
	if( $this.attr( 'alt' ).length < 1 ){
	$this.attr( 'alt' , '' );
	}

	});
		
	var altTags = '';
	
	$( 'a' ).each( function( index ){

	var $this = $( this );


	if( $this.text() < 1 ){

	$this.attr( 'title' , altTags );

	}else{

	$this.attr( 'title' , $this.text() + ' | ' + altTags );
	}

	if( $this.children().is( 'img' )){

	var imageAlt = $this.find( 'img' ).attr( 'alt' );

	if( imageAlt.length < 1 ){

	$this.attr( 'title' , altTags );


	}else{

	$this.attr( 'title' , imageAlt + '  ' + altTags );

	}

	}
	});

});

