function getId(id)
{
	return document.getElementById(id);
}

function ouvrirVisite360_simplifie(url){
	
	
	var left = (window.screen.width - 323) / 2;
	var top = (window.screen.height - 315) / 2; 
	
	var configuration = "width=320,height=315,scrollbars=no, toolbar=no, menubar=no, location=no, directories=no, status=no, resizable=no, left="+left+", top="+top;
	
	window.open(url, 'visite360', configuration);
	
}

function ouvrirVisite360_standard(url){
	
	var width = 900;
	var height = 600;
	var left = (window.screen.width - 900) / 2;
	var top = (window.screen.height - 600) / 2;
	var configuration = "'scrollbars=no, toolbar=no, menubar=no, location=no, directories=no, status=no, resizable=no,height="+height+", width="+width+", left="+left+", top="+top;
	
	window.open(url, 'visite360', configuration);
	
}

/** retourne la version du navigateur (FF pour Firefox ; 5, 6, 7... pour IE en fonction des versions) **/
function navVersion()
{
	if(navigator.appName == 'Microsoft Internet Explorer') version = navigator.appVersion.substr(22, 1);
	else version = 'FF';
	
	return version;
}

/** fonction pour connaitre exactement le navigateur et sa version (dans le cas IE et FF) **/
function browserVersion()
{
	var version;
	
	switch(navigator.appName)
	{
		case 'Microsoft Internet Explorer':
			version = 'Internet Explorer ' + navigator.appVersion.substr(22, 1);
			break;
		
		case 'Opera':
			version = 'Opera';
			break;
		
		case 'Netscape':
			if(navigator.userAgent.indexOf('Firefox') != -1) version = 'Firefox ' + navigator.userAgent.substr((navigator.userAgent.lastIndexOf('/')+1), 1);
			else if(navigator.userAgent.indexOf('Chrome') != -1) version = 'Chrome';
			else if(navigator.userAgent.indexOf('Safari') != -1) version = 'Safari';
			break;
		
		default:
			version = 'Other...';
			break;
	}
	
	return version;
}


function afficher_infobulle_presse(article)
{
	GetId('infobulle_'+article).style.display = 'block';
	GetId('titre_defaut').style.display = 'none';
	GetId('img_defaut').style.display = 'none';
}

function cacher_infobulle_presse(article)
{
	GetId('infobulle_'+article).style.display = 'none';
	GetId('titre_defaut').style.display = 'block';
	GetId('img_defaut').style.display = 'block';
	
}

/** met en majuscules la premiere lettre d'une chaine **/
function ucFirst(chaine)
{
	var debut = chaine.charAt(0).toUpperCase();
	var fin = chaine.substr(1, chaine.length-1).toLowerCase();
	var result = debut+fin;
	return result;
}

/** met en majuscules la premiere lettre de chaques mots d'une chaine **/
function ucWords(chaine)
{
	var tabMots = chaine.split(/[ ]/);
	var tailleTab = tabMots.length;
	
	var result = '';
	var i;
	for(i = 0; i < tailleTab; i++)
	{
		result += ucFirst(tabMots[i]);
		if(i != tailleTab-1) result += ' ';
	}
	
	return result;
}