function OpenWin(url,name, w, h)
{
	  var szParams = "toolbar=no,,width=" + w + ",height=" + h + ",scrollbars=yes,location=no,directories=no,status=yes,menubar=no,resizable=yes"
	  win = window.open(url,name, szParams);
	  win.focus();
} 

function OpenWinTools(url,name, w, h)
{
	  var szParams = "toolbar=yes,,width=" + w + ",height=" + h + ",scrollbars=yes,location=no,directories=no,status=yes,menubar=yes,resizable=yes"
	  win = window.open(url,name, szParams);
	  win.focus();
} 


function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}





function validrechform(){
	if (document.frech.r.value!=""){
		document.frech.submit();
	}		
}
function validrechform2(){
	if (document.frech2.r.value!=""){
		document.frech2.submit();
	}		
}


function openWindowoozoo(theURL,winName,features) { 
  var fen=window.open(theURL,winName,features+'width=800,height=585,left=0,top=0,scrollbars=yes,menubars=no,toolbars=yes,resizable=yes');
}



		//<!-- Cookies-->
	
	function getCookieVal (offset) {
  		var endstr = document.cookie.indexOf (";", offset);
  		if (endstr == -1)endstr = document.cookie.length;
  		return unescape(document.cookie.substring(offset, endstr));
	}
	
	function FixCookieDate (date) {
  		var base = new Date(0);
  		var skew = base.getTime();
  		if (skew > 0) date.setTime (date.getTime() - skew);
		}
	
	function GetCookie (name) {
  		var arg = name + "="; var alen = arg.length; var clen = document.cookie.length; var i = 0;
  		while (i < clen) {
   	 		var j = i + alen;
    		if (document.cookie.substring(i, j) == arg)
      		return getCookieVal (j);
    		i = document.cookie.indexOf(" ", i) + 1;
    		if (i == 0) break; 
  		}
  		return null;
	}
	
	function SetCookie (name,value,expires,path,domain,secure) {
  		document.cookie = name + "=" + escape (value) +	((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") +    ((secure) ? "; secure" : ""); }

		
	function DeleteCookie (name,path,domain) {
  		if (GetCookie(name)) {
		   	document.cookie = name + "=" + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + "; expires=Thu, 01-Jan-70 00:00:01 GMT";
	  	}
	}	
	//<!-- fin cookies-->
	
	
	
	
	// ******************** popup image *************		 	
	picto="";
	function AffImage(pictureposter,legende){
		picto = pictureposter;
		wi=400;
		hi=400;
		titre="Poster";
		legendetex=legende;
		stats="toolbar=no,location=no,directories=no,status=no,menubar=no," ;
		stats += "resizable=yes,width=" + wi + ",height="+hi ;
		imgwin = window.open ("",titre,stats);
		window.setTimeout("makepage(picto,legendetex)",100) ;
	}
	
	function makepage(pic,legendetexx){
	legendetexxx=legendetexx;
	if (legendetexxx=="") espace=0;
	else espace=85;
		imgwin.document.clear();
		imgwin.document.write("<head><title>Photo</title>");
		imgwin.document.write("<s"+"cript language='Java"+"Script'>function resizeme(){picheight=document.images['posterpic'].height;picwidth=document.images['posterpic'].width;this.window.resizeTo(picwidth+40,picheight+60+"+espace+");}<"+"/s"+"cript>");
		imgwin.document.write("</head><body bgcolor='Black' text='White' onload='window.setTimeout(\"resizeme();\",100);'><center><table><tr><td>");
		imgwin.document.write("<img name='posterpic' align='absmiddle' src='"+pic+"' border='0' alt=''>");
		imgwin.document.write("</td></tr><tr><td><center><font face='Verdana,Geneva,Arial,Helvetica,sans-serif' size='1'>"+legendetexxx+"</font></center></td></tr></table></center></body>");
		imgwin.document.close();
		imgwin.focus();
	}

/*
* Protection des adresses email par génération en javascript
*/
	function protectMail(nom,domaine,classCss) {
		mail = nom;
		mail += "@";
		mail += domaine;
		document.write("<a href=\"mailto:" + mail + "\" id=\"" + classCss + "\">" + mail + "</a>");
	}
	
	
function validrechform_y(){

	if (document.frech.mot.value!=""){ 
		var lapagerec='';
		var lemode='';
		if(document.frech.surr[1].checked==true){ 
			win = window.open('http://fr.search.yahoo.com/search?ei=ISO-8859-1&fr=cb-eve&meta=vl%3D&p='+document.frech.mot.value,'yahoo',''); 
			win.focus(); 
			                               
			}else{ 
				canal=document.frech.recherchedans.options[document.frech.recherchedans.selectedIndex].value;
				//alert(canal);
				lew=document.frech.mot.value;
				lew=lew.replace(/%20/g,' ');
				
				lew=xreplace(lew,'%20',' ');
				lew=xreplace(lew,' ','-');
				lew=xreplace(lew,'+','-');
				lew=xreplace(lew,'/','-');
				
				lew=xreplace(lew,'--','-');
				lew=xreplace(lew,'--','-');
								
				
				switch(canal){
					case '0' : 
						lapagerec='/tout/';
						lemode='';
						break;
					case '1' : 
						lapagerec='/celebre/tout/';
						lemode='';
						break;
					case '2' : 
						lapagerec='/citations/mot.php';
						lemode='?mot=';
						break;
					case '3' : 
						lapagerec='/livres/tout/';
						lemode='';
						break;
					case '4' : 
						lapagerec='/culture/tout/';
						lemode='';
						break;
					case '5' : 
						lapagerec='/lieux/tout/';
						lemode='';
						break;
					case '6' : 
						lapagerec='/cadeaux/tout/';
						lemode='';
						break;
					case '7' : 
						lapagerec='/forum/tout/';
						lemode='';
						break;
					default : 
						lapagerec='/tout/';
						lemode='';
						break;
				}	
				//document.frech.submit(); 
				urlax=''+lapagerec+lemode+lew;
				window.location.href=urlax;
			} 
			
			
		}   
	return false;   
} 
                   
 
function xreplace(checkMe,toberep,repwith){
	var temp = checkMe;
	var i = temp.indexOf(toberep);
	while(i > -1){
	temp = temp.replace(toberep, repwith);
	i = temp.indexOf(toberep, i + repwith.length + 1);
	}
	return temp;
}



function retourne_phrase(phrase) {
  return phrase.split('').reverse().join('');
}



function untefluchte(letruc){
var ouonva = mentezur(letruc);
//ouonva = unescape(ouonva);
ouonva = retourne_phrase(ouonva);
	top.location.href=ouonva;
}

function untefluchtepop(letruc,w,h){
var ouonva = mentezur(letruc);
//ouonva = unescape(ouonva);
ouonva = retourne_phrase(ouonva);
	OpenWin(ouonva,'open',w,h);
}


function mentezur(monurl){

MtagPartnerTag = 'op8#0qr:stxyEFYZ.-/?7zaR)ST9UV_WXbcdeuvwfghijkl&456mnG+HIJKL%123=MNOPQA(BCD';
evAllowedChar = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890:.-/?&%+_=#()';

var lachaineatester=monurl;
var lalongueur=monurl.length;
var cequejetest="";;
var oucest=0;
var cadevientquoi="";
var manouvelle="";

	for (i=0;i<lalongueur;i++){
		cequejetest = lachaineatester.charAt(i);
		oucest = MtagPartnerTag.indexOf(cequejetest);
		cadevientquoi = evAllowedChar.charAt(oucest);
		manouvelle=manouvelle+cadevientquoi;
		cequejetest = "";
		oucest = 0;
		cadevientquoi="";
	}

return manouvelle;

}
