$('document').ready(function(){
	swfobject.embedSWF('assets/templates/jivaldi2009/home.swf','home_flash_box','482','860','9.0.0',null,null,
	{
		menu:'false',
		wmode:'transparent',
		scale:'noScale'
	});
});


$('document').ready(function(){
	swfobject.embedSWF('assets/templates/jivaldi2009/flash_showcase/slider0.swf','flash_showcase','482','220','9.0.0',null,null,
	{
		menu:'false',
		scale:'noScale',
		wmode:'transparent',
		allowScriptAccess:'sameDomain'
	});
});

var showcaseApp;
var ShowCaseApp=function(){
	this._current=-1;
	var flashShowcase;
	var that=this;
	this.init=function(){
		flashShowCase=document.getElementById('flash_showcase');
		$('.showcaselink').click(function(){
			var id=parseInt(this.id.split('showcaselink_')[1],10);
			id=id-1;
			that.goto(id);
			return false;
		});
		this.goto(0);
		$('#showcase_buttons').fadeIn();
	}
	
	this.goto=function(qindex){
		if(this._current!=qindex){
			if(this._current>=0){
				$('#showcaselink_'+(this._current+1)).removeClass('showcasecurrent');
				$('#showcase_text_'+(this._current+1)).hide();
			}
			this._current=qindex;
			try{
				flashShowCase.gotoSItem(this._current);
				$('#showcaselink_'+(this._current+1)).addClass('showcasecurrent');
				$('#showcase_text_'+(this._current+1)).fadeIn('fast');
			}
			catch(e){
				alert('error');
			}
		}
	}
}

function initShowcase(){
	
	showcaseApp=new ShowCaseApp();
	showcaseApp.init();
}