
var target = "";
var onceThrough = false;

function switchSection(section) {
	onceThrough = false;
	pfLog("section: " + section);
	$("#navbar li").removeClass("active");

	target = "sectionnav_"+section;
	$("#"+target).addClass("active");
	//$("#footerDiv").clearQueue();
	$("#footerDiv").fadeOut("fast");
	target = "section_"+section;
	$("div[id^=section_]").fadeOut(100, myFadeIn);
	//pfLog("fadeout target: " + target);
	//$("#"+target).fadeOut();
	//myFadeIn();
	//$("#"+target).css('display','block');
	//$("#"+target).show("slow");
	//$("#"+target).delay(500).fadeIn();
	//$("#footerDiv").delay(500).fadeIn("slow");
	//$("#"+target).fadeIn();
	//$("#footerDiv").fadeIn("slow");
	pfLog("section out");
}

function myFadeIn(){
	//if(onceThrough == false){
		onceThrough = true;
		pfLog(">>>>target: " + target)
		$("#"+target).fadeIn();
		$("#footerDiv").fadeIn("slow");
	//}
}

function pfLog(msg){
   if (navigator.userAgent.indexOf('AppleWebKit/') > -1)
      window.console.log(msg);
}

