$(document).ready(function(){
	//$(".section").css("width","0px");
	
	if ($(".section")) {
		$(".section").animate({
			width: "100%",
		}, 900);
	}
	
	//$("a.current").css("width","0px");
	
	if ($("a.current")) {
		$("a.current").animate({
			width: "100%",
		}, 900);
	}
	//wenn kein cookie gefunden wird, dann spiele startanimation
	//console.log(getCookie("js_start"));
	if (!getCookie("js_start")){
		start_animation();
		setCookie("js_start","start");
	}
});


function start_animation(){
	
	/*ermittel die Fenster Breite - der linke obere rand von content_right
		Man kann nicht die Breite von content_left nehmen da diese Flexible ist.
	*/
	if (jQuery("#content_right")) {
		jQuery("#content_right").append("<div id='blueOverlay'></div>");
		var blOver = $("div#blueOverlay");
		blOver.css("background-color","#0099BF");
		blOver.css("position","absolute");
		blOver.css("z-index","2");
		blOver.css("top","0");
		blOver.css("left","0");
		blOver.css("width","100%");
		blOver.css("height",$("div#content_left").innerHeight()+"px");
		
		blOver.animate({ 
	       left:blOver.innerWidth()
	      }, 1500,function(){
		  	blOver.remove();
		  });
	}
	

	
	
	
	


}

function setCookie(c_name,value,expiredays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+";path=/"+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString()+"");
}

function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    {
    c_start=c_start + c_name.length+1;
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    }
  }
return false;
}