block_pop = false ;

function com(id) {
	mag=open('gestion/com.php?id='+id,'mag','width=520,height=560,status=no,scrollbars=YES,menubar=no,toolbar=no,location=no');
}

function lien_mort(id,page) {
	mag=open('contact.php?id_mort='+id+'&page='+page,'mag','width=700,height=450,status=no,scrollbars=YES,menubar=no,toolbar=no,location=no');
}
function recomand(id) {
	mag=open('gestion/recomand.php?id='+id,'mag','width=400,height=460,status=no,scrollbars=YES,menubar=no,toolbar=no,location=no');
}
function del_rec(id) {
	mag=open('../admin/news/del_rec.php?id='+id,'mag','width=300,height=130,status=no,scrollbars=YES,menubar=no,toolbar=no,location=no');
}
function del_link(id, id_topic) {
	mag=open('../admin/news/del_link.php?id='+id+'&id_topic='+id_topic,'mag','width=300,height=130,status=no,scrollbars=YES,menubar=no,toolbar=no,location=no');
}
function relink_ann(id) {
	mag=open('../admin/annonces/classer.php?id='+id,'mag','width=450,height=250,status=no,scrollbars=YES,menubar=no,toolbar=no,location=no');
}
function maj_ann() {
	mag=open('../admin/annonces/maj.php','mag','width=300,height=150,status=no,scrollbars=YES,menubar=no,toolbar=no,location=no');
}
function vider_cache() {
	mag=open('../admin/news/vider_cache.php','mag','width=300,height=150,status=no,scrollbars=YES,menubar=no,toolbar=no,location=no');
}
function ajout_data(t) {
	mag=open('../admin/news/ajout_data.php?t='+t,'mag','width=490,height=560,status=no,scrollbars=YES,menubar=no,toolbar=no,location=no');
}
function ajout_img(t) {
	mag=open('../admin/news/ajout_img.php?t='+t,'mag','width=490,height=360,status=no,scrollbars=YES,menubar=no,toolbar=no,location=no');
}
function ajout_pub(t) {
	mag=open('../admin/news/ajout_pub.php?t='+t,'mag','width=490,height=360,status=no,scrollbars=YES,menubar=no,toolbar=no,location=no');
}
function rafraichir() {
	window.opener.history.go(0);
}
function gotosite(id) {
	if (block_pop == false) {
		var H = (screen.height - 500 ) / 2;
		var L = (screen.width - 650 ) / 2;
		mag=open('gestion/out.php?url_id='+id,'gotosite','width=650,height=500,status=yes,scrollbars=YES,menubar=yes,toolbar=yes,location=yes, resizable=yes,top='+H+',left='+L);
	}
}

function affpage(cat,p) {
	mag=window.location.replace('voircat'+cat+','+p+'.html'); 
}

function ordersite(cat,p,o_sort,o_by) {
	url='voircat'+cat+'\,'+p+'\,'+o_sort+'\,'+o_by+'\.html'; mag=window.location.replace(url);
}

function modif_foot(id) {
	var H = (screen.height - 550 ) / 2;
	var L = (screen.width - 650 ) / 2;
	mag=open('modif_foot.php?cat='+id,'modif_site','width=650,height=550,status=no,scrollbars=no,menubar=no,toolbar=no,location=no, resizable=no,top='+H+',left='+L);
}

function show_da(idcat){
	img="http://www.aquadesign.be/im/logo_annonces.jpg";
	if(idcat>0) 
		document.write("<a href='http://www.depose-annonces.com/petites-"+idcat+".htm' target='_blank'><img src='"+img+"' border=0></a>");
	else  
		document.write("<a href='http://www.depose-annonces.com/' target='_blank'><img src='"+img+"'  border=0></a>");
		document.write("<br>Ce tout nouveau service de depose de petites annonces est <span style='font-weight:bold;color:red;font-size:14px;'>totalement gratuit</span> pour les prochains mois alors profitez en !!!");
}

function show_da2(){
	document.write("<table style='border-top:1px solid orange; background-color:#FFFFCC;'><tr><td valign='top'>");
	document.write("<img src='http://www.aquadesign.be/im/coeurs.gif' align='left'>");
	document.write("</td><td valign='top'><strong>Un nouveau service de petites annonces !</strong><br>");
	document.write("Déjà 200 internautes nous utilisent.<br>");
	document.write("Vous aurez tord de vous priver, <span style='color:#FF0000; font-weight:bold;'>c'est gratuit !</span><br>");
	document.write("Voici l'adresse  du site : <a href='http://www.depose-annonces.com/' class='ads1' target='_blank'>Depose-annonces.com</a>");
	document.write("</td></tr></table>");
}

function ajout_com(id) {
	var H = (screen.height - 280 ) / 2; 
	var L = (screen.width - 450 ) / 2;
	mag=open('ajout_com.php?t='+id,'ajout_com','width=450,height=280,status=no,scrollbars=no,menubar=no,toolbar=no,location=no, resizable=no,top='+H+',left='+L); 
}


function news_mail(id,url) {
	var H = (screen.height - 360 ) / 2;
	var L = (screen.width - 490 ) / 2; 
	mag=open('http://www.aquadesign.be/news/mail.php?id='+id+'&url='+url,'news_mail','width=490,height=360,status=no,scrollbars=no,menubar=no,toolbar=no,location=no, resizable=no,top='+H+',left='+L);
}

/** Recommander la news dans les news du jour **/
var mag ;
function daynews_mail(id) {
	var H = (screen.height - 360 ) / 2;
	var L = (screen.width - 490 ) / 2; 
	mag=open('http://www.aquadesign.be/calendrier/mail.php?id='+id,'daynews_mail','width=490,height=360,status=no,scrollbars=no,menubar=no,toolbar=no,location=no, resizable=no,top='+H+',left='+L);
}



function sendMail(id) {
	
	conn = new Ajax(true) ;	
	conn.appendData("mail",document.mailForm.mail.value) ;
	conn.appendData("mail2",document.mailForm.mail2.value) ;
	conn.appendData("mail3",document.mailForm.mail3.value) ;
	conn.appendData("mail4",document.mailForm.mail4.value) ;
	conn.appendData("msg",document.mailForm.msg.value) ;
	conn.appendData("id",id) ;
	conn.sendAndLoad("http://www.aquadesign.be/calendrier/mail_process.php?" + Math.random(),"POST",sendMailHandler) ;
	
}

function sendMailHandler(conn) {
	eval(conn.responseText) ;
}



/*********************************************/

function news_print(id) {
	var H = (screen.height - 280 ) / 2;
	var L = (screen.width - 450 ) / 2;
	mag=open('http://www.aquadesign.be/news/print.php?id='+id,'ajout_com','width=450,height=280,status=no,scrollbars=no,menubar=no,toolbar=no,location=no, resizable=no,top='+H+',left='+L);
}


function suppc(n) {
	mag=open('gestion/supp.php?cat='+n+'&t=c','mag','width=500,height=300,status=no,scrollbars=YES,menubar=no,toolbar=no,location=no');
}

function validc(n) {
	mag=open('gestion/valid.php?cat='+n+'&t=c','mag','width=500,height=300,status=no,scrollbars=YES,menubar=no,toolbar=no,location=no');
} 

function supps(id) {
	mag=open('gestion/supp.php?id='+id+'&t=s','mag','width=500,height=300,status=no,scrollbars=YES,menubar=no,toolbar=no,location=no');
}

function valids(id,prov) {
	mag=open('gestion/valid.php?id='+id+'&t=s&prov='+prov,'mag','width=500,height=300,status=no,scrollbars=YES,menubar=no,toolbar=no,location=no');
} 

function suppcom(id,id_site,SESSID) {
	mag=open('../gestion/supp.php?id='+id+'&id_site='+id_site+'&t=com','mag','width=500,height=300,status=no,scrollbars=YES,menubar=no,toolbar=no,location=no');
}

function aller(formulaire,cat) { 
	location.href = formulaire.page.options[formulaire.page.selectedIndex].value+"?cat="+cat;
}

function aff(champ) {
	document.getElementById(champ).innerHTML="- Vu";
}

function SelAll (){ 
	for (var i=0;i<document.formu.elements.length;i++){ 
	   var e = document.formu.elements[i]; 
		e.checked = 1; 
		} 
} 

function UnSelAll (){ 
	for (var i=0;i<document.formu.elements.length;i++){ 
		var e = document.formu.elements[i]; 
	   e.checked = 0; 
		} 
} 

function CheckSel(msg){
	for (var i=0;i<document.formu.elements.length;i++)
		if (document.formu.elements[i].checked==1) return true;			
	if (msg!="") alert (msg);
	return false;
}

function InvSelect() { 
	for (var i = 0; i < document.formu.elements.length; i++) { 
	   if(document.formu.elements[i].type == 'checkbox'){ 
		 document.formu.elements[i].checked =!(document.formu.elements[i].checked); 
	   } 
	 } 
} 

function form_del(err_mess){
	if (CheckSel("")){
		centrePop("poplist",400,450);
		document.formu.target="poplist";
		document.formu.action = "gestion/supp.php";
		}
}

function form_move(err_mess){
	if (CheckSel("")){
		centrePop("poplist",400,450);
		document.formu.target="poplist";
		document.formu.action = "gestion/move.php";
		}
}

function form_valid(err_mess){
	if (CheckSel("")){
		centrePop("poplist",400,450);
		document.formu.target="poplist";
		document.formu.action = "gestion/valid.php";
		}
}

function centrePop(name,largeur,hauteur) {
      var gauche = (screen.width - largeur)/2
      var haut =  (screen.height - hauteur)/2
      window.open("",name,"width="+largeur
         +",height="+hauteur+",left="+gauche
         +",top="+haut+",status=no,scrollbars=YES")
}

function ChangeInputURL() {
	if (document.formu.url.disabled==true){
		document.formu.url.disabled=false;
		document.formu.url.value="http://";
	}
	else {
		document.formu.url.disabled=true;
		document.formu.url.value="Note Mode - Pas d'Url";
	}
}

function compter(f) {
	/*max=300;
	min=200;
	var txt=f.des.value;
	var nb=txt.length;
	if (nb>max) { 
		alert("Pas plus de "+max+" caractères dans ce champ");
		f.des.value=txt.substring(0,max);
		nb=max;
	}
	f.nbcar.value=min-nb;
	if(nb<min) f.nbcartext.value="Description trop courte !!! Tapez encore "+f.nbcar.value+" caracteres... ";
	else  f.nbcartext.value="Bravo votre description est suffisament longe :)";*/
}
