// Font Replacement
Cufon.replace('.category-title h1,.footer h4, .product-view .product-shop .product-name h1,.page-title h1, .page-title h2,.wired-home .subscribe strong', {
	hover: true
});

jQuery(document).ready(function() {
	/*
	// Featured Products
    jQuery('#featured').jcarousel();
	// FancyBox jQuery
	jQuery("a.group").fancybox({ 'zoomSpeedIn': 300, 'zoomSpeedOut': 300, 'overlayShow': true }); 	
	// Slider Homepage
	jQuery('#slider').cycle({
        fx: 'fade',
        speed: 2000,
		timeout: 5000,
        pager: '#controls',
		slideExpr: '.panel'
    });
	*/
	
	// ridiculous browser check
	var cbnine = false;
	
	if (jQuery.browser.msie) {
		if (jQuery.browser.version.substr(0,1) == "9" ) {
			cbnine = true;
		}
	}
		
	// show hide suits models
	var battSAttrBox = jQuery('.smodels');
	
	battSAttrBox.each(function(){
		var sboxHeight;
		if (cbnine){
			sboxHeight = jQuery(this).css("height");
		} else {
			sboxHeight = jQuery(this).height();
		}
		
		var _sthisref = jQuery(this);
		
		if( parseInt(sboxHeight) > 54 ) {
			
			_sthisref.wrap('<div class="morebox"></div>');
			_sthisref.css({'height':'54px','overflow':'hidden'});
			_sthisref.parent().append('<div class="view-more"><a href="#">View more models</a></div>');
			
			var sboxViewmore = _sthisref.parent('.morebox');
			
			jQuery('a',sboxViewmore).toggle(
				function(){
					_sthisref.animate({'height':sboxHeight},400,function(){
						jQuery('a',sboxViewmore).text('View less models');
					});
					return false;
				},
				function(){
					_sthisref.animate({'height':'54px'},400,function(){
						jQuery('a',sboxViewmore).text('View more models');
					});
					return false;
				}
			);
		}			
		
	});
		
	// show hide replace models
	var battRAttrBox = jQuery('.rmodels');
	
	battRAttrBox.each(function(){
		var rboxHeight;
		if (cbnine){
			rboxHeight = jQuery(this).css("height");
		} else {
			rboxHeight = jQuery(this).height();
		}
		var _rthisref = jQuery(this);
		if( parseInt(rboxHeight) > 54 ) {
			
			_rthisref.wrap('<div class="morebox"></div>');
			_rthisref.css({'height':'54px','overflow':'hidden'});
			_rthisref.parent().append('<div class="view-more"><a href="#">View more models</a></div>');
			
			var rboxViewmore = _rthisref.parent('.morebox');
			
			jQuery('a',rboxViewmore).toggle(
				function(){
					_rthisref.animate({'height':rboxHeight},400,function(){
						jQuery('a',rboxViewmore).text('View less models');
					});
					return false;
				},
				function(){
					_rthisref.animate({'height':'54px'},400,function(){
						jQuery('a',rboxViewmore).text('View more models');
					});
					return false;
				}
			);
		}			
		
	});


});

