//<SCRIPT>

$(document).ready(function(){
	$("#modular").dialog({
		autoOpen: (GetQueryString("target") == "modular" ? true : false),
		bgiframe: true,
		resizable: true,
		height: 620,
		width: 890,
		modal: false,
		title: "Modular Engines",
		buttons: {
			Close: function () {
				$(this).dialog('close');
			}
		}
	});

	$("#smallblock").dialog({
		autoOpen: (GetQueryString("target") == "302" ? true : false),
		bgiframe: true,
		resizable: true,
		height: 780,
		width: 890,
		modal: false,
		title: "Small Block 302 Based Engines",
		buttons: {
			Close: function () {
				$(this).dialog('close');
			}
		}
	});

	$("#threefiftyone").dialog({
		autoOpen: (GetQueryString("target") == "351" ? true : false),
		bgiframe: true,
		resizable: true,
		height: 780,
		width: 770,
		modal: false,
		title: "351 Based Engines",
		buttons: {
			Close: function () {
				$(this).dialog('close');
			}
		}
	});

	$("#raceengines").dialog({
		autoOpen: (GetQueryString("target") == "race" ? true : false),
		bgiframe: true,
		resizable: true,
		height: 780,
		width: 930,
		modal: false,
		title: "Sealed Race Engines",
		buttons: {
			Close: function () {
				$(this).dialog('close');
			}
		}
	});

	$("#bigblock").dialog({
		autoOpen: (GetQueryString("target") == "big" ? true : false),
		bgiframe: true,
		resizable: true,
		height: 700,
		width: 770,
		modal: false,
		title: "Big Block Engines",
		buttons: {
			Close: function () {
				$(this).dialog('close');
			}
		}
	});

	$("#divPartImage").dialog({
		autoOpen: false,
		bgiframe: true,
		resizable: true,
		height: 600,
		width: 600,
		modal: false,
		title: "Part Image",
		buttons: {
			Close: function () {
				$(this).dialog('close');
			}
		}
	});
});

function openIMGwindow_onclick(partImage) {    
	var $dialogPartImg = $("#divPartImage");
	var strHTMLimg = "<img src='../images/part/full/" + partImage.id + "' />";
	$dialogPartImg.dialog("open");
	$dialogPartImg.html(strHTMLimg);
}

function launchModularEngines() {
	$("#modular").dialog("open");
}
function launch302SBEngines() {
	$("#smallblock").dialog("open");
}
function launch351Engines() {
	$("#threefiftyone").dialog("open");
}
function launchRaceEngines() {
	$("#raceengines").dialog("open");
}
function launchBBEngines() {
	$("#bigblock").dialog("open");
}
