Cufon.replace('.decor', { fontFamily: 'Decor', hover: {color:'#C55A5A'}});

$(document).ready(function() { 
	$('#categories li').each(function(){
	  var el = $(this)
	  el.find('div.clear').height((el.height() - el.find('a').height()) / 2 + 2);
	});
	
	if(($('body').width() < 1275 && $('#bg').offset().top < $('#sidebar').offset().top + $('#sidebar').height()) || $('#content').height() < 500 ) $('#bg').css('display', 'none');
	
	if($('#home #important').length){
	  if($.browser.msie) $('#important img').height($('#important').height())
	  setInterval(function(){$('#important a').fadeTo(500, 0.33).fadeTo(500, 1)}, 3000)
	}else{
	  
	}
	
	var fWait = false;
	var fHolder = $('#featured #holder').eq(0).hover(function(){fWait = true},function(){fWait = false});
	var fCount = fHolder.children().length;
	if(fHolder && fCount > 3){
	  var fIndex = 0, fDirection = 1;
	  var fTimer = setInterval(function(){
	    if(fWait) return;
	    fDirection = fIndex == 0 ? 1 : (fIndex == fCount - 3 ? -1 : fDirection);
	    fIndex += fDirection;
  	  fHolder.animate({'marginLeft': -290*fIndex}, 1000, 'easeInOutBack');
  	}, 3000);
	}
	
	
	
  $(".fancy").fancybox({ 
    'zoomSpeedIn': 300,
    'zoomSpeedOut': 300,
    'overlayShow': false
  }); 
  
  
  $('#products .product').removeAttr('title');
  $("#products .product").fancybox({ 
    'zoomSpeedIn': 300, 
    'zoomSpeedOut': 300, 
    'overlayShow': true, 
    'frameWidth': 450, 
    'frameHeight': 420,
    'callbackOnShow': function(){Cufon.replace('#fancy_div h2');}
  }); 
  
}); 

function redirectAfter(url, time){
  setTimeout(function(){
    window.location=url;
  },time)
}