var requiredVersion = 4;   // Version the user needs to view site (max 6, min 2)
var useRedirect = false;    // Flag indicating whether or not to load a separate

var flashPage = "movie.html"      // The location of the flash movie page
var noFlashPage = "noflash.html"  // Page displayed if the user doesn't have the
                                  // plugin or we can't detect it.
var upgradePage = "upgrade.html"  // Page displayed if we detect an old plugin

var flash2Installed = false;    // boolean. true if flash 2 is installed
var flash3Installed = false;    // boolean. true if flash 3 is installed
var flash4Installed = false;    // boolean. true if flash 4 is installed
var flash5Installed = false;    // boolean. true if flash 5 is installed
var flash6Installed = false;    // boolean. true if flash 6 is installed
var maxVersion = 6;             // highest version we can actually detect
var actualVersion = 0;          // version the user really has
var hasRightVersion = false;    // boolean. true if it's safe to embed the flash movie in the page
var jsVersion = 1.0;            // the version of javascript supported

var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;    // true if we're on ie
var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false; // true if we're on windows

jsVersion = 1.1;

if(isIE && isWin){
  document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
  document.write('on error resume next \n');
  document.write('flash2Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.2"))) \n');
  document.write('flash3Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3"))) \n');
  document.write('flash4Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
  document.write('flash5Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');  
  document.write('flash6Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n');  
  document.write('</SCR' + 'IPT\> \n'); // break up end tag so it doesn't end our script
}

function detectFlash() {  
  // If navigator.plugins exists...
  if (navigator.plugins) {
    // ...then check for flash 2 or flash 3+.
    if (navigator.plugins["Shockwave Flash 2.0"]
        || navigator.plugins["Shockwave Flash"]) {

      var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
      var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;

      var flashVersion = parseInt(flashDescription.charAt(flashDescription.indexOf(".") - 1));
     
      flash2Installed = flashVersion == 2;    
      flash3Installed = flashVersion == 3;
      flash4Installed = flashVersion == 4;
      flash5Installed = flashVersion == 5;
      flash6Installed = flashVersion >= 6;
    }
  }
  
  for (var i = 2; i <= maxVersion; i++) {  
    if (eval("flash" + i + "Installed") == true) actualVersion = i;
  }

  if(navigator.userAgent.indexOf("WebTV") != -1) actualVersion = 3;  
  
  if (actualVersion >= requiredVersion) {

    if (useRedirect) {
      if(jsVersion > 1.0) {
        window.location.replace(flashPage);  
      } else {
        window.location = flashPage;
      }
    }

    hasRightVersion = true;                
  } else {  
    if (useRedirect) {
      if(jsVersion > 1.0) {
        window.location.replace((actualVersion >= 2) ? upgradePage : noFlashPage);
      } else {
        window.location = (actualVersion >= 2) ? upgradePage : noFlashPage;
      }
    }
  }
}


detectFlash();  // call our detector now that it's safely loaded.  


function mailafriend()
{
     mail_address = prompt('\r\nScrivi l\'indirizzo e-mail dei tuoi amico', '');

     if(mail_address != null)
     {     
          var foundat = mail_address.lastIndexOf("@");
          var founddot = mail_address.lastIndexOf(".");
          if(foundat != -1)
          {
               if (founddot != -1)
               {
                    self.location="mailto:" + mail_address + "?subject=Ciao, ho visto questo sito e ho pensato che forse potrebbe piacerti !&body=Clicca sul link per andare a visitare il sito Radamantino Bolognese \n \n  http://www.radamantino.co.uk";
               }
               else 
               {
                    alert('Sorry But Thats Not a Valid Email Address');
               }
          }
          else 
          {
               alert('Sorry But Thats Not a Valid Email Address');
          }
     }
}

function newWindow(newin) {
	var xval, yval
	xval=(screen.width/2) - (580/2);
	yval=(screen.height/2) - (435/2);

	if (navigator.appVersion.indexOf("Win")!=-1)
	{
	
	if (navigator.appName =="Netscape") 
		{//Netscape On PC
		if (parseInt(navigator.appVersion)<5)
			{
			//Netscape 4
			yval-=10;
			}
		else
			{
			//Netscape 6
			yval-=25;
			}
		flyout = window.open(newin, "flyout", 'resizable=no,scrollbars=no,width=580,height=435,screenx=' + xval + ',screeny=' + yval +''); 
		}
	else
		{//IE On PC
		yval-=25;
		flyout = window.open(newin, "flyout", 'resizable=no,scrollbars=no,width=580,height=435,left=' + xval + ',top=' + yval +''); 
		}
	}
	else
	{
	if (navigator.appName =="Netscape") 
		{//Netscape On Mac
		yval-=50
		flyout = window.open(newin, "flyout", 'resizable=no,scrollbars=no,width=580,height=435,screenx=' + xval + ',screeny=' + yval +''); 
		}
	else
		{//IE On Mac
		flyout = window.open(newin, "flyout", "resizable=no,scrollbars=no,width=580,height=435,left=" + xval +",screeny=" + yval +""); 
		flyout.moveBy(xval,(yval-25));
		}
	}
}

function POPUP(U,N,S,P,F,H) {
var				// SET YOUR **DEFAULT** SETTINGS HERE
URL = "http://www.yahoo.com",	// SPECIFY URL, or B for blank page
NAME = "PopUpWindow",		// Window Name (if use same twice, URL will load in same window
SIZE = "200x100",		// R=Random, OR WxH pixels (eg: 200x300)
POSN = "C",			// R=Random, C=Center (only if size specified), TL=TopLeft OR XxY pixels
FEAT = "",			// ONLY LIST ONES THAT YOU WANT !
HAND = "POP";			// FILEHANDLE, IF YA KNOW WHAT THAT MEANS

// usage : POPUP('URL','NAME','SIZE','POSN','FEATURES','HANDLE');
// All parameters passed to the function are optional (if none, will use default)
// - but can ONLY removed in this order : HAND -> FEAT -> POSN -> SIZE -> NAME -> URL
// - eg: you can omit HANDLE completely, but can't specify HANDLE yet omit POSN

var w,h,x,y,SI='',PO='',Sw,Sh;if(window.screen){Sw=screen.availWidth;Sh=screen.availHeight;}else{Sw=0;}
if(((!U)||(U=='')||(U=='D'))){U=URL;}	if(U=='B'){U='about:blank';}
if(((!N)||(N=='')||(N=='D'))){N=NAME;}	if(((!S)||(S=='')||(S=='D'))){S=SIZE;}
if(((!P)||(P=='')||(P=='D'))){P=POSN;}	if(((!F)||(F=='')||(F=='D'))){F=FEAT;}
if(((!H)||(H=='')||(H=='D'))){H=HAND;}	S=S.toUpperCase(); P=P.toUpperCase();
if(S!='R'){S=S.toUpperCase();w=S.split('X')[0];h=S.split('X')[1]; SI='width='+w+',height='+h;}
if(F){F=','+F;} if(P!='R'){if(P=='TL'){x=0;y=0;}else if(P=='C'){if((SI)&&(Sw!=0)){x=(Sw-w)/2;y=(Sh-h)/2;}
else {PO='';}}else{P=P.toUpperCase();x=P.split('X')[0];y=P.split('X')[1];}
PO=',screenX='+x+',left='+x+',top='+y+',screenY='+y;}if(Sw==0){PO='';}
var DOIT='var H=window'+'.open("'+U+'","'+N+'","'+SI+PO+F+'")'; eval(DOIT);
}

<!-- BROWSER DETECTION -->

browserName = navigator.appName;
browserVer = parseInt(navigator.appVersion);

ns3up = (browserName == "Netscape" && browserVer >= 3);
ie4up = (browserName.indexOf("Microsoft") >= 0 && browserVer >= 4);

function doPic(imgName) {
if (ns3up || ie4up) {
imgOn = ("" + imgName);
document.mainpic.src = imgOn;
    }
}

<!-- POP UP CENTRAL -->

function NewWindow(mypage, myname, w, h, scroll,resize) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable='+resize+''
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
<!-- END -->

<!-- ADD TO FAVORITES -->

var bookmarkurl="http://www.radamantino.co.uk"
var bookmarktitle="Radamantino Bolognese"
function addBookmark(){
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}

   function GetDay(intDay){
     var DayArray = new Array("domenica", "lunedì", "martedì", "mercoledì", 
                          "giovedì", "venerdì", "sabato")
     return DayArray[intDay]
     }

function GetMonth(intMonth){
     var MonthArray = new Array("gennaio", "febbraio", "marzo",
                                "aprile", "maggio", "giugno",
                                "luglio", "agosto", "settembre",
                                "ottobre", "novembre", "dicembre") 
     return MonthArray[intMonth]                  
     }
   function getDateStrWithDOW(){
     var today = new Date()
     var todayStr = GetDay(today.getDay()) + " "
     todayStr += today.getDate() + " " + GetMonth(today.getMonth())
     return todayStr
     }

