function changeMessage(lang)
{
	var msg;
	
	if(lang=='en') msg='Select your language';
	if(lang=='de') msg='W&auml;hlen Sie Ihren language aus';
	if(lang=='it') msg='Selezionate il vostro language';
	if(lang=='es') msg='Seleccione su language';
	if(lang=='fr') msg='S&eacute;lectionnez votre language';
	if(lang=='ca') msg='Seleccioneu l\'idioma';
    document.getElementById("bloc").innerHTML = msg;
}
function alertSize(taille) {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  if(taille=='width') { return myWidth;}
  if(taille=='height') {return myHeight;}
}
/*
//<![CDATA[
jQuery(document).ready(function() {
	
	function writediv(idP,REP)
	{
		alert('ok');
		$.ajax({
			type: "GET",
			url:"viewphoto.php",
			data:'idP='+escape(idP)+'&RepPhotos='+escape(REP),
			success: function(msg){
				document.getElementById('popup').style.display='block';
				document.getElementById('popup').style.height = '100%'; 
				$("div#popup").html(msg);
				document.getElementById('popup2').style.display = 'block';
			}
		});
	}
	function AddCaddie(idP,idPP,qt)
	{
		$.ajax({
			type: "GET",
			url:"caddie.php",
			data:'act=add&idP='+escape(idP)+'&idPP='+escape(idPP)+'&qt='+escape(qt),
			success: function(msg){
			document.getElementById('popup').style.display='block';
				document.getElementById('popup').style.height = '100%'; 
				$("div#popup").html(msg);
				document.getElementById('popup2').style.display = 'block';
			}
		});
	}
	function delcaddie(idS)
	{
		$.ajax({
			type: "GET",
			url:"caddie.php",
			data:'act=del&idS='+escape(idS),
			success: function(msg){
			document.getElementById('popup').style.display='block';
				document.getElementById('popup').style.height = '100%'; 
				$("div#popup").html(msg);
				document.getElementById('popup2').style.display = 'block';
			}
		});
	}
	function majcaddie(idS,qt,qtID)
	{
		$.ajax({
			type: "GET",
			url:"caddie.php",
			data:'act=maj&idS='+escape(idS)+'&qt='+escape(qt),
			success: function(msg){
				alert(msg);
				document.getElementById('popup').style.display='block';
				document.getElementById('popup').style.height = '100%'; 
				$("div#popup").html(msg);
				document.getElementById('popup2').style.display = 'block';
			}
		});
	}
});
//]]>
*/

function file(fichier)
{
	if(window.XMLHttpRequest) // FIREFOX
	  xhr_object = new XMLHttpRequest(); 
	else if(window.ActiveXObject) // IE
	  xhr_object = new ActiveXObject("Microsoft.XMLHTTP"); 
	else 
	  return(false); 
	xhr_object.open("GET", fichier+'&dt='+ new Date().getTime(), false); 
	xhr_object.setRequestHeader("Cache-Control","no-cache");
	xhr_object.send(null); 
	if(xhr_object.readyState == 4) return(xhr_object.responseText);
	else return(false);
}
//document.write("<div id=popup2 style=\"position:absolute;z-index:9000;background-color:#000000;display:block;top:0px;left:0px\" class=\"trans80\" ></div>");


document.write("<div id=\"popup\" style=\"position:absolute;top:0px;left:0;z-index:8000;width:100%\" ></div>");
function showImg(html_mil) 
{ 
	
	document.getElementById('popup').style.display='block';
	document.getElementById('popup').style.width = '100%'; 
	document.getElementById('popup').style.height = haut+'px'; 
	document.getElementById('popup').innerHTML = html_mil;
	document.getElementById('popup2').style.display = 'block';
	//alert(html_mil); 
} 
larg = screen.width; 
haut = screen.height; 


function writediv(idP,REP)
{
	
	texte=file('viewphoto.php?idP='+escape(idP)+'&RepPhotos='+escape(REP));
	showImg(texte);
}
function recal(idT,id)
{
	texte=file('recal.php?idT='+escape(idT)+'&id='+escape(id));
	eval(texte);
}
function justviewphoto(idP,REP)
{
	
	texte=file('justviewphoto.php?idP='+escape(idP)+'&RepPhotos='+escape(REP));
	showImg(texte);
}
//Addcaddie
function AddCaddie(idP,idPP,qt)
{
	texte=file('caddie.php?act=add&idP='+escape(idP)+'&idPP='+escape(idPP)+'&qt='+escape(qt));
	showImg(texte);
}
function caddielistsmall()
{
	texte=file('caddie.php?act=listsmall');
	document.getElementById('caddielist').innerHTML = texte;
}
function nbcaddie()
{
	texte=file('caddie.php?act=nbcaddie');
	document.getElementById('nbcaddie').innerHTML = texte;
}
function delcaddie(idS)
{
	texte=file('caddie.php?act=del&idS='+escape(idS));
	showImg(texte);
}
function majcaddie(idS,qt,qtID)
{
	texte=file('caddie.php?act=maj&idS='+escape(idS)+'&qt='+escape(qt));
	//document.getElementById(qtID).innerHTML = texte;
	showImg(texte);
}
function file(fichier)
{
	if(window.XMLHttpRequest) // FIREFOX
	  xhr_object = new XMLHttpRequest(); 
	else if(window.ActiveXObject) // IE
	  xhr_object = new ActiveXObject("Microsoft.XMLHTTP"); 
	else 
	  return(false); 
	xhr_object.open("GET", fichier+'&dt='+ new Date().getTime(), false); 
	xhr_object.setRequestHeader("Cache-Control","no-cache");
	xhr_object.send(null); 
	if(xhr_object.readyState == 4) return(xhr_object.responseText);
	else return(false);
}
function closepopup()
{
	document.getElementById('popup').style.display='none';
	document.getElementById('popup2').style.display='none';
	//caddielistsmall();
	//nbcaddie();
	location.reload();
}
function Confirm(url,msg)
{
	res=confirm(msg);
	if(res=="1")
	{
		window.location.href = url;
	}
}
function clique() 
{
	if (event.button==2)
	{
		alert(' © <?=$DomaineName;?>');
	}
}
document.onmousedown=clique

