	function addImage(parentDivTagId,paysage,idImg)
	{
		var width=160;
		if(paysage==false)width=80;
		$("#"+parentDivTagId).append("<img id=\"master-"+idImg+"\" onmouseover=\"showDet('"+idImg+"')\" onclick=\"openWork('"+idImg+"')\" src=\"img/master-"+idImg+".jpg\" width="+width+" height=\"120\">");
		
	}
		function addImageDet(parentDivTagId,paysage,idImg)
	{
		var width=160;
		if(paysage==false)width=80;
		$("#"+parentDivTagId).append("<img id=\"th-"+idImg+"\"  onclick=\"dispWorkImg('"+idImg+"')\" src=\"img/th-"+idImg+".jpg\" width="+width+" height=\"120\">");
		
	}
	function addImageFull(parentDivTagId,idImg)
	{
		var width=400;
		$("#imgHolder").hide();
		$("#"+parentDivTagId).append("<img id=\"th-"+idImg+"\" src=\"img/th-"+idImg+".jpg\" width="+width+" height=\"600\">");
		
	}
	function showDet(idImg)
	{
	var objetXHR = creationXHR();
			function traitementResultat() {
				if(objetXHR.readyState==4) {
					var resultat = objetXHR.responseText;
							if(objetXHR.status==200) {
								$("#divDetails").html(resultat);
							}
						else {
						alert("Erreur HTTP N°"+objetXHR.status);
						}
					}
			}
		objetXHR.onreadystatechange = traitementResultat;
		
		objetXHR.open("get","detWork.php?workId="+idImg,true);
		objetXHR.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		objetXHR.send(null);

}
function getUrl(url)
{
document.location=url;

}
function openWork(idImg)
{
$("img[id^='master']").fadeOut("fast",function() {
 document.location.href="index.php?id=51&work="+idImg
});
}
function dispWorkImg(idImg)
{$("#imgHolder").fadeOut("fast",function() {
 $("#imgHolder").attr("src", "img/img-"+idImg+".jpg");
 $("#imgHolder").fadeIn("fast");
});


}
function changeCss(id,css){
if($("#"+id).attr('class')!='menuLeftPanSelected' &&$("#"+id).attr('class')!='menuRightPanSelected')	$("#"+id).attr({"class": css});
}

function openServices(){
	if($("#servicesDiv").css("display")=="block"){$("#servicesDiv").slideUp("fast");}
	else $("#servicesDiv").slideDown("fast");
}

function openSub(id){
	if(id!="1"){
	if($("#menuSub"+id).css("display")=="block"){
		$("#menuSub"+id).slideUp("fast");
	}
	else{
		$("div[id^='menuSub']").slideUp("slow");
		$("#menuSub"+id).slideDown("fast");
	}
	}
	else {
			var pagposter	=document.URL.lastIndexOf("&cat=2");
			//alert(pagposter+"frf");
			if(pagposter==-1) 
			getUrl('http://arabad.ch/index.php?id=5&cat=2');
			
	}
}

function openAboutUs(){
	window.location="?id=11";

}
