
var g_classid = 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000';
var g_codebase = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0';
var g_pluginspage = 'http://www.macromedia.com/go/getflashplayer';
var g_type = 'application/x-shockwave-flash'

function diagnosis(){
	removeOverlay();
	addOverlay();
	/********************************************************************/
	var html = '';
	/********************************************************************/
	var swfpath = '/cars/golf/swf/diagnosis.swf';
	var swfwidth = '612';
	var swfheight = '462';
	var wmode = 'transparent';
	html = '<div id="diagnosis_contents">';
	html += '<object classid="' + g_classid + '" codebase="' + g_codebase + '" width="' + swfwidth + '" height="' + swfheight + '">';
	html += '<param name="movie" value="' + swfpath + '">';
	html += '<param name="wmode" value="transparent">';
	html += '<param name="quality" value="high">';
	html += '<embed src="' + swfpath + '" wmode="' + wmode + '" quality="high" pluginspage="' + g_pluginspage + '" type="' + g_type + '" width="' + swfwidth + '" height="' + swfheight + '">';
	html += '</object>';
	html += '</div>';
	$("body").prepend( html );
	var top = Math.floor( ( $(window).height() - swfheight ) / 2 ) + $(document).scrollTop();
	var left = Math.floor( ( 780 - swfwidth ) / 2 );
	$('#diagnosis_contents').css({
		width:swfwidth + "px",
		height:swfheight + "px",
		zIndex:"10000",
		top:top + "px",
		left:left + "px",
		overflow:"hidden",
		position:"absolute"
	});
	/********************************************************************/
	return false;
}

function close01(){
	$('#diagnosis_contents').remove();
	removeOverlay();
}

function addOverlay(){
	if( $("#diagnosis_overlay").length == 0 ){
		$("body").append( '<div id="diagnosis_overlay"></div>' );
		$('#diagnosis_overlay').css({
			width:"100%",
			height:"500px",
			zIndex:"1000",
			top:"0px",
			left:"0px",
			overflow:"hidden",
			position:"absolute"
		});
		$('#diagnosis_overlay').css({
			backgroundColor:'#000',
			opacity:0.2,
			width:$(document).width(),
			height:$(document).height()
		}).fadeIn();
		$(window).resize(function(){
			$('#diagnosis_overlay').css({
				width:$(document).width(),
				height:$(document).height()
			});
		});
	}
}

function removeOverlay(){
	if( $("#diagnosis_overlay").length != 0 ){
		$('#diagnosis_overlay').fadeOut(function() { $('#diagnosis_overlay').remove(); });
	}
}

