//TopDropNav
function topDropDownMenu( this_id )
{
        if (!$(".topnav a."+this_id).is(".selected")) {
                $(".topnav a").removeClass("selected");
                //$("div.dropDownMenu").hide();
                $("div.topDropDownMenu").slideUp("slow");
               	$("div#nav_dropdown_"+this_id).slideDown("slow");
                $(".topnav ."+this_id).addClass("selected");
        } else {
                closeTopMenu();
        }
}

function closeTopMenu()
{
        $("div.topDropDownMenu").slideUp("slow");
        $(".topnav a").removeClass("selected");
}


//DropDown Nav
function dropDownMenu( this_id )
{
        
        if (!$("#navigation a."+this_id).is(".selected")) {
                $("#navigation a").removeClass("selected");
                //$("div.dropDownMenu").hide();
                $("div.dropDownMenu").slideUp(1050);
               	$("div#nav_dropdown_"+this_id).slideDown(350);
                $("#navigation ."+this_id).addClass("selected");
        } else {
                closeMenu();
        }
}

/*function keepMenuOpen()		
		if ( "body#" == "location"||"history"||"belief"||"staff-family"||"jobs"||"visiting"||"become-a-christian") {
	$("div#nav_dropdown_aboutDrop").show();
	$("#navigation a.aboutDrop").addClass("selected");
} else {
	echo "The if statement evaluated to false";
}*/

function closeMenu()
{
        $("div.dropDownMenu").slideUp(300);
        $("#navigation a").removeClass("selected");
}

//if page name is equal to this... then div is .selected.



//Text Sizer
$(document).ready(function(){
	$i = 0;
	$j = 0;
  // Reset Font Size
  var originalFontSize = $('html').css('font-size');
  $(".textReturn").click(function(){
  $('html').css('font-size', originalFontSize);
  $i = 0;
  $j = 0;
  });
  // Increase Font Size
    $(".textLarger").click(function(){
    if ($i < 2){
  	var currentFontSize = $('html').css('font-size');
 	var currentFontSizeNum = parseFloat(currentFontSize, 10);
    var newFontSize = currentFontSizeNum*1.2;
	$('html').css('font-size', newFontSize);
	$i++;
	$j--;
	return false;
	}
	else {}
  });
  
  // Decrease Font Size
  $(".textSmaller").click(function(){
  	if ($j < 2){
  	var currentFontSize = $('html').css('font-size');
 	var currentFontSizeNum = parseFloat(currentFontSize, 10);
    var newFontSize = currentFontSizeNum*0.8;
	$('html').css('font-size', newFontSize);
	$i--;
	$j++;
	return false;
	}
  	else {}
  });
  
  // Animate Footer
  $("#moving-links a").hover(function(){
		$(this).stop().animate({paddingLeft: "20px"}, 300);
	}, function(){
		$(this).stop().animate({paddingLeft: "0px"}, 300);
	});
});



/*
//Original Text Sizer.
$(document).ready(function(){
	var i = 0;
  // Reset Font Size
  var originalFontSize = $('html').css('font-size');
  $(".textReturn").click(function(){
  $('html').css('font-size', originalFontSize);
  });
  // Increase Font Size
    $(".textLarger").click(function(){
  	var currentFontSize = $('html').css('font-size');
 	var currentFontSizeNum = parseFloat(currentFontSize, 10);
    var newFontSize = currentFontSizeNum*1.2;
	$('html').css('font-size', newFontSize);
	return false;
  });
  // Decrease Font Size
  $(".textSmaller").click(function(){
  	var currentFontSize = $('html').css('font-size');
 	var currentFontSizeNum = parseFloat(currentFontSize, 10);
    var newFontSize = currentFontSizeNum*0.8;
	$('html').css('font-size', newFontSize);
	return false;
  });
});*/