
$(function() {  
	// newsticker-animation
	$("#news").jCarouselLite({  
	        vertical: true,  
	        visible: 2,  
	        auto:2000,  
	        speed:2000,
	        hoverPause: true
	    }); 
	// check Browser and init animations
	var isOldIE=false;
	if(($.browser.msie)){
		var ieVersion = parseInt($.browser.version);
		if(ieVersion < 8)isOldIE = true;
	}
	if(!isOldIE){
		if ($("body").attr("id")=="index"){
			animateIndexBubbleVertical();
			window.setInterval("animateIndexBubbleVertical();", 6000);
			animateIndexBubbleHorizontal();
			window.setInterval("animateIndexBubbleHorizontal();", 8000);
		}
		
		else if ($("body").attr("id")=="ref"){
			animateBubble();
			window.setInterval("animateBubble();", 8000);
		}
	}
	
});

function animateIndexBubbleVertical(){
	$('#bg_wrapper').animate({
	    backgroundPosition: "50% -20px"
	  }, 3000, function() {
			$('#bg_wrapper').animate({
				backgroundPosition: "50% 25px"
			  }, 3000, function() {
			  });
	  });
		

}
function animateIndexBubbleHorizontal(){
	$('#content_container').animate({
	    backgroundPosition: "400px 30px"
	  }, 4000, function() {
			$('#content_container').animate({
				backgroundPosition: "480px 30px"
			  }, 4000, function() {
			  });
	  });
}
function animateBubble(){
  $('#content_container').animate({
	  	backgroundPosition: "320px 110px"
	  }, 4000, function() {
		  $('#content_container').animate({
			   backgroundPosition: "320px 150px"
			  }, 4000, function() {
			    // Animation complete.
			  });
	 });
}
function animateBubbles(){
	$('#consulting_left').animate({
		backgroundPosition: "10px 0"
	  }, 2000, function() {
			$('#consulting_left').animate({
				backgroundPosition: "0px 0"
			  }, 2000, function() {
			  });
	  });
 
  $('#consulting_right').animate({
	  backgroundPosition: "0px 0"
	  }, 2000, function() {
		  $('#consulting_right').animate({
			   backgroundPosition: "10px 0"
			  }, 2000, function() {
			    // Animation complete.
			  });
	 });
}
function animateProductBg(){
	$('#content').animate({
	    backgroundColor: "#afc4e5"
	  }, 1000, function() {
			$('#content').animate({
				backgroundColor: "#84aede"
			  }, 1000, function() {
			  });
	  });
}

