// JavaScript Document
SqueezeBox.parsers.swf = function(preset) {
		return (preset || this.url.test(/\.swf/)) ? this.url : false;
	};
	 
	SqueezeBox.handlers.swf = function(url) {
		var size = this.options.size;
		var video = this.options.video;
		return new Swiff(url, {
			id: 'sbox-swf',
			width: size.x,
			height: size.y,
			params: {
				wmode: 'opaque',
				allowfullscreen: 'true'
			},
			vars:{
				vid : video
				}
		});
	};
	
	window.addEvent('domready',function(){
		//squeezebox
		SqueezeBox.assign($$('a.boxed'), {
			parse: 'rel'
		});
		
		//sliders
		if($('box2')){
			var nS2 = new noobSlide({
				box: $('box2'),
				items: [0,1,2,3],
				size: 960,
				handles: $$('#thumbs span'),
				fxOptions: {
					duration: 2000
				},
				addButtons: {
					previous: $('prev'),
					next: $('next')
				},
				onWalk: function(currentItem,currentHandle){
					//style for handles
					$$(this.handles).removeClass('active');
					$$(currentHandle).addClass('active');
				}
			});
			//if slide is passed go to that slide
			if(s > 0 && s < 5 ){
				nS2.walk(s-1);
				//go there without animating
				//nS2.walk(s-1,false,true);
			}
		}
	});