$(document).ready(document_Ready);
var initCredits = 0;
var creditTimer = {};

function document_Ready(){
	assignBHEventListeners();
	
	var showCredits = $('#showCredits');
	var FooterRight_Links = $('#FooterRight_Links');
	var CreditLinkDiv = $('#CreditLinkDiv');
	
	showCredits.bind("mouseover", function(){
		FooterRight_Links.fadeOut(500, function(){
			CreditLinkDiv.animate( { right:"0" }, 500, "linear", function(){
				FooterRight_Links.delay(5000,function(){
					CreditLinkDiv.animate( {right: -330}, 500, "linear", function(){
						FooterRight_Links.fadeIn(500);
					});
				});
			});;
		});	
	});
	
}


function assignBHEventListeners(){
	$("*[SideBarSearch='true']").click(SideBarSearch_Click);
	$(":text[HasInputMask]").bind("focus", HasInputMask_Focus);
}



function SideBarSearch_Click(){
	var sKeywords = $("#SideBar_Keywords");
	var mask = "keywords";
	if(sKeywords.attr("HasInputMask") != null){
		mask = sKeywords.attr("HasInputMask");
	}
	if(sKeywords.val() == mask){
		sKeywords.val("");
	}
}


function HasInputMask_Focus(){
	var sender = $(this);
	if(sender.val() == sender.attr("HasInputMask")){
		sender.val("");
	}
}