$(document).ready(function() {
	
	//Zurücksetzen für die Page und Split funktion
	$("#pageNo1").addClass("page_active").removeClass("page_not_active");
	$("#switch_holder .not_active, .page_not_active, #screenvideo").hide();
	
	
	
	//Dots (Normal)
	$("#dots a").each( function() {
		var dotLink 	= $(this).attr("rel");
		$(this).removeAttr("href").css({cursor: "pointer"});
	
		$(this).click(function(){
			var ifactive 	= $(this).attr("class");
			if(ifactive == "active") { /*NOTHING*/ } else {
				$("#dots a").removeClass("active");
				$("#switch_holder div.active").hide("", showMyNewSwitch(dotLink));
				$(this).addClass("active");
			}
		});
	});

	//PAGErDots (Für Seiten in Seiten)
	$("#pager_dots a").each( function() {
		var dotPLink = $(this).attr("rel");
		$(this).removeAttr("href").css({cursor: "pointer"});
	
		$(this).click(function(){
			var ifactive 	= $(this).attr("class");
			if(ifactive == "p_active") { /*NOTHING*/ } else {
				$("#pager_dots a").removeClass("p_active");
				$(".pages.page_active").fadeOut('normal',showMyNewPage(dotPLink));
				$(this).addClass("p_active");
			}
		});
	});	
	
//END DOCUMENT	
});

//FUNCTIONS
//switch page
function showMyNewSwitch(dotLink) {
	$("#switch_holder .active").removeClass("active").addClass("not_active");
	$("#"+dotLink).fadeIn("normal").addClass("active");
}

//page loader
function showMyNewPage(dotPLink) {
	$(".pages.page_active").removeClass("page_active").addClass("page_not_active");
	$("#"+dotPLink).fadeIn("normal").addClass("page_active");
}	
