//<SCRIPT>

jQuery(document).ready(function(){
	jQuery("#modular").dialog({
		autoOpen: (GetQueryString("target") == "modular" ? true : false),
		bgiframe: true,
		resizable: true,
		height: 520,
		width: 890,
		modal: false,
		title: "Modular Engines",
		buttons: {
			Close: function () {
				jQuery(this).dialog('close');
			}
		}
	});

	jQuery("#smallblock").dialog({
		autoOpen: (GetQueryString("target") == "302" ? true : false),
		bgiframe: true,
		resizable: true,
		height: 780,
		width: 870,
		modal: false,
		title: "Small Block 302 Based Engines",
		buttons: {
			Close: function () {
				jQuery(this).dialog('close');
			}
		}
	});

	jQuery("#threefiftyone").dialog({
		autoOpen: (GetQueryString("target") == "351" ? true : false),
		bgiframe: true,
		resizable: true,
		height: 750,
		width: 400,
		modal: false,
		title: "351 Based Engines",
		buttons: {
			Close: function () {
				jQuery(this).dialog('close');
			}
		}
	});

	jQuery("#raceengines").dialog({
		autoOpen: (GetQueryString("target") == "race" ? true : false),
		bgiframe: true,
		resizable: true,
		height: 780,
		width: 820,
		modal: false,
		title: "Sealed Race Engines",
		buttons: {
			Close: function () {
				jQuery(this).dialog('close');
			}
		}
	});

	jQuery("#bigblock").dialog({
		autoOpen: (GetQueryString("target") == "big" ? true : false),
		bgiframe: true,
		resizable: true,
		height: 750,
		width: 600,
		modal: false,
		title: "Big Block Engines",
		buttons: {
			Close: function () {
				jQuery(this).dialog('close');
			}
		}
	});

	jQuery("#divPartImage").dialog({
		autoOpen: false,
		bgiframe: true,
		resizable: true,
		height: 600,
		width: 600,
		modal: false,
		title: "Part Image",
		buttons: {
			Close: function () {
				jQuery(this).dialog('close');
			}
		}
	});
});

function openIMGwindow_onclick(partImage) {    
	var $dialogPartImg = jQuery("#divPartImage");
	var strHTMLimg = "<img src='../images/part/full/" + partImage.id + "' />";
	$dialogPartImg.dialog("open");
	$dialogPartImg.html(strHTMLimg);
}

function writeEngine(id){
	document.write("<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0'' WIDTH='150' HEIGHT='125' id='engine" + id + "' >");
	document.write("<PARAM NAME='movie' VALUE='./flash/engine" + id + ".swf'><PARAM NAME='quality' VALUE='best'><PARAM NAME='bgcolor' VALUE='#FFFFFF'>");
	document.write("<EMBED src='./flash/engine" + id + ".swf' quality='best' scale='exactfit' wmode='transparent' bgcolor='#ffffff' WIDTH='150' HEIGHT='125' NAME='engine" + id + "' ALIGN='' TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer'></EMBED>");
	document.write("</OBJECT>");
}

function launchModularEngines() {
	jQuery("#modular").dialog("open");
}
function launch302SBEngines() {
	jQuery("#smallblock").dialog("open");
}
function launch351Engines() {
	jQuery("#threefiftyone").dialog("open");
}
function launchRaceEngines() {
	jQuery("#raceengines").dialog("open");
}
function launchBBEngines() {
	jQuery("#bigblock").dialog("open");
}
