function prevent(event) {
	event.preventDefault();
}

// When the DOM (document object model / document) is ready, start
// using JavaScript.
$(function() {
	var dev = false,
		loca = String(document.location.href) || String(window.location),
		quoteContainer = $("quotes");
		
	// Store some data
	$.fn.globalData = {
		"lastModified": document.lastModified
	};

		
	// Hide anything we don't want a user to see (yet!)
	//$(".sub").hide();
	
	// Show a popup message if the users browser is not officialy
	// supported or needs updating.
	$.reject({
		reject: {
			safari: false, // Apple Safari
			chrome: false, // Google Chrome
			firefox: false, // Mozilla Firefox
			msie5: true, msie6: true, msie7: true, msie8: false, // Microsoft Internet Explorer 5-7
			opera: false, // Opera
			konqueror: false, // Konqueror (Linux)
			unknown: false, // Everything else
			all: false		
		},
		
		display: ['firefox','chrome','opera','msie'], // Displays only firefox, chrome, and opera
		paragraph2: 'Please rest assured that by updating, all your preferences, cookies, saved passwords, and other data should be preserved. Updating to a more modern browser helps web developers and makes your web experience safer, faster, and more enjoyable.<br /><br /> Please note, by downloading a new browser (not updating an exisiting installed one), some data may not be transferred. Please click on an icon below if you want to either install a new browser or update an existing one:',	
		imagePath: "images/icons/",
		closeCookie: false // Set cookie to remmember close for this session
	});

	// Listen for a click on the body container. This minizmizes the amount
	// of event listeners if we want a lot of things to be clickable! -- makes
	// things faster, hopefully...
	$("body").bind("click", function(event) {
		if(event.target) {
			var target = event.target,
				identity = event.target.id || event.target.className;
			
			switch(identity) {
				case "banner":
					window.location = "index.php";
					break;
					
				case "popup":
					//event.preventDefault();
					$.modal($("#" + $(target).attr("name")).html(), {
						modal: true,
						overlayCss: {
							"background-color": "#000000"
						}
					});
					break;
					
				default:
					log("Target:" + target + "\nIdentity:" + identity);
					return undefined;
					break;
			}
		}
	});
	
	// Get document location and specific page. Highlight a navigational
	// button that is relevant to the page being viewed.
	var checkPage = function() {
		var pathname = window.location.pathname.split("/"),
			filename = pathname[pathname.length-1].split(".")[0];
		
		// Get document location and specific page.
		if(filename && filename != "index") {
			activate(filename);
		} else {
			activate("home");
		}
			
		// Activate a button
		function activate(bName) {
			$(".button[name=" + bName + "]").addClass('activated');
		}
		
	}();
	
	
	// If dev mode is true, then try to log what needs to be logged
	function log(m, a) {
		if(dev === true) {
			if(!a) {
				try {
					console.log(m);
				} catch (event) {
					try {
						throw new Error(m);
					} catch (event) {
						alert(m);
					}
				}
			} else {
				alert(m);
			}
		}
	}
	
	
     $("#quotes").mbScrollable({
        width:200,
        elementsInPage:1,
        elementMargin:1,
        height:"auto",
        slideTimer:600,
        autoscroll:true,
        scrollTimer:4000,
		shadow: false
      });
	
});
