$(window).load(function(){
	cS = 1;
	tS = $("#content").children(".showcase").length;
	oId = 1;
	cP = 0;
	tP = $("#merkMiddle").children("ul").length - 1;
	
	$("#merkMiddle a").each(
		function(){
			if($(this).attr('class') == "active"){
				var aId = $(this).attr('id');
				aId = aId.substring(4,5);
				nP = Math.floor(aId/8);
				if(nP != cP){
				   switchList();
				}
			}
		}
	);
	if(window.location.hash){		
		nP = parseInt(window.location.hash.substring(1,5));		
		switchList();
	}
	$("form :input[type=text]").each(function(){$(this).placeholder();});
	$('input').ezMark();
});

function prevCase(){
	if(cS != 1){
		nS = cS-1;	
	}else{
		nS = tS;
	}
	switchCase();
}
function nextCase(){
	if(cS != tS){
		nS = cS+1;	
	}else{
		nS = 1;
	}
	switchCase();
}
function switchCase(){
	$("#case" + cS).hide();
	$("#case" + nS).show();
	cS = nS;
}

function prevList(){
	if(cP != 0){
		nP = cP-1;	
	}else{
		nP = tP;
	}
	switchList();
}
function nextList(){
	if(cP != tP){
		nP = cP+1;	
	}else{
		nP = 0;
	}
	switchList();
}
function switchList(){
	$("#part" + cP).hide();
	$("#part" + nP).show();
	cP = nP;
	window.location.hash = cP;
}
