
/**************************************************
* Name: hijax_generic.js
* Author: PJ
* Modified: 20071206
* Overview: Generic Hijax functionality
* Copyright:
* Notes: Hijax, taking back the web with each script
**************************************************/

// Whether Hijax can operate in this client
var sanityCheck = false;

// Add the sanity test as the first Hijax call
winAddLoadEvent (testSanity);

// Adds window load events safely
function winAddLoadEvent (func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function () {
			oldonload ();
			func ();
		}
	}
}

// Checks the DOM for basic functionality
function testSanity () {
	if (document.getElementById) {
		sanityCheck = true;
	} else {
		sanityCheck = false;
	}
}
