/*=============================================================================

			 	 TITLE:		NetMediaOne - Core Library
		  MODIFIED:		2008.06.27
		 AUTHOR(S): 	Graham Wheeler - NetMediaOne - www.netmediaone.com
		  REQUIRES:		jQuery 1.2

=============================================================================*/

var NMO = {
	
	version: "1.2.0",
	rootPath: "",
	resizeTimer: null,
	documentMouseX: 0,
	documentMouseY: 0,
	windowMouseX: 0,
	windowMouseY: 0,
 
	stripeTable: function(selector) {
		jQuery(selector + " tr:visible:even").addClass("Even");
		jQuery(selector + " tr:visible:odd").removeClass("Odd");
	},	
	
	showStatusMessages: function() {
	
		$(".StatusMessage").show().fadeIn( "slow", function() {
			setTimeout( function() { $(".StatusMessage:not(.Sticky)").fadeOut("slow"); }, 4000 );
		} );
	
	},

	init: function() {

		jQuery("body").addClass("HasJS");

		jQuery("body *:first-child").not("a, em, strong, span, thead, tbody, tr").addClass("FirstChild");
		jQuery("body *:last-child").not("a, em, strong, span, thead, tbody, tr").addClass("LastChild");

		NMO.stripeTable(".Striped tbody");
		
		jQuery(document).mousemove( function(e) {
			NMO.documentMouseX = e.pageX;
			NMO.documentMouseY = e.pageY;
			NMO.windowMouseX = e.clientX;
			NMO.windowMouseY = e.clientY;
		} );
		
		$(document).pngFix();
		
		NMO.showStatusMessages();
		
	}
	
};


// Simple StringBuffer Class
function StringBuffer(str) {
	this.buffer = [];
	this.buffer.push(str);
	return this;
};
StringBuffer.prototype = {

	append: function(str) {
		this.buffer.push(str);
		return this;
	},
	
	clear: function() {
		this.buffer = [];
		return this;
	},
	
	toString: function() {
		return this.buffer.join("");
	}

};

jQuery( function() { NMO.init(); } );

