window.addEvent('domready', initListingTabs);

function initListingTabs() {
	featuredListingTabs = new mootabs('listingTabs', {
		titleClass:'listingTab',
		panelClass:'listingPanel',
		evalScripts:true,
		height: 'auto',
		width: '100%',
		changeTransition: 'none',
		mouseOverClass: 'over'});
}

var openSmooth = function() {
	var from = $('myGallery').clone(), smooth, crsl;
	SqueezeBox.fromElement(from, {size: {x: 465, y: 350}}).chain(function() {
		smooth = new gallery(this.content.getFirst(), {
			timed: false
		});
		// dirty hacked ;)
		$(document.body).addClass('gallery');
		crsl = smooth.carouselContainer.element;
		crsl.injectAfter(SqueezeBox.window);
		crsl.setStyles({'z-index': SqueezeBox.options.zIndex + 3});
	}).chain(function() {
		$(document.body).removeClass('gallery');
		crsl.remove();
	});
}

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 swfobj = new SWFObject(url, 'sbox-swf', size.x, size.y, 9, '#ffffff');
	return swfobj.getSWFHTML();
}