/**
 * @author Anna Maria Romano
 */
/**
 * Funzioni per mostrare brochure
 */

function showBrochure() {

	var params = {
		wmode : "transparent", 
		allowScriptAccess : "sameDomain",
		quality : "high",
		wmode : "transparent",
		autoStart : "-1",
		menu : "false"
	};
	var attributes = { 
		id : "Brochure",
		name : "Brochure",
		zIndex : "1"
	};

	var swfFile = null;

	try {
		swfFile = "flash/Brochure_I-Do.swf";
 
	} catch (e) {
		alert( e.message? e.message : e );
	}
   
   //prima di mostrare l'swf carico il div con l'immagine di waiting
    var divSrc = '<img src="css/please_wait.gif" />';
    divSrc = '<div id="wait" style="height: 55px;width: 177px;' +
	         ' background-color: #000; border: 3px solid #ccc;">' + divSrc + '</div>';
    $("#wait").replaceWith( divSrc );
	
	var cacheDisableTrick = "?cacheDisableTrick=" + (new Date()).getTime();
	 
	swfobject.embedSWF(
			swfFile + cacheDisableTrick, 
			"Brochure", "600", "450", "9.0.0",
			"flash/expressInstall.swf",  
			null, params, attributes, onLoaded);
	
}

function onLoaded(e){
	
	//alert("onLoaded(): " + e.success);
	//qui nascondo il div del waiting
	//prima di mostrare l'swf carico il div con l'immagine di waiting
	
    $("#wait").replaceWith( '<div id="wait"></div>' );
	__centerImage();
}

function __centerImage() {
	var options = {
			close:true,
			containerId: 'simplemodal-container', 
			overlayId: 'simplemodal-overlay',
			onClose:function( dialog ) {
				$.modal.close();
				$("#Brochure").replaceWith( "<div id='Brochure'></div>" );
			}
		};
		$('#basicModalContent').modal( options );
}




