function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}



function insereTag(lettre){


	mot=prompt('Ecrivez votre mot :','');
	document.getElementById("22").value+="*"+lettre+"*"+mot+"*/"+lettre+"*";
	
afficheLIVE();


}


function insereL(){

		url=prompt('Ecrivez l\'adresse du lien :','http://www.');
		nm=prompt('Ecrivez le nom du lien (ex: StarMinute):','');
		document.getElementById("22").value+="*L*"+url+"*/A*"+nm+"*/L*";
afficheLIVE();
}


function insere(tag){


document.getElementById("22").value+=tag;
afficheLIVE();
}


function getSel()
{
	var txt = '';
	var foundIn = '';
	if (window.getSelection)
	{
		txt = window.getSelection();
		foundIn = 'window.getSelection()';
		return txt;
	}
	else if (document.getSelection)
	{
		txt = document.getSelection();
		foundIn = 'document.getSelection()';
		return txt;
	}
	else if (document.selection)
	{
		txt = document.selection.createRange().text;
		foundIn = 'document.selection.createRange()';
		return txt;
	}
	else return;
	document.forms[0].selectedtext.value = 'Found in: ' + foundIn + '\n' + txt;
}


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); 
} 
return temp; 
}


	function afficheLIVE(){
	
	var ttr = document.getElementById("titreactu");
	ttr.innerHTML="<a href=''>"+document.getElementById("trr").value+"</a>";
	
	var x = document.getElementById("texteactu");
	
	
	var imageombreLG="<table align='left'><tr><td><div class=\"wrap1\"><div class=\"wrap2\"><div class=\"wrap3\"><img src=\"/images_actu/";			
	var imageombreLD="<table align='right'><tr><td><div class=\"wrap4\"><div class=\"wrap5\"><div class=\"wrap6\"><img src=\"/images_actu/";	
	var imageombreR="</td></tr></table>";
	var alt="\" alt=";
	var cmt="\" style=\"border-width:4px;border-color:FFFFFF;border-style: solid;\"/></div></div></div></td></tr><tr><td align='center' style='font-size:9px;color:#9D0C0C;font-weight: bold;'>";
	
	
	
	
	var tmp;
	
	tmp = document.getElementById("22").value;
	
	tmp = xreplace(tmp,"\n","<br>");
	
	tmp = xreplace(tmp,"*G*","<b>");
	tmp=xreplace(tmp,"*/G*","</b>");
    tmp=xreplace(tmp,"*g*","<b>");
    tmp=xreplace(tmp,"*/g*","</b>");
    
    tmp=xreplace(tmp,"*i*","<i>");
    tmp=xreplace(tmp,"*/i*","</i>");
    tmp=xreplace(tmp,"*I*","<i>");
    tmp=xreplace(tmp,"*/I*","</i>");
    
	tmp = xreplace(tmp,"*Q*","<span class=\"citation\"><b>&laquo;&nbsp;</b>");
	tmp=xreplace(tmp,"*/Q*","<b>&nbsp;&raquo;</b></span>");
    tmp=xreplace(tmp,"*q*","<span class=\"citation\"><b>&laquo;&nbsp;</b>");
    tmp=xreplace(tmp,"*/q*","<b>&nbsp;&raquo;</b></span>");
    
    
    tmp=xreplace(tmp,"*L*","<a href=\"");
    tmp=xreplace(tmp,"*/A*","\"TARGET=\"_blank\">");
    tmp=xreplace(tmp,"*/L*","</a>");
    tmp=xreplace(tmp,"*IC*","<div align='center'><img src='/images_actu/");
    tmp=xreplace(tmp,"*/IC*","'></div>");
    
    tmp=xreplace(tmp,"*IG*",imageombreLG);
    tmp=xreplace(tmp,"*/IG*",imageombreR);
    tmp=xreplace(tmp,"*ID*",imageombreLD);
    tmp=xreplace(tmp,"*/ID*",imageombreR);
    tmp=xreplace(tmp,"*ALT*",alt);
    tmp=xreplace(tmp,"*CMT*",cmt);
	tmp+="<br/><br/><br/>";
    
	
	x.innerHTML=tmp;
	
	}


function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=300,height=200,left = 690,top = 425');");
}

function gras(){

var sel;
sel=getSel();
tm = document.getElementById("22").value;
var remp="*G*"+sel+"*/G*";
tm=tm.replace(sel,remp);
document.getElementById("22").value=tm;
afficheLIVE();
}


function italique(){

var sel;
sel=getSel();
tm = document.getElementById("22").value;
var remp="*I*"+sel+"*/I*";
tm=tm.replace(sel,remp);
document.getElementById("22").value=tm;
afficheLIVE();
}

function cite_texte(){

var sel;
sel=getSel();
tm = document.getElementById("22").value;
var remp="*Q*"+sel+"*/Q*";
tm=tm.replace(sel,remp);
document.getElementById("22").value=tm;
afficheLIVE();
}

function lien(){

var sel;
sel=getSel();
tm = document.getElementById("22").value;
url=prompt('Quel lien dŽsirez-vous ?','http://www.');
var remp="*L*"+url+"*/A*"+sel+"*/L*";
tm=tm.replace(sel,remp);
document.getElementById("22").value=tm;
afficheLIVE();
}


var tag='';




function insereLIVE(montag){


tag=montag;

}


function insereLIVEb(){


var sel;
sel=getSel();
tm = document.getElementById("22").value;

if(tag=="*asprod*"){

url=prompt('Quel lien dŽsirez-vous ?','http://www.');
var remp="*asprod*"+url+"*/A*"+sel+"*/L*";
afficheLIVE();
}
else{
var remp=tag+sel+"*/L*";
afficheLIVE();
}
tm=tm.replace(sel,remp);
document.getElementById("22").value=tm;
afficheLIVE();

}


function redirige(url){


document.write("<SCRIPT LANGUAGE='JAVASCRIPT'>document.location.replace(url);</SCRIPT>");


}

function affichepopup(nomstar,idn, ids){


	dvn = document.getElementById(idn);
	var dv = "<div id='prevenir_mail'><form method='POST' name='ajax' action=''> " + "<b>Vous souhaitez être prévenu(e) par e-mail lorsqu'une news de " + nomstar+ " est publiée sur StarMinute ?</b><br><br>Votre e-mail : <input type='text' style='width:180px;' id='mail"+idn+"'><input type='submit' value='Valider' onClick='submitForm("+ids+","+idn+")'><br><br><center><a href='' onClick'this.style.display=none;'>[ fermer la fenêtre ]</a></center></form></div>";
		
		
	dvn.innerHTML=dv;		



}


function submitForm(ids,idn)
{ 

var mail = document.getElementById("mail"+idn).value;

var req = null; 

		/*document.ajax.dyn.value="Started...";*/
		if(window.XMLHttpRequest)
			req = new XMLHttpRequest(); 
		else if (window.ActiveXObject)
			req  = new ActiveXObject(Microsoft.XMLHTTP); 

		/*req.onreadystatechange = function()
		{ 
			document.ajax.dyn.value="Wait server...";
			if(req.readyState == 4)
			{
				if(req.status == 200)
				{
					document.ajax.dyn.value="Received:" + req.responseText;
				}	
				else	
				{
					document.ajax.dyn.value="Error: returned status code " + req.status + " " + req.statusText;
				}	
			}
		}; */
  req.open( "GET", "addMail.php?ids="+ids+"&mail="+mail, false); 
 /* req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");  */
  req.send(null); 
}



function contactus(from,sujet,message){
	
	
if (window.XMLHttpRequest)                 //  Objet de la fenêtre courant
{ 
    xhr = new XMLHttpRequest();     //  Firefox, Safari, ...
} 
else 
   if (window.ActiveXObject)                    //  Version Active
   {
      xhr = new ActiveXObject("Microsoft.XMLHTTP");   // Internet Explorer 
   }
   
   
   
   
   
   xhr.onreadystatechange  = function()
    { 
         if(xhr.readyState  == 4)
         {
              if(xhr.status  == 200) 
                 return "ok";
              else 
                 return "ko";
         }
    }; 
	
	
	
	var email = "no_reply@castingminute.com";
	
	var nomm = "Contact depuis le site CastingMinute.com";
	
	
	 xhr.open("POST", "/envoimail.php", true);
 	 xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	 var data = "EMAILCMT=" + from  +  "&contenu=" + message+  "&sujet=" + sujet;
     xhr.send(data);
	

	
}




function affichezoom(idphot){


	phot = document.getElementById("zoom"+idphot);
	phot.style.display="block";




}

function masquezoom(idphot){


	phot = document.getElementById("zoom"+idphot);
	phot.style.display="none";




}

function switchavancee(){

	ava = document.getElementById('avance');
	ivi = document.getElementById('recule');

	if(ava.style.display=='none'){
				ava.style.display='block';
				ivi.style.background='#FFF url(/interface/flecheosx.gif) no-repeat';
	}
	else {ava.style.display='none';
	
			ivi.style.background='#FFF url(/interface/flecheosxup.jpg) no-repeat';
	}

}



function validebookstatus(pseudo){








if (window.XMLHttpRequest)                 //  Objet de la fentre courant
{ 
    zhs = new XMLHttpRequest();     //  Firefox, Safari, ...
} 
else 
   if (window.ActiveXObject)                    //  Version Active
   {
      zhs = new ActiveXObject("Microsoft.XMLHTTP");   // Internet Explorer 
   }
   
   
    zhs.onreadystatechange  = function()
    { 
         if(zhs.readyState  == 4)
         {
              if(zhs.status  == 200){ 
                	//var doc = xhr.responseXML;                                             //  Assigner le fichier XML ˆ une variable
					
					//var element = xhr.responseXML.getElementsByTagName('ligne')[0];  //  Lire le premier ŽlŽment avec DOM
					//ir.innerHTML = element.childNodes[0].nodeValue;
			  		//is.innerHTML = zhs.responseText;
					//document.getElementById("wait").style.visibility="hidden";
			  }
					
					//document.ajax.dyn.value= element.firstChild.data;             //  Copier le contenu dans le formulaire
              else{
                 //document.ajax.dyn="Error code " + xhr.status;
				 //is.innerHTML = "<img src='/interface/anonym.jpg' alt=''><br/><b>camille</b>";
			  }
		 }
    };  
	
	
	
	
	
	
	 zhs.open("GET", "/ask4valid.php?pseudo="+pseudo, true);
	 //xhr.setRequestHeader("Content-Type", "text/xml");
	 //xhr.onreadystatechange = callback;
 	 //xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
     zhs.send(null);
	
	//ir.innerHTML = "douga";

	//setTimeout("window.location='http://www.castingminute.com/'",10000); // delai en millisecondes
}


function affichestatusmessage(){

		var iesix = false;
		var strChUserAgent = navigator.userAgent;
		var intSplitStart = strChUserAgent.indexOf("(",0);
		var intSplitEnd = strChUserAgent.indexOf(")",0);
		var strChStart = strChUserAgent.substring(0,intSplitStart);
		var strChMid = strChUserAgent.substring(intSplitStart, intSplitEnd);
		var strChEnd = strChUserAgent.substring(strChEnd);
		
	if(strChMid.indexOf("MSIE 6") != -1){iesix = true;}

	if(!iesix){
		document.getElementById("statusmessage").style.display="block";
		document.getElementById("status").style.height="50px";
	}
}

function masquestatusmessage(){

		var iesix = false;
		var strChUserAgent = navigator.userAgent;
		var intSplitStart = strChUserAgent.indexOf("(",0);
		var intSplitEnd = strChUserAgent.indexOf(")",0);
		var strChStart = strChUserAgent.substring(0,intSplitStart);
		var strChMid = strChUserAgent.substring(intSplitStart, intSplitEnd);
		var strChEnd = strChUserAgent.substring(strChEnd);
		
		
	if(strChMid.indexOf("MSIE 6") != -1){iesix = true;}

	if(!iesix){
		document.getElementById("statusmessage").style.display="none";
		document.getElementById("status").style.height="25px";
	}
}

function remplacestatusmessage(mess){

	document.getElementById("statusmessage").innerHTML=mess;

}

