jQuery(document).ready(function(){
	
	jQuery('.productList ul').css("width",jQuery('.productList li').size()*105);
	jQuery('.scrollPane').jScrollHorizontalPane({showArrows:true, resize:true, scrollbarHeight:14, arrowSize:18});
	
	// Ajax product loader
	
	$('body.home .filters a').click(function(){
		$('.scrollPaneContainer .scrollPane').html('<p style="width: 594px; text-align:center"><img src="images/ajax-loader.gif" class="loader" alt="" /></p')
		$('.jScrollPaneTrack,.jScrollArrowLeft,.jScrollArrowRight').hide();
		$.get($(this).attr("href"),function(data){
			$('#ProductSelector .productList').html(data);
			jQuery('.productList ul').css("width",jQuery('.productList li').size()*105);
			jQuery('.scrollPane').jScrollHorizontalPane({showArrows:true, resize:true, reset:true,maintainPosition:false, scrollbarHeight:14, arrowSize:18});
		});
		
		return false;
	});
			
			$('body.home .filters ul > li>a').click(function(){
				$('.filters ul li').removeClass("active");
				$('.filters ul:eq(0) li').removeClass("active");
				$(this).parents("li").addClass("active");
			});
			
	
	// Input Field Focus

		jQuery('.module input[type="text"]').each(function(){
		jQuery(this).focus(function() {
		if( this.value == this.defaultValue ) {
			this.value = "";
		}
		}).blur(function() {
			if( !this.value.length ) {
				this.value = this.defaultValue;
			}
		});
		});
	
	// Select box 
	
	if(jQuery('#enquiry_type').length){
		jQuery('#enquiry_type').sSelect();
	}
	
	
});
