var whitespace = {
	run: function(){
	
		/* Putting some of the general global scripts in the one external .js file */

		/* Global: Cufon fonts */
		/*Cufon.replace('body#home .column h3, .about-whitespace h1, .column h3, .eachpost h1, .eachpost h2, .post-footer p, ul.whitespace-shop li .product-details h2, body#terms article h2, body#privacy article h2, #carousel p', { fontFamily: 'Italic' });
		Cufon.replace('body#projects .menu h1, body#projects-page .menu h1, body#blog .blog-header h1, body#shop .menu p, .contact-ws h3, body#terms h1, body#privacy h1, body#sitemap h1, #carousel h3', { fontFamily: 'Black' });*/
		
		/* Homepage main image slideshow */
		jQuery('#mycarousel').jcarousel({
			//wrap: 'circular'
			auto: 6,
			wrap: 'both'
		});
		/*jQuery('.jcarousel-prev').live('click', function(){
			Cufon.refresh();
		});
		jQuery('.jcarousel-next').live('click', function(){
			Cufon.refresh();
		});*/
	
		/* Shop page */
		jQuery("ul.whitespace-shop li:nth-child(2n)").addClass("even");
	
		//Projects list show and hide
		var showText='<img src="http://www.whitespace.hk/wp-content/themes/whitespace/images/bg-plus.gif" alt="Show" width="17" height="17" />';
		var hideText='<img src="http://www.whitespace.hk/wp-content/themes/whitespace/images/bg-minus.gif" alt="Hide" width="17" height="17" />';
		var is_visible = false;
		jQuery('.toggle').hide();
		jQuery('.togglelink a').click(function() {
			is_visible = !is_visible;
			jQuery(this).html( (!is_visible) ? showText : hideText);
			jQuery(this).parent().next('.toggle').toggle('');
			return false;
		});
		
		/* Blog post page */
		jQuery("#comments #respond #commentform p").addClass("clearfix");
				
		/* end */
		
	}
};

//Initialize
jQuery.noConflict();
jQuery(document).ready(function(){
	whitespace.run();
});

