$(document).ready( function() { 
	
	Cufon.replace('.calibri,h1,h2,h3,h4,h5,h6, table.product_info tr td:first-child', { fontFamily: 'Calibri', hover: true });
	
	var stext = "search...";
	
	$("#slide").cycle({   fx:      'fade',  speed:    1600,    timeout:  3500  });
	$("#slide_products").cycle({   fx:      'scrollLeft',  speed:    1600,    timeout:  3500  });
	
	$("#main_right a  img").parent().attr("rel","slb");
	
	$("#s").mouseover(function() {	
		var a = jQuery.trim($(this).val());
		if (a==stext){  $(this).val(""); }
		$(this).focus();
	});
	
	$("#s").mouseout(function() {	
		var a = jQuery.trim($(this).val());
		if (a==""){  $(this).val(stext); $(this).blur(); }		
	});
	
	$("#box_header #header ul ul").fadeOut(0);
	$("#box_header #header ul li").hover(function () {		
		$(this).find("ul").fadeIn(250);
	}, function () {
		$(this).find("ul").fadeOut(20);
	});
	
	fix_height();	
});

function fix_height(){
	var o_cont= $("#box_container").height();
	var o_header = $("#box_header").height();
	var o_slide = $("#box_slide").height();
	var o_footer = $("#box_footer").height();
	var o_body = $("body").height();
	var o_deduct = o_header+o_slide+o_footer;
	var o_new = o_body-o_deduct;
	var o_what = o_deduct+o_cont;
	
	if (o_what <= o_body){
		$("#box_container").height(o_new);
	}
	
	//alert(o_cont+" / "+o_body + " / "+o_deduct+" / "+o_new);
}
