// JavaScript Document

$(document).ready(	function(){	
	bplSearchTab(0)
	bplSearchTabClick()
	menuAnim()
	menuCtr()	
	navigation()
	}
)

function bplSearchTab(tbNm)
	{
		
var tabArrayURL=["searchByLocation.asp","searchByName.asp","searchByFamMember.asp","searchById.asp","searchByQuery.asp"]
var tabArrayHeight=[130,130,130,130,400]		
		$("#ifrm").attr({src:tabArrayURL[tbNm]})	
		$("#ifrm").animate({height:tabArrayHeight[tbNm]},"fast")
	}
function removeTabClass(){
	
	}
function bplSearchTabClick(){

	$(".sTab li:eq(0) a").click(function(event){
			event.preventDefault()				   
			$(".sTab li").removeClass()
			$(".sTab li:eq(0)").addClass("active")
			
			bplSearchTab(0)
			
			})
	
	$(".sTab li:eq(1) a").click(function(event){
			event.preventDefault()	
			$(".sTab li").removeClass()
			$(".sTab li:eq(1)").addClass("active")
			bplSearchTab(1)
			
			})
	
	$(".sTab li:eq(2) a").click(function(event){
			event.preventDefault()						   
			$(".sTab li").removeClass()
			$(".sTab li:eq(2)").addClass("active")
			
			bplSearchTab(2)
			
			})
	
	$(".sTab li:eq(3) a").click(function(event){
			event.preventDefault()							 
			$(".sTab li").removeClass()
			$(".sTab li:eq(3)").addClass("active")
			
			bplSearchTab(3)
			
			})
	
	$(".sTab li:eq(4) a").click(function(event){
			event.preventDefault()							 
			$(".sTab li").removeClass()
			$(".sTab li:eq(4)").addClass("active")
			
			bplSearchTab(4)
			
			})
	}
	
function menuAnim(){
	
	$("#extDiv a").mouseover(function(){							
							$(this).stop().animate({color:"#ca332d"},400)
										})
	
	$("#extDiv a").mouseout(function(){							
							$(this).stop().animate({color:"#1f1f1f"},400)
										})
	
	$("#menu ul li a").mouseover(function(){
							$(this).stop().animate({backgroundColor:"#2071a5",color:"#ffffff"},400)
							
										})
	$("#menu ul li a").mouseout(function(){
							$(this).stop().animate({backgroundColor:"#b7d4e6",color:"#1f1f1f"},400)
										})
	
	}
function viewTable()
	{
		$(".viewTable tr:odd").css({backgroundColor:"#ffffff"})	
		$(".viewTable tr:even").css({backgroundColor:"#f4f4f4"})	
		
		$(".viewTable tr").mouseover(function(){							
							$(this).stop().animate({backgroundColor:"#fbef6f"},700)
										})
		
		$(".viewTable tr:even").mouseout(function(){							
							$(this).stop().animate({backgroundColor:"#f4f4f4"},700)
										})
		$(".viewTable tr:odd").mouseout(function(){							
							$(this).stop().animate({backgroundColor:"#ffffff"},700)
										})
		
	}

function menuCtr()
	{
		if(hideMenu==true){
			//alert("hy")
			$("#menu").slideToggle("slow");
			 $("#mnCtr a.exMenu").text("Expand Menu")
			}
		
		$("#mnCtr a.exMenu").click(function(event){	
									 event.preventDefault()	
									 $("#menu").slideToggle("slow");
									 if($("#mnCtr a.exMenu").text()=="Expand Menu")
									 $("#mnCtr a.exMenu").text("Collapse Menu")
									 else
									  $("#mnCtr a.exMenu").text("Expand Menu")
									 }
							)
		
		$("#mnCtr a.bplSearch").click(function(event){												  
									 event.preventDefault()	
									 $("#BPLSearch").slideToggle("slow");
									
									 if($("#mnCtr a.bplSearch").text()=="BPL Search"){
									 $("#mnCtr a.bplSearch").text("Close BPL Search Panel")
									 $("#mnCtr #bplSearchImg").attr("src","images/close.gif")
									 }
									 else{									
									  $("#mnCtr a.bplSearch").text("BPL Search")
									  $("#mnCtr #bplSearchImg").attr("src","images/Search.gif")
									 }
									 }
							)
		
		
	}
function navigation(){	
	if(navLink!=null){
		$("#nav").html("<a href='index.html'>Home</a> / "+navLink)
		}
	}

function pubAni(){
	
	if($("#pubBg div")){
		$("#pubBg div").fadeOut("slow")
		$("#pubBg div").hide()
		}
	$("#pubBg div:eq("+showCount+")").fadeIn("slow")
	showCount++	
	if(showCount>2)
	showCount=0
	}
	
function homePubScroll(){
showCount=0
setInterval('pubAni();',5000); 
}