(function() {
		var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
		ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
		(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga);
})();

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-9748690-8']);
_gaq.push(['_setDomainName', '.evioo.com']);
_gaq.push(['_trackPageview']);


jQuery();

jQuery(function($) {
      $('a[rel*=facebox]').facebox()
    });(jQuery)

jQuery.fn.numeral = function() {
     this.bind("keypress",function(event) {
         if(event.keyCode != 0&&(event.keyCode<48 || event.keyCode>57 )){
         	jQuery("#zipcode_warning").replaceWith("<div id='zipcode_warning'>Code postal incorrect!</div>");
	     }
         else if (event.which<48 || event.which>57 ){
			jQuery("#zipcode_warning").replaceWith("<div id='zipcode_warning'>Code postal incorrect!</div>");
		 }
     });
     this.bind("paste", function() {
         if (/(^0+)/.test(this.value)) {
         	jQuery("#zipcode_warning").replaceWith("<div id='zipcode_warning'>Code postal incorrect!</div>");
         }
     });
     };

function addToCart(id, targetUrl){
	jQuery("#product_addtocart_form").attr("action",targetUrl);
    jQuery("#product_addtocart_form").submit();
}

//jQuery(function($) {
    //hover effect on product grid
    //jQuery(".cat-middle-middle").hover(
        //function() {
            //jQuery(this).css({'border':'1px solid #D1D1D1'})
              //.find('.price-box')
              //.css({'background-color':'#333', 'border':'1px solid #333'})
              //.find('.price')
              //.css({'color':'#EEE', 'border':'1 px solid #FFF'});
        //},
        //function() {
            //$(this).css({'border':'1px solid #FFF'})
              //.find('.price-box')
              //.css({'background-color':'#F8F8F8', 'border':'1px solid #D8D8D8'})
              //.find('.price')
              //.css({'color':'#AAAAAA'});
        //}
    //);
//});(jQuery)

var slotUrls = new Array();
function populateBrandBlock() {
    brandLogos_copy = brandLogos.slice();
    while (brandLogos_copy.length > 8) brandLogos_copy.splice( Math.floor( Math.random()* brandLogos_copy.length) ,1);
    jQuery.each(brandLogos_copy, function(index, value) { 
        jQuery("#slot"+index).removeClass().addClass('brand-ptlogo_'+value.css);
        slotUrls[index] = value.url;
    });
}
        
function clickBrand(n) {
    document.location.href=slotUrls[n];
}

var homePubUrls = new String();
function populateHomePubBlock() {
    index = Math.floor( Math.random()* homePubBanners.length);
    jQuery("#homePubBlock").removeClass().addClass(''+homePubBanners[index].css);
    homePubUrls = homePubBanners[index].url;
}
        
function clickHomePub(n) {
    document.location.href=homePubUrls;
}
