var dbug = 0;
function isArray(obj) {
	obj = (obj.constructor.toString().indexOf('Array') == -1)?false:true;
	document.writeln(obj.constructor.toString().indexOf('Array'));
	return obj;
}

function isNull(x) {//Checks to see if a variable has a null or NaN value.... Returns true if null	
	if(x == null || NaN) {return true;}
	else {return false;}
}

function err(desc) {

/*	if(dbug == 0) {	alert('Error: ' + desc);	dbug = 1;	}
	else {		alert ('reset');		dbug = 0;	}*/	
	alert('Error: ' + desc);
}

function use_js(name) {//Needs to be run first thing... before anything else loads... we will get this... don't you worry
	path = 'script/';
	var dhead = document.getElementsByTagName('head')[0];
	var inc = document.createElement('script');
	var src = path + name;	inc.setAttribute('src',src);
	dhead.appendChild(inc);
}

function use_css(name) {
	path = 'style/';
	var dhead = document.getElementsByTagName('head')[0];
	var inc = document.createElement('link');
	var href = path + name;	inc.setAttribute('href',href);
	inc.setAttribute('rel','stylesheet');
	inc.setAttribute('type','text/css');
	dhead.appendChild(inc);
}
function backUp(opt) {//pretty self explanatory	
	if(opt) {
		var c = confirm(opt);
		if(!c) return false;
	}
	history.go(-1);
}

function rand(x) {//outputs a random integer between 0 and x
	var i = Math.floor(Math.random()*x);
	return i;
}









