function rotatepics() {
	current_pid += 1;
	if(current_pid > pid) {
		current_pid = 0;
	}
	splashpic.attr("src", p[current_pid]);
}
var current_pid = 0; var pid = 0; var p = new Array(); var splashpic = null;

// JavaScript Document
$(document).ready(function() {
	if($("#oldbrowserbar, #ie6orless").length > 0) {
		$(document).pngFix();
	}

	var submenus = $("li.page_item").not(".current_page_ancestor, .current_page_item").find("ul");
	submenus.each(function() {
		var t = $(this);
		t.parent().hover(function() {
			t.slideDown("slow");
		});
		/*
		t.parent().hover(function() {
			t.slideDown("slow");
		}, function() {
			t.slideUp("slow")
		});
		*/
	});
	$("#menu-middle").mouseleave(function() {
		submenus.slideUp("slow");
	});
	$("li.current_page_ancestor ul, li.current_page_item ul").show();
	$("#applyform").find("div.wpcf7").each(function() {
		var t = $(this);
		var extra = t.find(".extrainfo");
		var extrashow = t.find(".showextrainfo");
		extra.hide();
		t.find("input[name=email]").focus(function() {
			extra.slideDown("slow");
			extrashow.slideUp('fast');
		});
		extrashow.click(function() {
			extra.slideDown("slow");
			extrashow.slideUp("fast");
		});
	});
	if($(".faq_question").length > 0) {
		/*
		$(".faq_answer").not(".faq_answer:first").hide();
		$(".faq_question").click(function() {
			var n = $(this).next(".faq_answer");
			if(n.is(":visible")) {
				n.slideUp(1000);
			} else {
				n.slideDown(1000);
			}
		});
		*/
	}
	if($("#post-3").length > 0) {
		pid = 0; p[pid] = "http://probusinesscapital.devcsd.com/w/wp-content/themes/PBC/splash_home/14.jpg";
		pid += 1; p[pid] = "http://probusinesscapital.devcsd.com/w/wp-content/themes/PBC/splash_home/16.jpg";
		pid += 1; p[pid] = "http://probusinesscapital.devcsd.com/w/wp-content/themes/PBC/splash_home/17.jpg";
		pid += 1; p[pid] = "http://probusinesscapital.devcsd.com/w/wp-content/themes/PBC/splash_home/19.jpg";
		pid += 1; p[pid] = "http://probusinesscapital.devcsd.com/w/wp-content/themes/PBC/splash_home/24.jpg";
		pid += 1; p[pid] = "http://probusinesscapital.devcsd.com/w/wp-content/themes/PBC/splash_home/3.jpg";
		pid += 1; p[pid] = "http://probusinesscapital.devcsd.com/w/wp-content/themes/PBC/splash_home/22.jpg";

		splashpic = $("#page-header img:first");
		var homerotator = setInterval('rotatepics()', 8000);
		$("#slogan").show();
	}
});