/**	 *	Ultimate Street JS/FL communication api *  date: 23:05 20 iunie 2010 *  version: 1.0.1 *  *  revision: 12:23 25 iunie 2010 *	revision: 11:38 18 octombrie 2010 *//* class USSlideshow */function USSlideshow(){	/* static method */	if( typeof USSlideshow.instances == "undefined"){		USSlideshow.instances = new Object();		}		/* instance property */		this.containerHolder;	this.swfFile;		this.swfColor = "#FFFFFF";	this.swfwmode = "normal";	this.swfVisibility = "hidden"; // visible | hidden	this.data;		/* instance methods */	this.embedSWF = function(container, width, height){		this.containerHolder = container;				USSlideshow.instances[container] = this;						var params = {};		params.menu = "false";		params.wmode = this.swfwmode;				params.bgcolor = this.swfColor;		params.allowscriptaccess = "always";		var attributes = {};				attributes.quality = "best";		attributes.name = attributes.id = this.swfFile = container + "_USSlideshowFile";		attributes.visibility = this.swfVisible;		var flashvars = {};		flashvars.flashContainer = container;						swfobject.embedSWF(flash_url+"/USSlideshow.swf", this.containerHolder, width, height, "10.0.0", flash_url+"/expressInstall.swf", flashvars, params, attributes);	}		/** 	 *	Callback on flash when is ready to be use in html page	 */	this.onReady = function(){		//debug(this.swfFile + " onReady");	}		/** 	 *	Call before animation start to play	 */	this.onChanging = function(currentPictureIndex /* Number */){		//debug(currentPictureIndex);	}		/** 	 *	Call when animation finish	 */	this.onChanged = function(currentPictureIndex /* Number */){		//debug(currentPictureIndex);	}		/** 	 *  INFO: this function must be use only after "onReady" function was called from flash	 *	Set slideshow seconds slide	 */	this.setSeconds = function(seconds /* Number */){		if(!this.isAccessible()) return;		htmlElement(this.swfFile).setSeconds(seconds);	}		/** 	 *  INFO: this function must be use only after "onReady" function was called from flash	 *	Set slideshow seconds slide	 */	this.getSeconds = function()/* return Number */{		if(!this.isAccessible()) return;		return htmlElement(this.swfFile).getSeconds();	}		/** 	 *  INFO: this function must be use only after "onReady" function was called from flash	 *	Set pictures data	 	 */	this.setData = function(data /* Array */){		if(!this.isAccessible()) return;		this.data = data;		htmlElement(this.swfFile).setData(data);	}		/** 	 *  INFO: this function must be use only after "onReady" function was called from flash	 *	reutrn current picture index	 */	this.getPictureIndex = function(){		if(!this.isAccessible()) return;				return htmlElement(this.swfFile).getPictureIndex();	}		/** 	 *  INFO: this function must be use only after "onReady" function was called from flash	 *	Set dynamical skin graphics	 */	this.setSkin = function(skin /* Array */){		if(!this.isAccessible()) return;		htmlElement(this.swfFile).setSkin(skin);	}		this.click = function(){		if(!this.isAccessible()) return;				if(this.data[this.getPictureIndex()].target == "_self"){			// enable browser back button if it's in same page			window.location.href = this.data[this.getPictureIndex()].click;				} else {			window.open(this.data[this.getPictureIndex()].click, this.data[this.getPictureIndex()].target );				}	}		this.select = function(id /* Number */){		if(!this.isAccessible()) return;		htmlElement(this.swfFile).select(id);	}		/** 	 *  INFO: this function must be use only after "onReady" function was called from flash	 *	Next picture	 */	this.next = function(){		if(!this.isAccessible()) return;		htmlElement(this.swfFile).next();	}		/** 	 *	Previous picture	 */	this.previous = function(){		if(!this.isAccessible()) return;		htmlElement(this.swfFile).previous();	}		/**	 *  INFO: this function must be use before embedSWF function		 *	Set the swf background color 	 *	@c : #FF0000	 */	this.setBgColor = function(c /* Number */){				this.swfColor = c;			}		/**	 *  INFO: this function must be use before embedSWF function		 *	Use on z-index flash order with other elements in html 	 *	@b : true | false	 */	this.setTransparent = function(b /* Boolean */){		if(b)			this.swfwmode = "transparent";		else			this.swfwmode = "normal";	}		/**	 *	Get container where should hold swf file	 	 */	this.getContainer = function() /* return Object */{		return this.containerHolder;	}		/**	 *	Swf file name	 */	this.getName = function()/* return String */{		return this.swfFile;	}			/**	 *	Can access swf file in html page	 */	this.isAccessible = function(){				try{			return htmlElement(this.swfFile).isAccessible();		}catch(err){			return false;		}	}		/**	 *	Get current instance from instances "static" method	 */	this.getInstance = function() /* return USSlideshow Object */{		return USSlideshow.instances[this.swfFile];	}}  /* class Timer */function USTimer(){		/* static method */	if( typeof USTimer.instances == "undefined"){		USTimer.instances = new Object();		}		/* instance property */		this.containerHolder;	this.swfFile;		this.swfColor = "#FFFFFF";	this.swfwmode = "normal";	this.swfVisibility = "hidden"; // visible | hidden			/* instance methods */	this.embedSWF = function(container, width, height){		this.containerHolder = container;				USTimer.instances[container] = this;						var params = {};		params.menu = "false";		params.wmode = this.swfwmode;		params.bgcolor = this.swfColor;				params.allowscriptaccess = "always";		var attributes = {};			attributes.quality = "best";			attributes.name = attributes.id = this.swfFile = container + "_USTimerFile";		attributes.visibility = this.swfVisible;		var flashvars = {};		flashvars.flashContainer = container;						swfobject.embedSWF(flash_url+"/USTimer.swf", this.containerHolder, width, height, "10.0.0", flash_url+"/expressInstall.swf", flashvars, params, attributes);	}		/** 	 *	Callback on flash when is ready to be use in html page	 */	this.onReady = function(){		//debug(this.swfFile + " onReady");	}		this.onTicTac = function(currentCount /* Number */){		//debug("onTicTac: " + currentCount);	}			/**	 *  INFO: this function must be use only after "onReady" function was called from flash	 	 */	this.setSeconds = function(s /* Number */){		if(!this.isAccessible()) return;		htmlElement(this.swfFile).setSeconds(s);			}		this.start = function(){		if(!this.isAccessible()) return;		htmlElement(this.swfFile).start();			}		this.stop = function(){		if(!this.isAccessible()) return;		htmlElement(this.swfFile)._stop();	/* hack for iexplore */		}		this.pause = function(){		if(!this.isAccessible()) return;		htmlElement(this.swfFile).pause();			}		this.resume = function(){		if(!this.isAccessible()) return;		htmlElement(this.swfFile).resume();			}		/**	 *	Set the swf background color 	 *	@c : #FF0000	 */	this.setBgColor = function(c /* Number */){				this.swfColor = c;			}		/**	 *  INFO: this function must be use before embedSWF function			 *	Use on z-index flash order with other elements in html 	 *	@b : true | false	 */	this.setTransparent = function(b /* Boolean */){		if(b)			this.swfwmode = "transparent";		else			this.swfwmode = "normal";	}		/**	 *	Get container where should hold swf file	 	 */	this.getContainer = function() /* return Html Object */{		return this.containerHolder;	}		/**	 *	Swf file name	 */	this.getName = function() /* return String */{		return this.swfFile;	}			/**	 *	Can access swf file in html page	 */	this.isAccessible = function() /* return true | false */{				try{			return htmlElement(this.swfFile).isAccessible();		}catch(err){			return false;		}	}		/**	 *	Get current instance from instances "static" method	 */	this.getInstance = function()/* return USTimer Object */{		return USTimer.instances[this.swfFile];	}		}/* class USThumbnailsSlider */function USThumbnailsSlider(){		/* static method */	if( typeof USThumbnailsSlider.instances == "undefined"){		USThumbnailsSlider.instances = new Object();		}		/* instance property */		this.containerHolder;	this.startThumb = 0;	this.swfFile;		this.swfColor = "#535353";	this.swfwmode = "normal";	this.swfVisibility = "hidden"; // visible | hidden			/* instance methods */	this.embedSWF = function(container, width, height){		this.containerHolder = container;				USThumbnailsSlider.instances[container] = this;						var params = {};		params.menu = "false";		params.wmode = this.swfwmode;		params.bgcolor = this.swfColor;				params.allowscriptaccess = "always";		var attributes = {};			attributes.quality = "best";			attributes.name = attributes.id = this.swfFile = container + "_USThumbnailsSliderFile";		attributes.visibility = this.swfVisible;		var flashvars = {};		flashvars.flashContainer = container;						swfobject.embedSWF(flash_url+"/USThumbnailsSlider.swf", this.containerHolder, width, height, "10.0.0", flash_url+"/expressInstall.swf", flashvars, params, attributes);	}		/** 	 *	Callback on flash when is ready to be use in html page	 */	this.onReady = function(){		//debug(this.swfFile + " onReady");	}		this.onThumbChanged = function(obj /* Thumb */){		//debug("onThumbChanged: " + obj.id);	}		this.setSecondsMoveToCenter = function(sec /* Number */){				if(!this.isAccessible()) return;		htmlElement(this.swfFile).setSeconds(sec);	}		this.getSecondsMoveToCenter = function(sec /* Number */){				if(!this.isAccessible()) return;		return htmlElement(this.swfFile).getSeconds();	}		this.setSwfPictureBackground = function (src /* String */){		if(!this.isAccessible() || !src) return;				return htmlElement(this.swfFile).setSwfPictureBackground(src);	}		this.setSecondsThumbAnimation = function(sec /* Number */){		if(!this.isAccessible()) return;		htmlElement(this.swfFile).setSecondsThumbAnimation(sec);	}		this.getSecondsThumbAnimation = function(sec /* Number */){		if(!this.isAccessible()) return;		return htmlElement(this.swfFile).getSecondsThumbAnimation();	}		this.onClick = function(obj /* Thumb */){		//debug("USThumbnailsSlider.onClick: " + obj.id );	}		this.next = function(){		if(!this.isAccessible()) return;		if(this.isAnimationPlaying()) return;		htmlElement(this.swfFile).next();	}		this.setThumbSize = function(w, h){		if(!this.isAccessible()) return;				htmlElement(this.swfFile).setThumbSize(w, h);	}		this.setThumbsGap = function(g){		if(!this.isAccessible()) return;				htmlElement(this.swfFile).setThumbsGap(g);	}		this.setThumbsYOffset = function(yoffset){		if(!this.isAccessible()) return;				htmlElement(this.swfFile).setThumbsYOffset(yoffset);	}		this.setThumbsXOffset = function(xoffset){		if(!this.isAccessible()) return;				htmlElement(this.swfFile).setThumbsXOffset(xoffset);	}		this.enableUIMouse = function(b /* Boolean */){		if(!this.isAccessible()) return;				htmlElement(this.swfFile).enableUIMouse(b);	}		this.previous = function(){		if(!this.isAccessible()) return;		if(this.isAnimationPlaying()) return;		htmlElement(this.swfFile).previous();	}		this.isAnimationPlaying = function()/* Boolean */{		if(!this.isAccessible()) return;		return htmlElement(this.swfFile).isAnimationPlaying();	}		this.getStartThumb = function(){		return this.startThumb;	}		this.setStartThumb = function(idx /* Number */){				this.startThumb = idx;		debug("USThumbnailsSlider.setStartThumb: " + this.startThumb);	}		/**	 *	Set the swf background color 	 *	@c : #FF0000	 */	this.setBgColor = function(c /* Number */){				this.swfColor = c;			}		/**	 *  INFO: this function must be use before embedSWF function			 *	Use on z-index flash order with other elements in html 	 *	@b : true | false	 */	this.setTransparent = function(b /* Boolean */){		if(b)			this.swfwmode = "transparent";		else			this.swfwmode = "normal";	}		this.setData = function( data /* Array */){		if(!this.isAccessible()) return;		htmlElement(this.swfFile).setData(data);	}		this.setSkin = function( data /* Array */){		if(!this.isAccessible()) return;		htmlElement(this.swfFile).setSkin(data);	}		this.setSeconds = function(sec){		if(!this.isAccessible()) return;		htmlElement(this.swfFile).setSeconds(sec);	}		this.getSeconds = function() /* return Number */{		if(!this.isAccessible()) return;		return htmlElement(this.swfFile).getSeconds();	}		this.select = function(idx /* Number */){		if(!this.isAccessible()) return;		if(this.isAnimationPlaying()) return;		htmlElement(this.swfFile).select(idx);	}		this.getCurrentThumbIdx = function() /* return Number */{		if(!this.isAccessible()) return;		return htmlElement(this.swfFile).getCurrentThumbIdx();		}		/**	 *	Get container where should hold swf file	 	 */	this.getContainer = function() /* return Html Object */{		return this.containerHolder;	}		/**	 *	Swf file name	 */	this.getName = function() /* return String */{		return this.swfFile;	}			/**	 *	Can access swf file in html page	 */	this.isAccessible = function() /* return true | false */{				try{			return htmlElement(this.swfFile).isAccessible();		}catch(err){			return false;		}	}		/**	 *	Get current instance from instances "static" method	 */	this.getInstance = function()/* return USThumbnailsSlider Object */{		return USThumbnailsSlider.instances[this.swfFile];	}}	/* class USCarousel */function USCarousel(){		/* static method */	if( typeof USCarousel.instances == "undefined"){		USCarousel.instances = new Object();		}		/* instance property */		this.containerHolder;	this.swfFile;		this.swfColor = "#FFFFFF";	this.swfwmode = "normal";		this.swfVisibility = "hidden"; // visible | hidden			this.skin = new Array();	this.data = new Array();			/* instance methods */	this.embedSWF = function(container, width, height){		this.containerHolder = container;				USCarousel.instances[container] = this;						var params = {};		params.menu = "false";		params.wmode = this.swfwmode;		params.bgcolor = this.swfColor;				params.allowscriptaccess = "always";				var attributes = {};			attributes.quality = "best";			attributes.name = attributes.id = this.swfFile = container + "_USCarouselFile";		attributes.visibility = this.swfVisible;		var flashvars = {};		flashvars.flashContainer = container;						swfobject.embedSWF(flash_url+"/USCarousel.swf", this.containerHolder, width, height, "10.0.0", flash_url+"/expressInstall.swf", flashvars, params, attributes);	}		/** 	 *	Callback on flash when is ready to be use in html page	 */	this.onReady = function(){		//debug(this.swfFile + " onReady");	}		this.addThumbData = function (o /* Object */){		this.data.push( { id:this.data.length, videoId:o.videoId, picture:o.picture, title:o.title, text:o.text } );	}		this.setData = function(arr /* Array */){				if(this.data.length < 5){			//debug("Error: You must have at least 5 thumb data!");			return;		}				if(this.isAccessible()){			htmlElement(this.swfFile).setData(this.data);		}	}		this.setSkin = function(arr /* Array */){						/*this.skin.push( { skin:"assets/btn_left_video_home.png", x:75, y:335, type:"btnLeft", callback:"previous" } );		this.skin.push( { skin:"assets/btn_right_video_home.png", x:660, y:335, type:"btnRight", callback:"next" } );		this.skin.push( { skin:"assets/e_btn_shadow.jpg", x:75, y:397, width:513, height:289, type:"btnShadowLeft" } );		this.skin.push( { skin:"assets/e_btn_shadow.jpg", x:660, y:397, width:513, height:289, type:"btnShadowRight" } );				this.skin.push( { skin:"assets/e_pic_shadow.jpg", x:-10, y:340, width:513, height:289, type:"thumbShadow" } );		this.skin.push( { skin:"assets/video_home_play_video_btn_n.png", x:395, y:330, type:"btnThumbPlayVideo", callback:"#onUSCarouselClick" } );		this.skin.push( { skin:"assets/e_pic_top.jpg", x:0, y:0, width:513, height:34, type:"thumbTop" } );		this.skin.push( { skin:"assets/e_pic_bottom.jpg", x:0, y:323, width:513, height:57, type:"thumbBottom" } );		this.skin.push( { skin:"assets/e_pic_bg.jpg", x:0, y:34, width:513, height:289, type:"thumbCenter" } );				if(this.isAccessible()){			htmlElement(this.swfFile).setSkin(this.skin);		}*/				if(this.isAccessible()){			htmlElement(this.swfFile).setSkin(arr);		}	}		this.setSeconds = function(sec){		if(!this.isAccessible()) return;		htmlElement(this.swfFile).setSeconds(sec);	}		this.getSeconds = function() /* return Number */{		if(!this.isAccessible()) return;		return htmlElement(this.swfFile).getSeconds();	}		/**	 *	Set the swf background color 	 *	@c : #FF0000	 */	this.setBgColor = function(c /* Number */){				this.swfColor = c;			}		/**	 *  INFO: this function must be use before embedSWF function			 *	Use on z-index flash order with other elements in html 	 *	@b : true | false	 */	this.setTransparent = function(b /* Boolean */){		if(b)			this.swfwmode = "transparent";		else			this.swfwmode = "normal";	}		this.onClick = function(o /* Object */){		//debug("USCarousel.onClick: " + o.videoId);	}		/**	 *	Get container where should hold swf file	 	 */	this.getContainer = function() /* return Html Object */{		return this.containerHolder;	}		/**	 *	Swf file name	 */	this.getName = function() /* return String */{		return this.swfFile;	}			/**	 *	Can access swf file in html page	 */	this.isAccessible = function() /* return true | false */{				try{			return htmlElement(this.swfFile).isAccessible();		}catch(err){			return false;		}	}		/**	 *	Get current instance from instances "static" method	 */	this.getInstance = function()/* return USCarousel Object */{		return USCarousel.instances[this.swfFile];	}}	/* Util functions */function htmlElement(id /* String */){	return document.getElementById(id);}function loadSWFObjectLibrary(jsFile /* String */) {			var elem = document.createElement('script');	elem.setAttribute('type', 'text/javascript');	elem.setAttribute('src', jsFile);	document.getElementsByTagName('head')[0].appendChild(elem);}function debug(msg /* String */){	/*if (!window.console){		console = {};		console.log = console.log || function(){};		console.warn = console.warn || function(){};		console.error = console.error || function(){};		console.info = console.info || function(){};	}		console.log(msg);*/	//htmlElement("txt").innerHTML = msg;}
