/**
 * @author Raymond Chau
 */
$(document).ready(function(){
	// Navigation initialization
    $("#nav > li").hover(	
        function(){
			if ($(this).children("div.subnav").length > 0) {
				var div = $(this).children("div.subnav")[0];
				var ul = $(div).children("ul");
				
				if (ul.length > 0) {
					$("div.subnav", this).show(); 
					$("ul", this).css({ "margin-left": this.offsetLeft});
				}
			}
			
			this.className += "_over";
		}, 
        function() {
			$("div.subnav", this).hide(); 
			this.className = this.className.replace("_over", "");			
		} 
    );	
	
	// Carousel initialization
	jQuery('#mycarousel').jcarousel({
		start:1,
		scroll:1,
		visible:3
    });	
    
    jQuery('#features ul').jcarousel({
		start:1,
		scroll:1,
		visible:3
    });	
	
	// Rolling art initialization
	var so = new SWFObject("/assets/swf/rolling4.swf", "rolling", "1024", "229", "8", "#FFF");
	so.addParam("scale", "noscale");
	so.write("rolling-art");
});

