/* magic.js
 * Author: Ryan Plauche
 * Reason: Client wanted framework-generated text gone
 */
 $(document).ready( function() {
	/*Find what page we're on*/
		var path = window.location.pathname.split("/");
		var currentPage = path[path.length-1];
	/* Switch/Case used to minimize js run*/
	switch(currentPage) {
		case 'register':
			/*Change Title Text*/
				$('table tbody tr td font.DialogHeaderTitleFont').text('Register for an Account - Current Mt. View Members Only');
			/*Remove Example Text*/
				$('.DialogBodyFootNoteFont').each( function() { $(this).parent().parent().empty(); });
			/*Remove 'slap ugly' bar from the bottom*/
				$('td[colspan=8] table img').each(function() { $(this).parent().parent().parent().parent().empty(); } );
			break;
		case 'onlinegiving':
			/*Remove Example Text*/
				$('.DialogBodyFootNoteFont').each( function() { $(this).parent().parent().empty(); });
			/*Remove 'slap ugly' bar from the bottom*/
				$('td[colspan=8] table img').each(function() { $(this).parent().parent().parent().parent().empty(); } );
			break;
		default: break;
	}
	/*For other pages*/
	$('#NavigationCustom ul li').hover(
		function() { $('ul', this).css('display', 'block'); },
		function() { $('ul', this).css('display', 'none'); }
	);
	$('.content td[bgColor=white]').removeAttr('bgColor');
	$('.content td[bgColor=#ffffff]').removeAttr('bgColor');
	$('.content td[style]').css('background','none');
	/*For Media Page*/
	if( $("#xamlHost0").length > 0 ) {
		$("#notLive").css("display","none");
	}
});

function bibleSearch() {
	var searchTerm = $('#bibleSearchInput').val();
	//window.location = "http://www.biblegateway.com/quicksearch/?quicksearch="+searchTerm+"&qs_version=31";
	window.open("http://www.biblegateway.com/quicksearch/?quicksearch="+searchTerm+"&qs_version=31");
	//window.target = "_blank";
}