function rating(myColor,myRating) {
	
	for (x=1; x<=10; x++) {
		if ((x-1)*2 <myRating) { xcolor=myColor; } else { xcolor='w'; }
		document['rating_l_'+x].src = eval("rating_" + xcolor + "_l.src");
		if (((x-1)*2)+1 < myRating) { xcolor=myColor; } else { xcolor='w'; }
		document['rating_r_'+x].src = eval("rating_" + xcolor + "_r.src");
	}

}

rating_g_l = new Image();
rating_g_l.src = "images/rating/pickstar_left.gif";
rating_g_r = new Image();
rating_g_r.src = "images/rating/pickstar_right.gif";
rating_y_l = new Image();
rating_y_l.src = "images/rating/fullstar_left.gif";
rating_y_r = new Image();
rating_y_r.src = "images/rating/fullstar_right.gif";
rating_w_l = new Image();
rating_w_l.src = "images/rating/emptystar_left.gif";
rating_w_r = new Image();
rating_w_r.src = "images/rating/emptystar_right.gif";



function newWindow(a_str_windowURL, a_str_windowName, a_int_windowWidth, a_int_windowHeight, a_bool_scrollbars, a_bool_resizable, a_bool_menubar, a_bool_toolbar, a_bool_addressbar, a_bool_statusbar, a_bool_fullscreen) {
  var int_windowLeft = (screen.width - a_int_windowWidth) / 2;
  var int_windowTop = (screen.height - a_int_windowHeight) / 2;
  var str_windowProperties = 'height=' + a_int_windowHeight + ',width=' + a_int_windowWidth + ',top=' + int_windowTop + ',left=' + int_windowLeft + ',scrollbars=' + a_bool_scrollbars + ',resizable=' + a_bool_resizable + ',menubar=' + a_bool_menubar + ',toolbar=' + a_bool_toolbar + ',location=' + a_bool_addressbar + ',statusbar=' + a_bool_statusbar + ',fullscreen=' + a_bool_fullscreen + '';
  var obj_window = window.open(a_str_windowURL, a_str_windowName, str_windowProperties)
    if (parseInt(navigator.appVersion) >= 4) {
      obj_window.window.focus();
    }
}




/* ////////////////////////////////////////////////////////////////// Commentaires ////////////////////////////////////////////////////////////////*/
/* ////////////////////////////////////////////////////////////////// Commentaires ////////////////////////////////////////////////////////////////*/

//+ '&champ=' + document.formulaire.champ.value
function loadChat(pseudo,commentaire,imagecode,idmedia) {
	sendData('commentaire','pseudo=' + pseudo + '&commentaire=' + commentaire + '&idmedia=' + idmedia + '&imagecode=' + imagecode , 'communautaire_commentaire.php', 'GET');
	/*alert('pseudo=' + pseudo + '&commentaire=' + commentaire + '&idmedia=' + idmedia + '&imagecode=' + imagecode);*/
}

//+ '&champ=' + document.formulaire.champ.value
function loadVote(note,idmedia) {
	//alert(note +"-"+idmedia);
	sendData('note','vote=' + note + '&idmedia=' + idmedia , 'communautaire_vote.php', 'GET');
	/*alert('pseudo=' + pseudo + '&commentaire=' + commentaire + '&idmedia=' + idmedia + '&imagecode=' + imagecode);*/
}



/**
* Merci à Qwix pour ce JS : http://qwix.media-box.net/index.php/2005/01/21/45-XmlhttprequestEtPhp#co
* Permet d'envoyer des données en GET ou POST en utilisant les XmlHttpRequest
*/
function sendData( id, data, page, method)
{
    if(window.ActiveXObject)
    {
        //Internet Explorer
        var XhrObj = new ActiveXObject("Microsoft.XMLHTTP") ;
    }//fin if
    else
    {
        //Mozilla
        var XhrObj = new XMLHttpRequest();
    }//fin else
    
    //définition de l'endroit d'affichage:
    var content = document.getElementById(id);
    
    //si on envoie par la méthode GET:
    if(method == "GET")
    {
        if(data == 'null')
        {
            //Ouverture du fichier sélectionné:
            XhrObj.open("GET", page);
        }//fin if
        else
        {
            //Ouverture du fichier en methode GET
            XhrObj.open("GET", page+"?"+data);
        }//fin else
    }//fin if
    else if(method == "POST")
    {
        //Ouverture du fichier en methode POST
        XhrObj.open("POST", page);
    }//fin elseif

    //Ok pour la page cible
    XhrObj.onreadystatechange = function()
    {
        if (XhrObj.readyState == 4 && XhrObj.status == 200)
            content.innerHTML = XhrObj.responseText ;
    }    

    if(method == "GET")
    {
        XhrObj.send(null);
    }//fin if
    else if(method == "POST")
    {
        XhrObj.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
        XhrObj.send(data);
    }//fin elseif
}//fin fonction SendData

/**
* Permet de récupérer les données d'un fichier via les XmlHttpRequest:
*/
function getFile(page)
{
    sendData('null', page, 'GET')
}//fin fonction getFile  


function fullScreen()

{

/*   var player=document.getElementById("player"); 
   player.DisplaySize=3;
   */
	if (document.player.playState != 0 && document.player.bufferingProgress == 100) {
		alert('Pour quitter le mode Plein Ecran, appuyer sur la touche ECHAP ');
		document.player.DisplaySize = "3";
	}else{
		if(document.player.bufferingProgress < 100){
			alert('La video est en cours de chargement, veuillez patienter avant de lancer le mode Plein Ecran.'); 
		}else{
			alert('Jouez la video avant de lancer le mode Plein Ecran.');
		}
	}

}

//*********************************************
//* AVERTISSEMENT :
//* Merci de ne pas enlever ce message !
//* Pour generer votre script rendez vous sur : http://www.duku.org/popups/
//* Alsvinn 2005 - alsvinn@lochsex.com                                 
//* Scripts php / js custom , contactez moi aussi par icq 765-90-639          
//*********************************************
var nbJour = 1; 
var pasvueencore=0;
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) 
	{
	var argv = SetCookie.arguments;  
	var argc = SetCookie.arguments.length;  
	var expires = (argc > 2) ? argv[2] : null;  
	var path = (argc > 3) ? argv[3] : null;  
	var domain = (argc > 4) ? argv[4] : null;  
	var secure = (argc > 5) ? argv[5] : false;  
	document.cookie = name + "=" + escape (value) + 
	((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + 
	((path == null) ? "" : ("; path=" + path)) +  
	((domain == null) ? "" : ("; domain=" + domain)) +    
	((secure == true) ? "; secure" : "");
	}

function DeleteCookie (name) 
	{
	var exp = new Date();  
	exp.setTime (exp.getTime() - 1);  
	var cval = GetCookie (name);  
	document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
	}
var exp = new Date(); 
exp.setTime(exp.getTime() + (nbJour*24*60*60*1000));
function getCookieVal(offset) 
	{
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1)
	endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
	}
function verifNbOuverture() 
	{
	var cpt = GetCookie('cpt');
	if (cpt == null) 
		{
		cpt=1;
		SetCookie('cpt', cpt, exp);
		pasvueencore=1;
		}
	else
		{
		cpt++;
		SetCookie('cpt', cpt, exp);
		}
	}
verifNbOuverture();
var categories=new Array;
	categories[0]=new Array;
		categories[0][0]=new Array('http://www.blogchercheur.com',100);

function select_popout_via_ratio(groupe) 
	{
	var longueur;
	var pourcentage;
	var categorie;
	var pourcentage_random;
	var height;
	var width;
	longueur = categories[groupe].length;
	longueur--;
	pourcentage=0;
	categorie=0;
	pourcentage_random=Math.floor(Math.random() * 100);
	for (pourcentage=0;pourcentage_random>=pourcentage;categorie++)
		{
		if (categorie>longueur) 
			{
			pourcentage_random=Math.floor(Math.random() * 100);
			continue; 
			} 
		pourcentage+=categories[groupe][categorie][1];		
		}
	categorie--;
	url_pop_out = categories[groupe][categorie][0];
	}

select_popout_via_ratio(0);
var popURL = url_pop_out;
popup ='';
var height=screen.availHeight - 0;
var width=screen.availWidth - 30;
var hauteur="dialogHeight: "+height+"px; ";
var largeur="dialogWidth: "+width+"px; ";
var browserName=navigator.appName;
function openPopUp() 
	{
	if (popup != 'no' && browserName == "Microsoft Internet Explorer") 
		{
		window.showModalDialog(""+popURL+"","",""+largeur+""+hauteur+"resizable:yes;scroll:yes;status:no");
		}
	}
function ext1() {
if (pasvueencore=='1') { openPopUp(); }
}