Event.observe(window, 'load', function(){
	if(flashplayer){
		App.loadFlash();
		if(activePage === 'ekione_overview'){
			App.loadOverview();
		}
	}
	App.searchResizeable();	
});

var App =  {
	lastId: 0,
	currentSampleNb: 0,
	
	getNewId: function() {
		App.lastId++;
		return "window_id_" + App.lastId;
	},
	
	searchResizeable:function(){
		var elms = getElementsByClassName('resizeable');
		for(var i = 0; i < elms.length; i++){
			elms[i].setAttribute("onclick","App.loadGreatImg(this.src)");
		}	
	},
	
	loadGreatImg: function(src) {
	  	var win = new Window(App.getNewId(), {
			 className:"alphacube", 
			 height:400,
			 width:600,
			 zIndex:100, 
			 resizable:false, 
			 showEffect:Effect.BlindDown, 
			 hideEffect:Effect.SwitchOff, 
			 draggable:true, 
			 wiredDrag:true
		});
	  	win.getContent().innerHTML = "<div style=\"width:600px;text-align:center;\"><img src=" + src + " /></div>";
		win.showCenter();
	},
	
	// function to load flash components if flashplayer is installed
	loadFlash:function(){
		//alert('sie haben flash installiert');
		var fo = new SWFObject("/files/swf/header.swf?myURL=" + activePage, "flash_top_nav", "1000", "152", "8.0.0", "");
		fo.addParam("wmode", "transparent");
		fo.write("header");
		
		var slideshow = new SWFObject("/files/swf/slideshow.swf", "SlideShow", "1000", "150", "8.0.0", "");
		slideshow.addParam("wmode", "transparent");
		slideshow.write("left_col_content");	
	},
	
	// function to load flash components if flashplayer is installed
	loadOverview:function(){
		//alert('sie haben flash installiert');
		var fo = new SWFObject("/files/swf/overview.swf", "overview", "638", "750", "8.0.0", "");
		fo.addParam("wmode", "transparent");
		fo.write("swf");
	}
}
