// MooTools More - w/ "Assets" only...// MooTools More <http://mootools.net/more>.// Copyright (c) 2006-2009 Aaron Newton <http://clientcide.com/>,// Valerio Proietti <http://mad4milk.net>// & the MooTools team <http://mootools.net/developers>,// MIT Style License.MooTools.More={version:"1.2.3.1"};var Asset={javascript:function(f,d){d=$extend({onload:$empty,document:document,check:$lambda(true)},d);var b=new Element("script",{src:f,type:"text/javascript"});var e=d.onload.bind(b),a=d.check,g=d.document;delete d.onload;delete d.check;delete d.document;b.addEvents({load:e,readystatechange:function(){if(["loaded","complete"].contains(this.readyState)){e();}}}).set(d);if(Browser.Engine.webkit419){var c=(function(){if(!$try(a)){return;}$clear(c);e();}).periodical(50);}return b.inject(g.head);},css:function(b,a){return new Element("link",$merge({rel:"stylesheet",media:"screen",type:"text/css",href:b},a)).inject(document.head);},image:function(c,b){b=$merge({onload:$empty,onabort:$empty,onerror:$empty},b);var d=new Image();var a=document.id(d)||new Element("img");["load","abort","error"].each(function(e){var f="on"+e;var g=b[f];delete b[f];d[f]=function(){if(!d){return;}if(!a.parentNode){a.width=d.width;a.height=d.height;}d=d.onload=d.onabort=d.onerror=null;g.delay(1,a,a);a.fireEvent(e,a,1);};});d.src=a.src=c;if(d&&d.complete){d.onload.delay(1);}return a.set(b);},images:function(d,c){c=$merge({onComplete:$empty,onProgress:$empty,onError:$empty,properties:{}},c);d=$splat(d);var a=[];var b=0;return new Elements(d.map(function(e){return Asset.image(e,$extend(c.properties,{onload:function(){c.onProgress.call(this,b,d.indexOf(e));b++;if(b==d.length){c.onComplete();}},onerror:function(){c.onError.call(this,b,d.indexOf(e));b++;if(b==d.length){c.onComplete();}}}));}));}};new Asset.css('/global/css/globalnav.css');new Asset.css('/global/css/print.css', {media: 'print'});//new Asset.javascript("http://global.mcbridals.com/js/session.js");// load CSS for "products", "favorites" and "dealers" pages...var pageurl = document.location.toString();if (pageurl.indexOf('/item/') != -1) {    new Asset.css('/global/css/products-grid.css');    new Asset.css('/global/css/products-item.css');    new Asset.css('/global/css/products-print.css', {media: 'print'});}if (pageurl.indexOf('/dresses/') != -1) {	new Asset.css('/global/css/products-grid.css');	new Asset.css('/global/css/products-item.css');	new Asset.css('/global/css/products-print.css', {media: 'print'});}	if (pageurl.indexOf('/favorites/') != -1) {	new Asset.css('/global/css/products-grid.css');	new Asset.css('/global/css/products-item.css');	new Asset.css('/global/css/products-item-print.css', {media: 'print'});	new Asset.css('/global/css/favorites.css');}if (pageurl.indexOf('/dealers/') != -1) {	new Asset.css('/global/css/dealers.css');}if (pageurl.indexOf('/glossary/') != -1) {	new Asset.css('/global/css/glossary.css');}window.addEvent('domready', function() {	new Asset.javascript('/global/js/menus.js');	new Asset.javascript('/global/js/globalnav.js');			// load JavaScript for "dresses", "favorites" and "dealers" pages...		if (pageurl.indexOf('/dresses/') != -1){	    // IE7 doesn't seem to throw the onload event for the JS.  Thanks again IE.	    if (Browser.Engine.trident){		new Asset.javascript('/global/js/itemView.js');		new Asset.javascript('/global/js/moozoom.js');		new Asset.javascript('/global/js/gallery.js');	    }	    else {		new Asset.javascript('/global/js/itemView.js',				     {onLoad: "new Asset.javascript('/global/js/moozoom.js'); new Asset.javascript('/global/js/gallery.js');"					     }				     );	    }			    if (Browser.Engine.trident4) { } else { /* IE6 */		new Asset.javascript('http://s7.addthis.com/js/250/addthis_widget.js#pub=mcbridals');	    }	}	if (pageurl.indexOf('/item/') != -1) {            // IE7 doesn't seem to throw the onload event for the JS.  Thanks again IE.            if (Browser.Engine.trident){                new Asset.javascript('/global/js/itemView.js');                new Asset.javascript('/global/js/moozoom.js');            }            else {                new Asset.javascript('/global/js/itemView.js',                                     {onLoad: "new Asset.javascript('/global/js/moozoom.js');"                                             }                                     );            }	                if (Browser.Engine.trident4) { } else { /* IE6 */                new Asset.javascript('http://s7.addthis.com/js/250/addthis_widget.js#pub=mcbridals');            }        }		if (pageurl.indexOf('/favorites/') != -1) {	    new Asset.javascript('/global/js/moozoom.js');	    new Asset.javascript('/global/js/itemView.js');	    new Asset.javascript('/global/js/favorites.js');	    	    if (Browser.Engine.trident4) { } else { /* IE6 */		new Asset.javascript('http://s7.addthis.com/js/250/addthis_widget.js#pub=mcbridals');	    }	}		if (pageurl.indexOf('/dealers/') != -1) {			new Asset.javascript('/global/js/dealers.js');	}	if (pageurl.indexOf('/sweepstakes/') != -1){	    new Asset.javascript('/global/js/sweepstakes.js');	}		//----------------------------------------		(function() {		new Asset.javascript('/wp-content/themes/projekt/js/local.js');	}).delay(750); // was set at 500 and was still throwing occcasional errors where the top bar and nav wouldn't appear on page load	});function getAjax(url) {	var req = new Request.HTML({		url: url, 		onSuccess: function(html) {			$('body').adopt(html);			domCheck();		},		onFailure: function() {			alert('ajax error');		}	});	req.send();}var section = 0;window.section = section;function domCheck() {	if ($('left') && (window.section != 0)) {		domReady();	}	else {		waitForIt();	}}function waitForIt() {	(function() {		domCheck();	}).delay(100);	}function domReady() {	if (($(document.body).className.indexOf('rinadimontella') != -1) || ($(document.body).className.indexOf('sophiatolli') != -1) || ($(document.body).className.indexOf('moncheribridals') != -1) || ($(document.body).className.indexOf('jamescliffordcollection') != -1) || ($(document.body).className.indexOf('tonybowls') != -1)) {			if ((pageurl.indexOf('contact') != -1) || (pageurl.indexOf('faqs') != -1) || (pageurl.indexOf('employment') != -1) || (pageurl.indexOf('media-kit') != -1) || (pageurl.indexOf('catalogs') != -1)) {					var img = $('left').getFirst();			var currentSRC = img.getAttribute('src').toString();			var cleanSRC = currentSRC.replace(/.jpg/, '');			var newSRC = cleanSRC + '-' + window.section + '.jpg';			img.setAttribute('src', newSRC);		}	}}