function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		jmilito_17_over = newImage('images/jmilito_17-over.jpg');
		jmilito_20_over = newImage('images/jmilito_20-over.jpg');
		jmilito_21_over = newImage('images/jmilito_21-over.jpg');
		jmilito_22_over = newImage('images/jmilito_22-over.jpg');
		jmilito_23_over = newImage('images/jmilito_23-over.jpg');
		jmilito_24_over = newImage('images/jmilito_24-over.jpg');
		jmilito_25_over = newImage('images/jmilito_25-over.jpg');
		jmilito_26_over = newImage('images/jmilito_26-over.jpg');
		jmilito_27_over = newImage('images/jmilito_27-over.jpg');
		jmilito_29_over = newImage('images/jmilito_29-over.jpg');
		jmilitoHome_04_over = newImage('images/jmilitoHome_04-over.jpg');
		jmilitoHome_06_over = newImage('images/jmilitoHome_06-over.jpg');
		jmilitoHome_07_over = newImage('images/jmilitoHome_07-over.jpg');
		preloadFlag = true;
	}
}
function aj(DIV,URL,qryString){
	$.ajax({
		type: "GET",
		url: URL,
		data: qryString,
		success: function(message) {
			if (message.length > 0) { $("#"+ DIV).html(message); }
		},
		error: function (xhr, ajaxOptions, thrownError){
			alert(xhr.status+': '+xhr.statusText+'\n'+URL);
		}
	});
}
function aj_post(f,DIV,URL){
	var qryString = $(f).serialize();
	$.ajax({
		type: "POST",
		url: URL,
		data: qryString,
		success: function(message) {
			if (message.length > 0) { $("#"+ DIV).html(message); }
		},
		error: function (xhr, ajaxOptions, thrownError){
			alert(xhr.status+': '+xhr.statusText+'\n'+URL);
		}
	});
}
function aj_special_get(f,URL){
	var qryString = $(f).serialize();
	window.location=URL +'?'+ qryString
	//$.ajax({
	//	type: "GET",
	//	url: URL,
	//	data: qryString,
	//	success: function(message) {
	//		if (message.length > 0) { $("#"+ DIV).html(message); }
	//	},
	//	error: function (xhr, ajaxOptions, thrownError){
	//		alert(xhr.status+': '+xhr.statusText+'\n'+URL);
	//	}
	//});
}
function aj_post_raw(f,DIV,URL,NOTEDIV){
	var qryString = $(f).serialize();
	$.ajax({
		type: "POST",
		url: URL,
		data: qryString,
		success: function(message) {
			$("#"+NOTEDIV).show();
			$('#'+NOTEDIV).fadeOut(5000);
		},
		error: function (xhr, ajaxOptions, thrownError){
			alert(xhr.status+': '+xhr.statusText+'\n'+URL);
		}
	});
}
function aj_get_raw(URL,qryString){
	$.ajax({
		type: "GET",
		url: URL,
		data: qryString,
		success: function(message) {
		},
		error: function (xhr, ajaxOptions, thrownError){
			alert(xhr.status+': '+xhr.statusText+'\n'+URL);
		}
	});
}
function archive(id){
	$.ajax({
		type: "GET",
		url: "scripts/various.php",
		data: "case=archive&oid="+id,
		success: function(message) {
			if(message=="DONE"){$('#tr_'+id).fadeOut(250)}
		},
		error: function (xhr, ajaxOptions, thrownError){
			alert(xhr.status+': '+xhr.statusText+'\nscripts/various.php');
		}
	});
}


