 /* 
	aa2007.js
  (c)2007-2008 Anglers Atlas
  no stealing. stealer.
*/
 
$(document).ready(function() {
	$("#banner img").fadeIn(10000,function(){
  	$("#banner img").animate({opacity: 1.0}, 8000);
  });
 	
	$("#drawmode").change(function () {
  	var str = "";
    $("#drawmode option:selected").each(function () {
    	str = $(this).val();
    	if ((str == 'trail') || (str == 'troll') || (str == 'access')) {$("#delLP").slideDown("slow");}
    	else if ((str == 'hotspot') || (str == 'boatlaunch') || (str == 'warning')) {$("#delLP").slideUp("slow");}
    });
  });
	
	$("#memberMessage").click(function () {
		$(this).fadeOut(3000, function () {
			$(this).remove();
		});
	});
});

function toUpper(str) {
	var pattern = /(\w)(\w*)/; // a letter, and then one, none or more letters 
  var a = str.split(/\s+/g); // split the sentence into an array of words

  for (i = 0 ; i < a.length ; i ++ ) {
  	var parts = a[i].match(pattern); // just a temp variable to store the fragments in.
    var firstLetter = parts[1].toUpperCase();
    var restOfWord = parts[2].toLowerCase();
    a[i] = firstLetter + restOfWord; // re-assign it back to the array and move on
  }  
  str = a.join(' '); // join it back together
  return str;
}