

function load() {
	var imgs = load.arguments;
	if (document.images) {
		if (document.preload == null) document.preload = new Array();
		var i = document.preload.length;
		for (var j = 0; j < imgs.length; j++) {
			document.preload[i] = new Image();
			document.preload[i++].src = imgs[j];
		}
	}
}

function restore(){ 
	var i, x, a = document.swaps; 
	if( a ) for( i = 0; i < a.length; i++)
		if( a[i].oldSrc ) a[i].src=a[i].oldSrc;
}

function swap(){ 
	var i, j = 0, a = swap.arguments; 
	document.swaps = new Array; 
	for( i = 0; i < ( a.length - 1 ); i += 2 ){
		document.swaps[j++] = a[i];
		if( !a[i].oldSrc ) a[i].oldSrc = a[i].src;
		a[i].src = a[i + 1];
	}
}

function openW(url, name, w, h) {
	var windowprops = "width=" + w + ",height=" + h;
	popup = window.open(url, name, windowprops);
	setTimeout('popup.focus();',250);
}

function utils_GetHTTPContent(in_RelativeURL) {
  var getURL = "http://www.accessnewjersey.net" + in_RelativeURL;
  var xmlHttp = new ActiveXObject("Microsoft.XMLHTTP")
  xmlHttp.open("GET", getURL, false)
  xmlHttp.send()
  retStr=xmlHttp.responseText
  return(retStr);
}

function ValidateUser(user, pass, accountnum) {
  if (user.length <= 0) { alert("Please enter a valid Username."); return(false); }
  if (pass.length <= 0) { alert("Please enter a valid Password."); return(false); }
  if (accountnum.length <= 0) { alert("Please enter a valid Account/Video Number."); return(false); }
  return(true);
}

function ValidateUser2(user, pass, accountnum) {
  if (user.length <= 0) { alert("Please enter a valid Username."); return(false); }
  if (pass.length <= 0) { alert("Please enter a valid Password."); return(false); }
  if (accountnum.length <= 0) { alert("Please enter a valid Account/Video Number."); return(false); }

  var getURL = "/includes/ValidateUser.asp?id="+accountnum+"&email="+user;
  var content = utils_GetHTTPContentMozilla(getURL);

  if (content == "Authorized") return(true);
  alert("Invalid username, password and/or account/video number.  Please try again.");
  return(false);
}