//Variables
var firstBgChange = false;

//Flash Variables
var flashvars = {};
var params = { AllowScriptAccess: "always" };
var attributes = {};
		
		

//Functions
function switchBackground(c) {
			
			
	//$('body').css("backgroundColor", c);
	if(!firstBgChange) {
		$('body').animate({ backgroundColor: c }, 300 );
		firstBgChange = true;
	} else {
		$('body').animate({ backgroundColor: c, easing: 'linear' }, 2000 );
	}
}



//Custom Font
Cufon.set('fontFamily', 'dinag');
Cufon.set('hover', 'true');
Cufon.replace('#header .nav1 a, #header .nav2 a, .breadcrumb, h2, #slider p, .team strong');
		

//Init Shadowbox
Shadowbox.init({ language:"de-CH", players: ['img'] });

//Init Flash
swfobject.embedSWF("layout/templates/colors.swf", "myContent", "1", "1", "9.0.0", "", flashvars, params, attributes);

//Init Header
$(document).ready(function(){
	$('a[rel=external]').each(function(){$(this).attr("target", "_blank")});
	var fullHeight = $('#header .headerline').innerHeight();
	$('#header .headerline div').animate({ height: fullHeight }, 400);
});

//Init Slider
$(function() {
	$("div#makeMeScrollable").smoothDivScroll({
		scrollingSpeed: 10, 
		mouseDownSpeedBooster: 4, 
		autoScroll: "onstart", 
		autoScrollDirection: "endlessloop", 
		autoScrollSpeed: 0, 
		visibleHotSpots: "onstart",
		startAtElementId: "startAtMe",
		hotSpotsVisibleTime: 3
	});
});
