/*
# ------------------------------------------------------------------------
# SlideShow Pro SP2 module for Joomla 1.5
# ------------------------------------------------------------------------
# Copyright (C) 2010 JoomShaper.com. All Rights Reserved.
# @license - PHP files are GNU/GPL V2. CSS / JS are Copyrighted Commercial,
# Author: JoomShaper.com
# Websites:  http://www.joomshaper.com -  http://www.joomxpert.com
# Redistribution, Modification or Re-licensing of this file in part of full, 
# is bound by the License applied. 
# ------------------------------------------------------------------------
*/

// mootools 1.11 fix (1.12 don't need this) |------>
window.xpath = !!(document.evaluate);
if (window.ActiveXObject) window.ie = window[window.XMLHttpRequest ? 'ie7' : 'ie6'] = true;
else if (document.childNodes && !document.all && !navigator.taintEnabled) window.webkit = window[window.xpath ? 'webkit420' : 'webkit419'] = true;
else if (document.getBoxObjectFor != null || window.mozInnerScreenX != null) window.gecko = true;
Element.Events.mousewheel.type = (window.gecko) ? 'DOMMouseScroll' : 'mousewheel';
// <-------|

// fix mootools 1.1x
// only if we are use preload
Asset.image = function(source, properties) {
	properties = $merge({
		onload: Class.empty,
		onabort: Class.empty,
		onerror: Class.empty
	}, properties);
	var image = new Image();
	var element = $(image) || new Element('img');
	['load', 'abort', 'error'].each(function(name){
		var type = 'on' + name;
		var cap = name.capitalize();
		if (properties['on' + cap]) properties[type] = properties['on' + cap];
		var event = properties[type];
		delete properties[type];
		image[type] = function(){
			if (!image) return;
			if (!element.parentNode){
				element.width = image.width;
				element.height = image.height;
			}
			image = image.onload = image.onabort = image.onerror = null;
			event.delay(1, element, element);
			element.fireEvent(name, element, 1);
		};
	});
	image.src = element.src = source;
	if (image && image.complete) image.onload.delay(1);
	return element.set(properties);
};
// <------------|


