var Splash = {
	
	init: function(options){
		
		this.options = $extend({
		}, options || {});
		
		var loc = String(document.location);
		if(loc.indexOf("#")>-1){
			window.location.href = loc.replace("/#/","/");
		}
		
		this.activeTab = -1;
		
		this.activeSlide = 0;
		this.slides = new Array("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u");
		
		$$('a.tab-link').each(function(el,i){
			el.addEvent('mouseover', function(e) {
      			Splash.showTab(i);
      			return false;
			});
      	});
		$$('a.app-link').each(function(el,i){
			el.addEvent('click', function(e) {
      			Splash.launchApp();
      			return false;
			});
      	});
      	$$('div.tab').each(function(el,i){
			el.setAttribute("id","tab_"+i);
      	});
      	/*
      	window.addEvent('resize',function(e){
			Splash.setLayout();
		});
		this.setLayout();
      	*/
      	this.showTab(0);
      	
      	var periodicalFunctionVar = this.stepSlides.periodical(3000,Splash);
	},
	/*
	setLayout:function(){
		window.resizeTo(1000,750);
	},	
	*/
	stepSlides:function(){
		if(this.activeSlide<this.slides.length-1){
			this.activeSlide+=1;
		}
		else{
			this.activeSlide = 0;
		}
		$('slide').set('src',"app/intro/images/anim/thisone/"+this.slides[this.activeSlide].toUpperCase()+"_FT1.jpg");
	},	
	showTab:function(c){
		if(this.activeTab>-1){
			$('tab_'+this.activeTab).removeClass('active-tab');
		}
		$('tab_'+c).addClass('active-tab');
		this.activeTab = c;
	},
	launchApp:function(){
		var page = "section/fromto/";
		/*
		var sw = screen.width
		var sh = screen.height
 		var w = sw - 0 // to center: use desired width
		var h = sh - 50 // to center: use desired height
		var cx = 0  // to center: (.5*sw) - (w*.5)
		var cy = 0 // to center: (.5*sh) - (h*.5)
		var  props = 'resizable=no,width='+w+','+'height='+h+',' + 'screenX=' +cx+','+'screenY='+cy+','+'left='+cx+','+'top='+cy;
		window.open(page,"fromto",props);
		*/
		window.location.href = page;
		return false;		
	}
}