//- Instinct -//

var g_nMouseX = 0;
var g_nMouseY = 0;

function Instinct() {
//- Model - Initialize -//
	this.onLoad_Hash = new Array();
	this.onResize_Hash = new Array();
	this.LoadComplete = false;

//- Model - Link -//
	this.registerOnLoad = registerOnLoad;
	this.onLoad = onLoad;
	this.onLoadComplete = onLoadComplete;
	this.registerOnResize = registerOnResize;
	this.onResize = onResize;

//- Model - Mouse -//
	this.Mouse_onLoad = Mouse_onLoad;
	this.getMouseXY = getMouseXY;

//- Model - Implementation -//
	function registerOnLoad(fLoad) {
		this.onLoad_Hash[this.onLoad_Hash.length] = fLoad;
	} 
	function onLoad() {
		this.LoadComplete = false;
		this.Detect.onLoad();
		for (var hLoad in this.onLoad_Hash) {
			this.onLoad_Hash[hLoad]();
		}
	}
	function onLoadComplete() {
		this.LoadComplete = true;
		this.Mouse_onLoad();
	}

	function registerOnResize(fResize) {
		this.onResize_Hash[this.onResize_Hash.length] = fResize;
	} 
	function onResize() {
		for (var hResize in this.onResize_Hash) {
			this.onResize_Hash[hResize]();
		}
	}

	function Mouse_onLoad(){
		switch (oInstinct.Detect.Engine) {
			case "W3":
			case "IE":
				break;

			case "??":
			case "NS":
			default:
				document.captureEvents(Event.MOUSEMOVE);
				break;
		}
		document.onmousemove = getMouseXY;
	} // end function getMouseX

	function getMouseXY(e) {
		var tempX;
		var tempY;
		var IE = document.all?true:false;
		if(IE){
			Instinct_Mouse_W3();
		}else{
			Instinct_Mouse_NS(e);
		}
	  if (g_nMouseX < 0){g_nMouseX = 0;}
	  if (g_nMouseY < 0){g_nMouseY = 0;}
	  return true
	}// end function getMouseXY
}

//- static -//
var oInstinct = new Instinct();
var g_bIsLoadComplete = false;