//fonction verification validite champ de recherche

function checkSearch() {
	if(document.getElementById("keyw").value == "Que cherchez-vous ?" || document.getElementById("keyw").value == "") {
		return false;
	}
	else {
		return true;
	}
}

function img_aleatoire(rep){
	
	var nb_photo = 6;
	nombre= Math.floor(Math.random() * nb_photo)+1;
	
	document.write("<img src='../images/pv7/"+rep+"/i"+nombre+".jpg' alt='' />");
}

function ho_me_pa(){
	document.getElementById("ho_me_pa").style.display = "block";
	document.getElementById("ho_me_lpa").className = "ho_me_lpa2";
}

function ho_me_x(){
	document.getElementById("ho_me_pa").style.display = "none";
	document.getElementById("ho_me_lpa").className = "ho_me_lpa";
	
}

function ho_me_i(){
	document.getElementById("ho_me_pa").style.display = "none";
	document.getElementById("ho_me_lpa").className = "ho_me_lpa";
	window.open("popinternet", "internet", "toolbar=no, directories=no, menubar=no, location=no, status=no, scrollbars=no, resizable=no, width=275, height=120");

	
}

function ho_me_t(){
	document.getElementById("ho_me_pa").style.display = "none";
	document.getElementById("ho_me_lpa").className = "ho_me_lpa";
	window.open("popinternet", "internet", "toolbar=no, directories=no, menubar=no, location=no, status=no, scrollbars=no, resizable=no, width=275, height=120");
	
}

function correctPNG() // correctly handle PNG transparency in Win IE 5.5 & 6.
{
   var arVersion = navigator.appVersion.split("MSIE")
   var version = parseFloat(arVersion[1])
   if ((version >= 5.5) && (document.body.filters)) 
   {
      for(var i=0; i<document.images.length; i++)
      {
         var img = document.images[i]
         var imgName = img.src.toUpperCase()
         if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
         {
            var imgID = (img.id) ? "id='" + img.id + "' " : ""
            var imgClass = (img.className) ? "class='" + img.className + "' " : ""
            var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
            var imgStyle = "display:inline-block;" + img.style.cssText 
            if (img.align == "left") imgStyle = "float:left;" + imgStyle
            if (img.align == "right") imgStyle = "float:right;" + imgStyle
            if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
            var strNewHTML = "<span " + imgID + imgClass + imgTitle
            + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
            + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
            + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
            img.outerHTML = strNewHTML
            i = i-1
         }
      }
   }    
}

// fonction pour savoir si un nombre est pair ou impair
function pair(nombre)
{
   return ((nombre-1)%2);
}



function over(id) {
document.getElementById(id+'1').className = "yotest";
document.getElementById(id+'2').className = "yotest2";
document.getElementById(id+'3').className = "yotest2";
document.getElementById(id+'4').className = "yotest2";
}

function out(id) {
document.getElementById(id+'1').className = "ho_dr_lt";
document.getElementById(id+'2').className = "ho_dr_lst";
document.getElementById(id+'3').className = "ho_dr_lst";
document.getElementById(id+'4').className = "ho_dr_lst";
}



function over2(id) {
document.getElementById(id+'1').className = "wcm_l2";
document.getElementById(id+'2').className = "wcm_l2";
}

function out2(id) {
document.getElementById(id+'1').className = "wcm_l";
document.getElementById(id+'2').className = "wcm_l";
}


function over3(id) {
document.getElementById(id).className = id+"onhover";
}

function out3(id) {
document.getElementById(id).className = id;
}


