
	jQuery(function() {
		
		var u = jQuery('#page-top').width();
		var l = jQuery('#page-top > ul > li > ul > li.page_item').length;
		var x = Math.floor((642 - u)/l);
		var r = 642 - u - l*x;
				
		jQuery('#page-top > ul > li > ul > li.page_item > a').each(function() {
			var w = jQuery(this).width();
			jQuery(this).width(w + x); 
			jQuery(this).next('ul').find('a').width(w + Math.floor(x/2)).css({'padding-left': Math.ceil(x/2) + 'px'});
		});
		
		jQuery('#page-top .page_item a:last').each(function() {
			var w = jQuery(this).width();
			jQuery(this).width(w + r);
		});
				
		jQuery('#page-top > ul > li > ul > li').hover(
			function() { jQuery(this).addClass('xm_hover'); },
			function() { jQuery(this).removeClass('xm_hover'); }
		);
		
		jQuery('#page-top > ul > li > ul > li > ul').parent('li').children('a').click(function() { return false; });
		
		jQuery('.product-info .images_holder img:first').show();
		
		jQuery('.thumbnails_holder a').click(function() {
			var xmi = jQuery(this).attr('rel') - 1;
			jQuery('.images_holder img:visible').fadeOut(500,function() {
				jQuery('.images_holder img').eq(xmi).fadeIn(500);
			});
			
			return false; 
		});
		
		Cufon.replace('h1,h2,h3', { fontFamily: 'Myriad Pro' });
		
		jQuery('.neww,.wtblinks a').attr('target','_blank');
				
	});
