var menuOn = 0;

var infoCloseMessage="<i>Pour retourner à la navigation précédente appuyez sur le bouton clignotant à droite (ou appuyez sur la touche ESC)</i>";

var myPix = new Array(	"images/gui/icons/128x128/me/me.png", 
						"images/gui/icons/128x128/me/me4.png",
						"images/gui/icons/128x128/me/me6.png",
						"images/gui/icons/128x128/me/me7.png",
						"images/gui/icons/128x128/me/me8.png",
						"images/gui/icons/128x128/me/me9.png",
						"images/gui/icons/128x128/me/me10.png");
						

document.observe('lightview:opened', function(event) {
	new Effect.Pulsate($('lightview').down('.lv_Caption'), { pulses: 5 });
});

function menu_action_click()
{
	switch(menuOn)
	{
		case 0 :
			document.getElementById("action_menu").style.display = "block";
			document.getElementById("action_button").style.background = 'url(../images/gui/window/action_button_on.png)' ;
			menuOn = 1;		
		break;

		case 1 :
			document.getElementById("action_menu").style.display = "none";
			document.getElementById("action_button").style.background = 'url(../images/gui/window/action_button_off.png)' ;
			menuOn = 0;		
		break;
	}
}

function menu_email_click()	
{
	document.getElementById("action_menu").style.display = "none";
	document.getElementById("action_button").style.background = 'url(../images/gui/window/action_button_off.png)' ;
	self.location.href='mailto:renou.t@saturny.com?subject=Hola Thomas';
}

function menu_vcard_click()
{	
	document.getElementById("action_menu").style.display = "none";
	document.getElementById("action_button").style.background = 'url(../images/gui/window/action_button_off.png)' ;
	self.location.href='files/RENOU_T.vcf';
}

function menu_cv_click()
{	
	document.getElementById("action_menu").style.display = "none";
	document.getElementById("action_button").style.background = 'url(../images/gui/window/action_button_off.png)' ;
	self.location.href='files/CV_RENOU.pdf';
}

function action_button_out()
{
	if (menuOn == 0)
	document.getElementById("action_button").style.background = 'url(../images/gui/window/action_button_off.png)' ;
}

function maximize()
{
	self.moveTo(0,0);self.resizeTo(screen.availWidth,screen.availHeight);
}

function ouvrirURL(URL, myTitle, optionAffichage)
{
	//	0	no tool bar
	//	1	no caption
	//	2	normal
	//	3	with [add]
	
	//	 + " - " + "<span style='color: orange'>" + "<u>" + "\[ add \]" + "</u>" + "</span>"
	
	if(myTitle)
		myTitle = "<span style=\"color:#003366\">" + myTitle + " - " + "<a onClick=\"Lightview.hide\(\)\" href=\"" + URL + "\" target=\"_blank\">" + URL + "</a>" + "</span>"
	else
		myTitle = "<a onClick=\"Lightview.hide\(\)\" href=\"" + URL + "\" target=\"_blank\">" + URL + "</a>"
	
	largeurDeLecran = screen.width;
	hauteurDeLecran = screen.height;
	
	var NS = (navigator.appName=="Netscape")?true:false; 
	largeurInterneFenetre = (NS)?parent.innerWidth:document.body.clientWidth;
    hauteurInterneFenetre = (NS)?parent.innerHeight:document.body.clientHeight;

	switch(optionAffichage)
	{ 
		case "0": 
		parent.Lightview.show({ href: URL, rel: 'iframe', options: {width: largeurInterneFenetre-128, height: hauteurInterneFenetre-128} });
		break;
		 
		case "1": 
		parent.Lightview.show({ href: URL, rel: 'iframe', title: myTitle, options: {width: largeurInterneFenetre-128, height: hauteurInterneFenetre-128} });
		break; 
		
		case "2": 
		parent.Lightview.show({ href: URL, rel: 'iframe', title: myTitle, caption: infoCloseMessage, options: {width: largeurInterneFenetre-128, height: hauteurInterneFenetre-128} });
		break; 
		
		// case "3": 
		// parent.Lightview.show({ href: URL, rel: 'iframe', title: myTitle, caption: infoCloseMessage, options: {width: largeurInterneFenetre-128, height: hauteurInterneFenetre-128} });
		break; 
	}
}

function ouvrirObjet(URL, myTitle)
{
	myTitle = "<span style=\"color:#003366\">" + myTitle + "</span>"
	parent.Lightview.show({ href: URL, rel: '' ,title: myTitle, caption: infoCloseMessage, options: {} });
}

function chooseMeFace()
{
	randomNum = Math.floor((Math.random()* myPix.length));
	// document.getElementById("myPicture").src = myPix[randomNum];
	// return myPix[randomNum];
	document.getElementById("myPicture").style.backgroundImage = "url("+myPix[randomNum]+")";
}