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) { //v3.0
      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); return x;
		}

function MM_swapImage()
	{ //v3.0
        var ii,jj=0,x,a=MM_swapImage.arguments;
        document.MM_sr=new Array;
        for(ii=0;ii<(a.length-2);ii+=3)
        {
             if ((x=MM_findObj(a[ii]))!=null)
             {
                document.MM_sr[jj++]=x; if(!x.oSrc)x.oSrc=x.src;
                x.src=a[ii+2];
             }
        }
    }
    
function nouvelle_fenetre (Url, NomFenetre, Caracteristiques)
    {
	  window.open(Url, NomFenetre, Caracteristiques);
    }
	
function openPlaya(theURL)
    {
   	  window.open('/player/?id=' + theURL,'Envoi','height=425,width=640,scrollbars=no');
	}

function camOn(theID)
	{
   	  document.images['camera'+theID].src='img/common/picto-regardeleclip.gif';
   	  return false;
	}

function camOff(theID)
    {
      document.images['camera'+theID].src='img/common/picto-regardeleclip-off.gif';
      return false;
    }

    function urlFnac(theLink)
    {
      document.write('<div align="left"><a href="http://www3.fnac.com/search/quick.do?SearchType=QUICKSEARCH&text='+theLink+'&Origin=MCM&OriginClick=yes&category=audio" target="_BLANK"><img src="/images/mcm/top50/panier.gif" width="15" height="16" border="0" alt="J\'achète ce single sur Fnac.com"></a></div>');
    }
	function MM_openBrWindow(theURL,winName,features)
	{ //v2.0
      window.open(theURL,winName,features);
    }
    
//les Hot Spots
function nb_aleatoire(nb)
{
nombre= Math.floor(Math.random() * nb)+1;
}


var lheure="";
var ladate=new Date();
if (ladate.getHours() < 10) {lheure+="0";}
lheure+=ladate.getHours() + ":"
if (ladate.getMinutes() < 10) {lheure+="0";}
lheure+=ladate.getMinutes() + ":"
if (ladate.getSeconds() < 10) {lheure+="0";}
lheure+=ladate.getSeconds()


if((lheure>="06:00:00") && (lheure<="22:00:00")){
	
hotspot = new Array("", "RELOOKING", "RIAD MARRAKECH", "LECTEUR MP3", "RENCONTRE SERIEUSE", "LIVRAISON FLEURS", "CHAUSSURES SPORT", "SEJOUR LINGUISTIQUE", "FORMATION CONTINUE", "LOCATION VOITURE", "IMPRIMANTE MULTIFONCTION", "DVD VIERGE", "BIEN ETRE", "REMISE FORME", "FITNESS", "VOL DEGRIFFE", "APPAREIL PHOTO NUMERQIUE", "JEU VIDEO", "CONSOLE", "SONNERIE PORTABLE", "PC PORTABLE", "ACCESSOIRE MODE", "HOME CINEMA", "ENCEINTE HOME CINEMA", "BD", "COURS PARTICULIERS", "SOUTIENS SCOLAIRE", "APPRENDRE ANGLAIS", "STAGE/JOB");

}else{
	
hotspot = new Array("", "GODE", "EROTIQUE", "PORNO", "SEXE", "LUBRIFIANT", "VIBROMASSEUR", "GAY", "SEXTOY", "GUEPIERE", "PORTE-JARRETELLE", "STRING", "WEBCAM CHAT", "LINGERIE", "RELOOKING", "RIAD MARRAKECH", "LECTEUR MP3", "RENCONTRE SERIEUSE", "LIVRAISON FLEURS", "CHAUSSURES SPORT", "SEJOUR LINGUISTIQUE", "FORMATION CONTINUE", "LOCATION VOITURE", "IMPRIMANTE MULTIFONCTION", "DVD VIERGE", "BIEN ETRE", "REMISE FORME", "FITNESS", "VOL DEGRIFFE", "APPAREIL PHOTO NUMERQIUE", "JEU VIDEO", "CONSOLE", "SONNERIE PORTABLE", "PC PORTABLE", "ACCESSOIRE MODE", "HOME CINEMA", "ENCEINTE HOME CINEMA", "BD", "COURS PARTICULIERS", "SOUTIENS SCOLAIRE", "APPRENDRE ANGLAIS", "STAGE/JOB");	

}
tirage = new Array;
nombres=""
nb= 6

function mot()
{
for (i=1 ;i<nb ;i++)
{
	if((lheure>="06:00:00") && (lheure<="22:00:00")){
nb_aleatoire(28);
	}else{
nb_aleatoire(41);		
	}
tirage[i]= nombre;
for (t=1 ; t<i ;t++){
if (tirage[t]==nombre) 
{
i=i-1;
} 
}
}
for (i=1 ;i<nb ;i++)
{
nombres=nombres+tirage[i];
}
longueur=hotspot[tirage[1]].length + hotspot[tirage[2]].length + hotspot[tirage[3]].length + hotspot[tirage[4]].length + hotspot[tirage[5]].length;
if(longueur>="55"){
	mot();	
}
}

startList = function() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("sousnav");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}

function check()
{
	if(document.form1.ou[1].checked == false){
		return true;
	}else{
		return false;
	}
	
}

function overture()
{
	
	if( check() == true ){
		
		document.form1.submit();
		
	}else{
		
		window.open('http://fr.search.yahoo.com/search?p='+document.form1.Keywords.value+'&ei=ISO-8859-1&fr=cb-mcm&meta=vl%3D');
		
	}
	
}

	function urlencode(ch) {
	   ch = ch.replace(/[ ]/g,"+") 
	   return escape(ch) 
	}
	


function submit_meetic(){
	
	var url = "http://meetic.mcm.net/search/result_v.php?post=1&prof_sexe="+document.meetic_search.prof_sexe.value+"&rech_sexe="+document.meetic_search.rech_sexe.value+"&mtcmk="+document.meetic_search.mtcmk.value+"&rech_photo=1&rech_region=FR";
	var encodedurl = urlencode(url);
	document.location.href = 'http://www.smartadserver.com/call/cliccommand/931445/[timestamp]?'+encodedurl;
	
}
