//Kick off Shadowbox for image handling
Shadowbox.init();

//JQuery related stuff here

//jQuery.getJSON("http://127.0.0.1/cdiLondon/wp-content/themes/CDI/quote.php",startQuotes);   
jQuery.getJSON("http://www.cdilondon.com/cdi2010/wp-content/themes/CDI/quote.php",startQuotes);   

function startQuotes(quotes)
{
	jQuery.each(quotes, function(i,quotes)
	{
		jQuery('#quotes').append('<h3 class="quote span-11 append-1 textAlignRight">'+quotes.post_title+'</h3>');
	});
	jQuery('#quotes').cycle({fx:'fade',timeout:20000});
	
};

jQuery(document).ready(function()
{	   	
	//Superfish navigation system		
	jQuery("ul.sf-menu")
	  	    .find('li.current_page_item,li.current_page_parent,li.current_page_ancestor')
	   	    .addClass('current')
	   	    .end()
	   	    .superfish({
	   	    	pathClass : 'current'
	        });
	
	//News, quote feed cycle
	jQuery(".newsFeed").cycle({fx:'scrollDown',timeout:9000});
	jQuery('.slideshow').cycle({fx:'fade',timeout:15000});
	jQuery('.homeIntroSlides').cycle({fx:'fade',timeout:8000});
	
	//Article image interception, replace with shadowbox links 
	jQuery(".article a[rel]")
		  .attr('rel','shadowbox')
		  .attr('href','google'); 
	;
	
	//form validation and feedback
   jQuery("#contactForm").validate({errorElement: "div"});
   jQuery("#thecaptcha").realperson({length: 4});
   jQuery(".userNotice").fadeIn(1500);
   setTimeout(function(){$(".userNotice").fadeOut(1000);}, 5000);  
	
	//jQuery(".article a[rel]").next().attr('src','whatewver');
	
	
}          
);
