/**
 * impex.js
 *
 * @version 1.0
 * @package impex.nl
 * @author  a.j.de vries
 *
 * Copyright (c) Malibomba
 * IT IS NOT ALLOWED TO USE OR MODIFY ANYTHING OF
 * THIS CODE, WITHOUT THE PERMISION OF THE AUTHOR.
 * Info? Mail to info@malibomba.com
 */
//<![CDATA[
/**
 * ADD REQUIRED SCRIPTS:
 ----------------------------------------------------------*/
var words = [];
var required = [
	'words.js.php',
	'mootools.ticker.js',
	'mootools.slideshow.js',
	'mootools.haccordion.js',
	'sifr.js', 'sifr-config.js',
	'clearbox.js',
	'swfobject.js'
];

if( (scripts = document.getElementsByTagName('script')) !== null ) {
	for( var i = 0, len = scripts.length; i < len; i++ ) {
		if( scripts[i] && scripts[i].src.match(/impex\.js(\?.*)?$/) ) {
			var path = scripts[i].src.replace(/impex\.js(\?.*)?$/, '');
			for( var x = 0, len = required.length; x < len; x++ ) {
				document.write('<script type="text/javascript" src="' + (path + required[x]) + '"></script>');
			}
		}
	}
}









/**
 * MOOTOOLS BASED:
 ----------------------------------------------------------*/
window.addEvent('domready', function(){


	/** banner **/
	var so = new SWFObject("/flash/globe.swf", "Impex", "240", "162", "8", "#ffffff");
	so.addParam("wmode", "transparent");
	so.write("lc-detail-inner");

	/**show = new SlideShow('lc-detail','slideshow-thumb', {
		wait: 4000,
		effect:'fade', //fade|wipe|slide|random
		direction:'top', //top|right|bottom|left|random
		duration:4000,
		loop:true,
		backgroundSlider:true,
		loadingCls:'loading',
		onClick: function(i){alert(i)}
	} );
	show.play();

	$('sf').addEvent('submit', function() {
		if( $('qs').value != '' ) {
			return true;
		}
		alert( word(32) )
		return false;
	} )

			<div id="thumbnails">
				<img src="/pics/bg.detail-europe.png" width="240" height="162" class="slideshow-thumb" />
				<img src="/pics/bg.detail-europe2.png" width="240" height="162" class="slideshow-thumb" />
				<img src="/pics/bg.detail-usa.png"  width="240" height="162" class="slideshow-thumb" />
				<img src="/pics/bg.detail-usa2.png"  width="240" height="162" class="slideshow-thumb" />
			</div>

	**/

} );


/**
 * UTILITIES:
 ----------------------------------------------------------*/
function word() {
	var re;
	var args = arguments;
	var word = words[args[0]];
	if( word !== undefined ) {
		for(var x = 1; x < args.length; x++) {
			re = new RegExp('#' + x);
			word = word.replace(re, args[x]);
		}
		return word;
	}
}

//]]>