window.flash = new Object();
window.flash.myExtFunction= function(val){
		alert("javaCalls"+val)
}
function MM_findObj(n, d) 
{
	var p,i,x;

	// La ricorsione per la ricerca inizia a livello del documento
	if (!d) d=document; 
	
	if ((p=n.indexOf("?"))>0 && parent.frames.length) 
	{
		d = parent.frames[n.substring(p+1)].document;
		n = n.substring(0,p);
	}
	
	if (!(x=d[n]) && d.all) 
		x = d.all[n]; 
		
	for (i=0; !x && i<d.forms.length;i++) 
		x=d.forms[i][n];
		
	// Ricorsione per tutti i layer. Ci si interrompe se si trova l'oggetto
	for (i=0; !x && d.layers && i < d.layers.length; i++)
			x = MM_findObj(n, d.layers[i].document);
		
	// Se infine non si è ancora trovato l'oggetto si usa il metodo GetElementById 
	if (!x && d.getElementById) 
		x = d.getElementById(n);
		
	return x;
}
/*function thisMovie(movieName) {
    if (navigator.appName.indexOf("Microsoft") != -1) {
        return window[movieName]
    }
    else {
        return document[movieName]
    }
}
function scrivi(val){
	MM_findObj("flashObject",null).javaCalls(val)
}*/	
function callExternalInterface() {
	//alert(MM_findObj("flash",null))
	//alert(document.getElementById("flash"))
	if(MM_findObj("flash",null)!=undefined){
		//alert(MM_findObj("flash",null).myExtFunction)
		//alert(MM_findObj("flash",null))MM_findObj("flash",null)	MM_findObj("flash",null)
 		if(MM_findObj("flash",null).myExtFunction!=undefined){
			//alert(MM_findObj("flash",null).myExtFunction)
			MM_findObj("flash",null).myExtFunction();
		}
  }
}

function mousemove(e) { 
	//alert(e)
	//alert(navigator.appName.indexOf("Explorer"))
	MousePosition=[]
   if(window.attachEvent || navigator.appName.indexOf("Explorer")!=-1) 
         { 
     MousePosition[0] = event.clientX; 
     MousePosition[1] = event.clientY; 
     } 
   else 
     { 
       MousePosition[0] = e.pageX;
       MousePosition[1] = e.pageY; 
     } 
	left=Math.floor((document.body.clientWidth-(728+251))/2);
	//
	topmarg=105;
	//
	bottommarg=218+topmarg;
	//380+topmarg;
	right=left+728;
	//left+(939);
	// detecting mouse
	//alert("a")
	//alert(MousePosition[0])
	
	 if(MousePosition[0]<left || MousePosition[0]>right || MousePosition[1]<topmarg || MousePosition[1]>bottommarg ){ 
	 	//alert("out")
		callExternalInterface()
	}
} 
