// JavaScript Document
function change_photo(user,ref,du,indice,ext,nom_photo) {
	// url_photo='resizer.php?src=http://www.immoserail.com/'+user+'/img/photo_'+user+'_'+ref+'_'+du+'_'+indice+'.'+ext+"&width=120&height=90";
	url_photo='resizer.php?src=photos/photo_'+user+'_'+ref+'_'+du+'_'+indice+'.'+ext+"&width=120&height=90";
	document.images[nom_photo].src=url_photo;					
}

// Affichage depuis boutique

function affiche_photo(ref,du) {
	url_photo=document.images['photo_'+du].src;
	parties=url_photo.split(".jpg");
	new_url_photo=parties[0]+"b.jpg";
	// window.open("http://www.groupeurimmo.com/photo_annonce.php?img="+new_url_photo+"&ref="+ref,'','width=620,height=570,menubar=no');
	window.open("http://www.groupeurimmo.com/photo_annonce.php?img="+new_url_photo+"&ref="+ref,'','width=620,height=570,menubar=no');
}

function affiche_photob(ref,du,indice) {
	url_photo=document.images['photo_'+du+"_"+indice].src;
	parties=url_photo.split("_"+indice+".jpg");
	new_url_photo=parties[0]+"_"+indice+".jpg";
	// window.open("http://www.groupeurimmo.com/photo_annonce.php?img="+new_url_photo+"&ref="+ref,'photob','width=695,height=570,menubar=no');
	window.open("http://www.groupeurimmo.com/photo_annonce.php?img="+new_url_photo+"&ref="+ref,'photob','width=695,height=570,menubar=no');
}

function affiche_details(user,ref,du) {
	// window.open("http://www.groupeurimmo.com/details_annonce.php?id="+user+"&ref="+ref+"&du="+du,'','resizable=yes,scrollbars=yes,width=650,height=500');
	window.open("http://www.groupeurimmo.com/details_annonce.php?id="+user+"&ref="+ref+"&du="+du,'','resizable=yes,scrollbars=yes,width=650,height=500');
}

function affiche_details_reference(user,ref) {
	arr=ref.split("@");
	// if (ref!="") window.open("http://www.groupeurimmo.com/details_annonce.php?id="+user+"&ref="+arr[0]+"&du="+arr[1],'','resizable=yes,scrollbars=yes,width=650,height=500');
	if (ref!="") window.open("http://www.groupeurimmo.com/details_annonce.php?id="+user+"&ref="+arr[0]+"&du="+arr[1],'','resizable=yes,scrollbars=yes,width=650,height=500');
}

function impression_details(user,ref,du) {
	// window.open("http://www.groupeurimmo.com/imprimer_annonce.php?id="+user+"&ref="+ref+"&du="+du,'','resizable=yes,scrollbars=yes,width=650,height=500');
	window.open("http://www.groupeurimmo.com/imprimer_annonce.php?id="+user+"&ref="+ref+"&du="+du,'','resizable=yes,scrollbars=yes,width=650,height=500');
}

// Idem depuis administration

function affiche_photo_admin(ref,du,url_site) {
	url_photo=document.images['photo_'+du].src;
	parties=url_photo.split(".jpg");
	new_url_photo=parties[0]+"b.jpg";
	window.open(url_site+"photo_annonce.php?img="+new_url_photo+"&ref="+ref,'','width=620,height=570,menubar=no');
}

function affiche_details_admin(user,ref,du,url_site) {
	window.open(url_site+"details_annonce.php?id="+user+"&ref="+ref+"&du="+du,'','resizable=yes,scrollbars=yes,width=650,height=500');
}

function impression_details_admin(user,ref,du,url_site) {
	window.open(url_site+"imprimer_annonce.php?id="+user+"&ref="+ref+"&du="+du,'','resizable=yes,scrollbars=yes,width=650,height=500');
}

