function openLightBox(quale,w,h,f,s,v)
{
	
		if(moving)
			return;
		moving = true;

		var pathArray = window.location.href.split( '/' );
		var baseURL = "";
		for ( i = 0; i<(pathArray.length-1); i++ ) {
			baseURL += pathArray[i];
			baseURL += "/";
		}
		var pageName = pathArray[pathArray.length-1].split('?')[0] == '#' ? '' : pathArray[pathArray.length-1].split('?')[0];
		var thisURL = baseURL;
		
		
		/*
		var myTextArea = document.getElementById('embedCode');
		myTextArea.value = "<object width=\"" + w + "\" height=\"" + h + "\">";
		myTextArea.value += "<param name FlashVars value=\"first="+f+"&second="+s+"&video="+v+"\"><param name=\"movie\" value=\""+baseURL+"videogallery.swf\"></param>";
 		myTextArea.value += "<param name=\"allowFullScreen\" value=\"true\"></param>";
 		myTextArea.value += "<param name=\"allowscriptaccess\" value=\"always\"></param>";
 		myTextArea.value += "<embed src=\""+baseURL+"videogallery.swf\" FlashVars=\"first="+f+"&second="+s+"&video="+v+"\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"" + w + "\" height=\"" + h + "\"></embed>";
		myTextArea.value += "</object>";
		*/
		myTextArea = document.getElementById('urlCode');
		myTextArea.value = "<a href=\""+thisURL+pageName+"?f="+f+"&s="+s+"&v="+v+"\">link name here</a>";
	
     //spazio dall'alto
     var verticaloffset = 5;
     var element = document.getElementById(quale);
    	
     new Effect.BlindDown(quale);
     //Dentro il background!
     
    	var browser=navigator.appName;
		var b_version=navigator.appVersion;
		var version=parseFloat(b_version);
    
     if ((browser=="Microsoft Internet Explorer") && (version<=4))
    {
    	
    	//l'altezza del body
    	var altezza = document.body.clientHeight;
     	
     	//finalmente quella giusta (altezza della finestra aperta
     	var altezza2 = document.documentElement.clientHeight;
     	var larghezza2 = document.documentElement.clientWidth;
     	//altezza dello schermo
     	//var altezza = screen.availHeight;
     	document.getElementById('lb_sfondo').style.height= altezza + "px";
     	document.getElementById('lb_sfondo').style.width= larghezza2 + "px";
     	
     	//alert(altezza2);
     	
     }
    
     new Effect.toggle('lb_sfondo', 'appear', {duration: 1.0, from: 0.0, to: 0.7});
     setTimeout("moving = false",1200);
}

function closeLightBox(quale)
{
		if(moving)
			return;
		moving = true;
		
    var browser=navigator.appName;
		var b_version=navigator.appVersion;
		var version=parseFloat(b_version);
     
    
    
     //Al contrario
     new Effect.BlindUp(quale);
     new Effect.toggle('lb_sfondo', 'appear', {duration: 1.0, from: 0.7, to: 0.0}); 
     setTimeout("moving = false",1200);   
}

function getUrl()
{
 return window.location.href;
}
