jQuery.noConflict();

var labelToInput = {

	init: function() {
	
		jQuery('.labelvalue').each(function(){
			jQuery(this).css("display","none");
			var txt = jQuery(this).text();
			var chpsTxt = jQuery(this).next().children(':text, :password');
			
			if(chpsTxt.attr('type') == "text") {
				chpsTxt.val(txt);
				chpsTxt.focus(function(e){if(jQuery(e.target).val() == txt) jQuery(e.target).val('')});
				chpsTxt.blur(function(e){if(jQuery(e.target).val() == '') jQuery(e.target).val(txt)});
			}
			
			if(chpsTxt.attr('type') == "password") {
				var newInput = jQuery('<input type="text" />');
				jQuery(newInput).attr('class',chpsTxt.attr('class'))
				jQuery(newInput).attr('id',chpsTxt.attr('id'));
				jQuery(newInput).val(txt);
			
				var oldInput = chpsTxt.clone();
				jQuery(chpsTxt).replaceWith(newInput);
				newInput.focus(function(e){ jQuery(e.target).replaceWith(oldInput); oldInput.focus();});
			}
		});
		
	}

}

var DecorateProductList = {
	init: function() {
		
		var currentTallest = 0;
		
		$$('.products-grid li').each( function(elmt) {
			Event.observe(elmt, 'mouseover', DecorateProductList.colorIt);
			Event.observe(elmt, 'mouseout', DecorateProductList.uncolorIt);
		});
		
	},
	
	colorIt: function(event) {
		$(this).addClassName('over');
	},
	
	uncolorIt: function(event) {
		$(this).removeClassName('over');
	}
}

jQuery().ready(function() {
	
	Cufon.replace('.cufon-helvet', { hover: true, fontFamily: 'Helvetica', fontStyle: 'normal' });
	
	labelToInput.init();
	DecorateProductList.init();
	
	if(jQuery('.fb_elements').length > 0)
	{
		//-- Lightbox product page
		jQuery("a.fb_elements").fancybox({
			'overlayOpacity':'0.6',
			'overlayColor':'#000',
			'titleShow':'false'	
		});
	}
	
	if(jQuery('#homeSlider').length > 0)
	{
		jQuery('#homeSlider').bxSlider({
			auto: true,
			controls: false,
			pager: true,
			pause: 5000
		});
	}
	
});

