// Copyright 2007 by fruehjahr GmbH, Switzerland ///////////
// don't copy, please, ask us. /////////////////////////////

function scriptLoader(url)
{
   document.write('<script src="', url, '" type="text/JavaScript"><\/script>');
}

scriptLoader("js/scroll.js");
scriptLoader("js/tween.js");

	
// Initialize start-me-up.ch - scripts...
function tween(pos){		
	obj = document.getElementById('icon_bg');
	start_pos = Math.round(findPos(obj));
	t1 = new Tween(document.getElementById('icon_bg').style,'left',Tween.backEaseOut,start_pos,pos,1,'px');
	t1.start();
}

function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj == obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft];
	
}

function mininavi(stand){
	if (stand==1){
		document.getElementById('start-me-up-klein').className = 'start-me-up-klein_active';
		document.getElementById('packete-klein').className = 'packete-klein_inactive';	
		document.getElementById('kontakt-klein').className = 'kontakt-klein_inactive';	
	}
	if (stand==2){
		document.getElementById('packete-klein').className = 'packete-klein_active';
		document.getElementById('start-me-up-klein').className = 'start-me-up-klein_inactive';
		document.getElementById('kontakt-klein').className = 'kontakt-klein_inactive';			
	}
	if (stand==3){
		document.getElementById('start-me-up-klein').className = 'start-me-up-klein_inactive';
		document.getElementById('packete-klein').className = 'packete-klein_inactive';
		document.getElementById('kontakt-klein').className = 'kontakt-klein_active';
	}
}

function mininavi_touch(in_out, which){
	if (which==1){
		status = document.getElementById('start-me-up-klein').className;	
		if (status != "start-me-up-klein_active"){
			if (in_out == "in"){
				document.getElementById('start-me-up-klein').className = 'start-me-up-klein_active_temp';	
			} else {
				document.getElementById('start-me-up-klein').className = 'start-me-up-klein_inactive';	
			}
	}
	}
	if (which==2){
		status = document.getElementById('packete-klein').className;	
		if (status != "packete-klein_active"){
			if (in_out == "in"){
				document.getElementById('packete-klein').className = 'packete-klein_active_temp';
			} else {
				document.getElementById('packete-klein').className = 'packete-klein_inactive';
			}
		}
	}
	if (which==3){
		status = document.getElementById('kontakt-klein').className;	
		if (status != "kontakt-klein_active"){
		if (in_out == "in"){
			document.getElementById('kontakt-klein').className = 'kontakt-klein_active_temp';
		} else {
			document.getElementById('kontakt-klein').className = 'kontakt-klein_inactive';
		}
	}
	}
}

function scroll_it(name){
	
	if(name == "start"){
			ScrollSection('start-pane', 'scroller', 'start-pane'); 
	}
	else if (name =="pakete"){
			ScrollSection('pakete-pane', 'scroller', 'start-pane');

	}
	else if (name == "kontakt"){
			ScrollSection('kontakt-pane', 'scroller', 'start-pane'); 
	}
	else if (name == "thanks"){
			ScrollSection('thanks-pane', 'scroller', 'start-pane'); 
	}
}