
/*
	AM Surface
	Indexsite JS
	Raphael Durrer
*/


$(document).ready(function(){

/* 	$(document).pngfix(); */

	//Content Rotator Home
	$('#bannerblock').after('<div id="pagernav">').cycle({ 
    	speed: 'slow', 
    	timeout: 5000, 
    	pager: '#pagernav',
    	cleartype: true,
		cleartypeNoBg: true    	
	});

});



/*
$(document).ready(function(){
	
	//Last Child selector
	$('.imgItem:last-child').addClass("last");
	
	$(".banner-main-detail").delay(300).fadeIn("slow");
	
	//Content slider Function	
	var imageWidth = $(".bannerblock").width();
	var imageSum = $(".banner_reel .bannerbox").size();
	var imageReelWidth = imageWidth * imageSum;
	$(".pagination").show();
		var i=1;
		for (i=1;i<=imageSum;i++)
		{
			$(".pagination").append("<a href='#' rel='"+ i +"'></a>")
		}
	$(".pagination a:first").addClass("active");
	var pagingwidth = $(".pagination").width();
	$(".pagination").css({'margin-left': -pagingwidth /2 });
	
	$(".banner_reel").css({'width' : imageReelWidth});
	rotate = function(){	
		var triggerID = $active.attr("rel") - 1;
		var image_reelPosition = triggerID * imageWidth; 
		//alert(triggerID);
		$(".pagination a").removeClass('active'); 
		$active.addClass('active');
		$(".banner-main-detail").fadeOut("normal");
		$(".banner_reel").animate({ 
			left: -image_reelPosition
		}, 500 ).queue(function () {
				$(this).find(".banner-main-detail").fadeIn("slow");
				$(this).dequeue();
			});
	}; 
	
	
	rotateSwitch = function(){		
		play = setInterval(function(){ 
			//alert("test");
			$active = $('.pagination a.active').next();
			if ( $active.length === 0) { 
				$active = $('.pagination a:first');
                                // clearInterval(play); 
			};
			$(".banner-main-detail").hide();
			rotate();
			
 		}, 10000);
	};
	
	rotateSwitch(); 
	
	//On Hover
	$(".banner_reel .bannerbox").hover(function() {
		clearInterval(play); 
	}, function() {
		rotateSwitch(); 
	});	
	
	//On Click
	$(".pagination a").click(function() {	
		$active = $(this); 
		//Reset Timer
		clearInterval(play); 
		$(".banner-main-detail").hide();
		rotate(); 
		rotateSwitch();
		return false; 
	});

	
});
*/



