var Azexis=Azexis||{};Azexis.productImageGalleryControls=function(){var a=$("container");a=$("#container");if(!a){return}var b=$("#images #outer-container").addClass("active");var e=$("#main-image img");var i=$("#product .enlarge");var h=e&&e.parent();var f=$("#images .image img");var k=0;f.each(function(){k+=$(this).outerWidth()});var g=b.width();var j=$("#right-arrow").addClass("enabled");var c=$("#left-arrow").addClass("enabled");a.addClass("active");if(g<k){j.addClass("active")}function d(l){a.animate({left:l},500,"swing",function(){var m=a.position().left;if(-m+g<k){j.addClass("active")}else{j.removeClass("active")}if(m<0){c.addClass("active")}else{c.removeClass("active")}})}j.click(function(l){l.preventDefault;var m=a.position().left;if(-m+g<k){m-=g}d(m)});c.click(function(l){l.preventDefault();var m=a.position().left;if(m<0){m+=g}d(m)});f.click(function(m){m.preventDefault();$("#images .image").each(function(n){$(this).removeClass("active")});$(this.parentNode.parentNode).addClass("active");e.attr("src",this.getAttribute("data-url"));var l=this.getAttribute("data-full");if(l){h.attr("href",this.getAttribute("data-full"));i.show()}else{h.removeAttribute("href");i.hide()}return false})};Azexis.productPoolSelect=(function(){function a(){jQuery.get("profile.php",$("#product-pool-select").serialize(),function(c){var g=c.split("|");var d=$("#product div.productImages");var j=$("#product div.productForm");var f=$("#product div.details");j.html(g[0]);f.html(g[1]);d.html(g[2]);var i=$("#product div.details div.details");if(i.length){i.removeClass("details")}var h=$("#product div.productImages div.productImages");if(h.length){h.removeClass("productImages")}var e=$("#product div.productForm div.productForm");if(e.length){e.removeClass("productImages")}b()})}function b(){var c=$("#product-pool-select select");c.change(a);Azexis.productImageGalleryControls()}return{fetch:a,setTriggers:b}})();jQuery(function(a){var b=a("#product-pool-select-submit");if(b.length){b.hide();Azexis.productPoolSelect.setTriggers()}Azexis.gallery(a("#Gallery"))});

