/* 
 * This provides the functionality to easily embed a clip with Price and booking, 
 * this Version does NOT include swfobject.
 * 
 * Uses: SWFObject v2.2 <http://code.google.com/p/swfobject/>
 * 
 * options = {
 * 	 width: int,
 * 	 height: int,
 *   bookingLink: string (The URL the Booking Button points to),
 *   mp3link: string (URL to a mp3 that will be played),
 *   priceString: string (A String containing the price e.g. "755�"),
 *   priceDescriptionString: string (The text displayed on the front side before the price),
 *   priceInfoString: string (Additional longer Information displayed on the backside),
 *   musicOnStart: Boolean (Should music start playing after loading),
 *   priceColor: hex color,
 *   priceGlowColor: hex color,
 *   priceMoreTextColor: hex color,
 *   mode: small|big,
 *   intro: Boolean,
 *   numberOfLoaderBoxes: int,
 *   boxColor: hex color,
 *   boxSize: int,
 *   boxPadding: int,
 *   animationTime: number,
 *   animationBlendTime: number,
 *   mode: small|big,
 *   backsideTitleColor: hex color,
 *   backsideTitleGlowColor: hex color,
 *   buttonColor: hex color,
 *   buttonOverColor: hex color,
 *   buttonTextColor: hex color,
 *   buttonOverTextColor: hex color,
 *   buttonAlpha: number,
 *   bookingButtonText: string,
 *   backButtonText: string,
 *   priceMoreText: string,
 *   wmode:
 * }
 * 			
 */

function clone(obj){
	if(obj == null || typeof(obj) != 'object')
		return obj;
	
	var temp = new obj.constructor();
	for(var key in obj)
		temp[key] = clone(obj[key]);
  return temp;
}

var clipsPE = function() {
	
	var counted = false,
	empty = function(){}();

	return {
		insert: function(elementId, catalogObjectId, options, version){
			
			if(version == '1'){
				var lOptions = clone(options);
				lOptions.coid = catalogObjectId;
				
				if(lOptions.wmode == '')
					lOptions.wmode = 'direct';
				
				var url = 'http://www.onlinereisekataloge.de/clipsteaser/olimarclips/';
				swfobject.embedSWF (
						'http://www.onlinereisekataloge.de/clipsteaser/olimarclips/clipsPE.swf', 
						elementId, 
						lOptions.width, 
						lOptions.height, 
						'10.0.0', 
						'http://www.onlinereisekataloge.de/clipsteaser/olimarclips/expressInstall.swf', 
						lOptions,
						{
							allowScriptAccess: 'always',
							wmode: lOptions.wmode
						},
						{
							allowScriptAccess: 'always',
							wmode: lOptions.wmode
						});
				if(!counted){
					counted = true;
					document.getElementById(elementId).innerHTML += '<img src="http://interface.travelcms.de/IFIDf4769d1f25e4b18bcee221ff6c754/show/clip/count.gif?rand='+(new Date().getTime())+'" width="1" height="1" border="0" alt="" title="" />';
				}
				
			} //Version 1
		} //Insert
	} //return
	
}();
