
// Flash detect
function flashdetect(version) {
	var playerversion = version;

	if (navigator.appVersion.indexOf("MSIE 4.5") != -1) {
		return true;
	} else {
		var agent = navigator.userAgent.toLowerCase();
		gotflash = 0;

		if (navigator.mimeTypes
			&& navigator.mimeTypes["application/x-shockwave-flash"]
			&& navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin
			&& navigator.plugins
			&& navigator.plugins["Shockwave Flash"]){
			// NS3+ and Opera3+ (support plugin array):  check for Flash plugin in plugin array
			if (navigator.plugins != null && navigator.plugins.length > 0) {
				var flashPlugin = navigator.plugins['Shockwave Flash'];

				if (typeof flashPlugin == 'object') {
					desc = flashPlugin.description;
					startpnt = desc.indexOf('Flash') +6;
					endpnt = desc.indexOf('.');
					gotflash = parseInt((desc.substring(startpnt, endpnt)));
				}
			}
		}
		
		// Check the browser...we're looking for ie/win, but not aol
		var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;    // true if we're on ie
		var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false; // true if we're on windows

		// This is a js1.1 code block, so make note that js1.1 is supported.
		jsVersion = 1.1;

		// Write vbscript detection on ie win. IE on Windows doesn't support regular
		// JavaScript plugins array detection.
		if(isIE && isWin) {
			var WM_startTagFix = '</';
			document.writeln('<script language="VBscript">');
			document.writeln('on error resume next');
			document.writeln('if IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.10")) then gotflash = 10');
			document.writeln('if gotflash < 10 and IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.9")) then gotflash = 9');
			document.writeln('if gotflash < 9 and IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8")) then gotflash = 8');
			document.writeln('if gotflash < 8 and IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.7")) then gotflash = 7');
			document.writeln('if gotflash < 7 and IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6")) then gotflash = 6');
			document.writeln('if gotflash < 6 and IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5")) then gotflash = 5');
			document.writeln('if gotflash < 5 and IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4")) then gotflash = 4');
			document.writeln('if gotflash < 4 and IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3")) then gotflash = 3'); 
			document.writeln(WM_startTagFix+'script>');
		}		

		if (gotflash < playerversion) {
			// Flash 4 or later
			return false;
		} else {
		    // Flash 5 or more
			return true;
		} 
	}
} 



// Genera il flash o l'alternativa statica
function generatorflash(nomefile,width,height,bgcolor,version,playerversion,no1,no2) {
	var playerversion = 7;
	var N1;
	var NNONE;
	NNONE= no1;	
	

	N1=('<OBJECT  wmode="opaque" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + version + '" ID="ticker_news" WIDTH="' + width + '" HEIGHT="' + height + '">');
	N1= N1+ ('<PARAM NAME=movie VALUE="' + nomefile + '">');
	N1= N1+ ('<PARAM NAME=quality VALUE=high>');
	N1= N1+ ('<PARAM NAME=bgcolor VALUE=#' + bgcolor + '>');
	N1= N1+ ('<PARAM NAME=menu VALUE=False>');
	N1= N1+ ('<PARAM NAME=borders VALUE=noborder>');
	N1= N1+ ('<PARAM NAME=loop VALUE=true >');
	N1= N1+ ('<PARAM NAME=wmode VALUE=opaque >');	
	N1= N1+ ('<embed src="' + nomefile + '" quality=high loop=true menu=false bgcolor=#' + bgcolor + '');
	N1= N1+ ('swLiveConnect="FALSE" WIDTH="' + width + '" HEIGHT="' + height + '" border="0" TYPE="application/x-shockwave-flash"');
	N1= N1+ ('PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></embed></OBJECT>')
	

	
	if (flashdetect(playerversion)) document.write(N1);
	else { 
		//document.write(NNONE); 
		//setTimeout("document.location.replace('http://www.dexanet.com/saleri/index_eng.asp')",5000); 
		document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">');    
		document.write('<tr><td bgcolor="#FFFFFF" height="147" width="190"><div align="center"><a href="storia.asp');
		document.write('<img src="strisce/home01.jpg" width="190" height="147" border="0"></a></div></td>'); 
		document.write('<td bgcolor="#FFFFFF" height="147" width="191"><a href="prodo.asp"><img src="strisce/home02.jpg" width="191" height="147" border="0"></a></td>'); 
		document.write('<td bgcolor="#FFFFFF" height="147" width="188"><a href="Magazine.asp"><img src="strisce/home03.jpg" width="188" height="147" border="0"></a></td>'); 
		document.write('</tr><tr><td bgcolor="#B2B2B2" height="21"><b><a class="linkgrigio8" href="storia.asp"><font color="#FFFFFF">Esplora l\'azienda </font></a></b></td>'); 
		document.write('<td bgcolor="#B2B2B2" height="21"><b><a class="linkgrigio8" href="prodo.asp"><font color="#FFFFFF">Gamma prodotti</font></a></b></td>');
		document.write('<td bgcolor="#B2B2B2" height="21"><b><a class="linkgrigio8" href="Magazine.asp"><font color="#FFFFFF">Comunicazione e marketing</font></a></b></td>');
		document.write('</tr><tr><td bgcolor="#FFFFFF" valign="top" colspan="3">&nbsp; </td></tr></table>'); 
	}
}

