$(document).ready(function(){
	
	// Begin DIV Pager init
	var pLinks = 'pLinks';
	var pText = 'pText';
	// Hide all the cText divs except the first one
	$("div."+pText+":gt(0)").css({display:"none"});
	// Add an onclick event to each anchor with class cLinks that will swap
	// currently visible cText div with clicked anchor.
	// N.B. You need to have the same number of cLinks as cTexts & order is important
	$("a."+pLinks).each(function(i){
		$(this).click(function(){
			swap(pText, i);
		});
	});
	// End DIV Pager init
	
 });
// 

function swap(myTxt, myId){

	//alert( myId );
	$("div."+myTxt+":visible").fadeOut("medium", function(){
		$("div."+myTxt+":eq(" + myId + ")").fadeIn("medium");
		rotImage();
	});
}
function nextprev(myClass, dir){

	var activeIndex = $('div.' + myClass ).index($('div.' + myClass + ':visible')[0]);
	var topBound = $("div."+myClass).length - 1;
	if(dir.substring(0,1) == 'p'){
		activeIndex = activeIndex - 1;
		if(activeIndex < 0){activeIndex = topBound}
	
	}else if(dir.substring(0,1) == 'n'){
		activeIndex = activeIndex + 1;
		if(activeIndex > topBound){activeIndex = 0}
	}
    swap(myClass, activeIndex);
	
}