omw_override_selectBoxIt = true;
function callbackShoppingCart( cart ) {

	if ($(".numItens").length > 0) $(".numItens").html(cart.totalItems)
	if ($(".totalInCart").length > 0) $(".totalInCart").html(cart.totalPrice)
	
	
	
	// resume cart
	if ($("#omw_resume_cart").length > 0) {
		var cartUrl = cart.options.url;
		var cartTrad = cart.options.trad;
		
		var html ='<ol id="mini-cart-list" class="mini-products-list">';
		$.each(cart.items, function() {
			
			html +='<li class="item odd">';
			html +='<a class="product-image" title="'+(this.descricao)+'" href="'+this.url+'">';
			html +='<img width="50" height="50" alt="'+(this.descricao)+'" src="'+this.imagem+'"></a>';
			html +='</a>';
			html +='<div class="product-details">'
			
			html +='<p class="product-name">';
			html +='<a href="'+this.url+'">'+(this.descricao)+'</a>'
			html +='</p><strong>'+this.qtd+'</strong>x<span class="price">'+this.valor+'</span>'
			
			
			html +='</div>';
			html +='</li>';
			
		});
		html +="</ol>";
		
		html +='<div class="actions">'
		html +='<button class="button btn-inline" onclick="location.href=\'/'+cartUrl+'\'" title="'+cartTrad+'" type="button"><span>'
		html +='<span>'+cartTrad+'</span>'
		html +='</span></button></div>'
		
		$("#omw_resume_cart").html(html);
	}	
	
}



$(document).ready(function() {

	//////////////////////////////
    // ZOOM IMAGE GALERIES
    //////////////////////////////
    $("a[rel^='prettyPhoto']").prettyPhoto({autoplay_slideshow: false, overlay_gallery: false, social_tools:false, deeplinking: false, theme:'pp_default', slideshow:5000});


    //////////////////////////////
    // BANNER ROTATOR
	//////////////////////////////
	$('.banner-rotator').bannerRotator({
			width:955,
			height:322,
			effect:'fade',
			navButtons:'large',
			thumbnails:'bullet',
			playButton:false,
			timer:'none',
			tooltip:'none',
			cpanelAlign:'bottomRight',
			responsive:true
			
	});


    //////////////////////////////
    // BEGIN: OMW FORM METATAGS HANDLER
	//////////////////////////////
    $.validator.messages.required = "";
	$.validator.messages.number = "";
	$.validator.messages.email = "";
	$.validator.messages.remote = "";
	$.validator.messages.equalTo = "";
	
	$("form.omw_form").each(function() {
		
		 $(this).validate({
			  errorClass:"errorValidation",
			  errorElement:"span",
			  focusInvalid: true,
			  highlight: function(element, errorClass, validClass) {
					$(element).addClass("errorClass");	 
			  },
			  unhighlight: function(element, errorClass, validClass) {
					$(element).removeClass("errorClass");
			  },
			  
			  submitHandler: function(form) { 
					var humanValidator= $(form).children().find("input[id='humanValidator']").attr("rel").split(",");
					var value1 = parseInt(humanValidator[0]);
					var value2 = parseInt(humanValidator[1]);
					var response = parseInt($(form).children().find("input[id='humanValidator']").val());
					
					if ( value1 + value2 == response ) {
						$(form).find("input.submitbtn").fadeOut("fast", function() {
							$(form).append("<img src='http://www.omeuwebsite.com/images/indicator.gif'>");
							form.submit();
						})
						
						
						return;
					}
					else {
						$(form).children().find("input[id='humanValidator']").focus()
						return false;
					}
				
			  }
		});
	});
	// END: OMW FORM METATAGS HANDLER
	
	
	//////////////////////////////
    // CUSTOM
	//////////////////////////////
    //$(".leftColumn").equalHeights($(".maincontent").height() - 300); 
    
    

    	
});	

