
function getConnect()
{
	var texte = new String(document.getElementById('inner').innerHTML);
	var recherche = '::compteur::';
	resultat = texte.search(recherche);
	
	var xhr_object = null;
	var url = "compteur.php?rand="+Math.random();
	var refreshdiv = "refresh_vote";
	if(window.XMLHttpRequest) xhr_object = new XMLHttpRequest();
	else
	if (window.ActiveXObject) xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
	
	xhr_object.open("GET", url, true);
	xhr_object.onreadystatechange = function()
	{
		if ( xhr_object.readyState == 4 )
		{
			texte = texte.replace("::compteur::",xhr_object.responseText); 
			document.getElementById('inner').innerHTML = texte;
		}
		else
		{
		}
	}
	xhr_object.send(null);
	
}


function reloadLinkAccueil()
{
	var xhr_object = null;
	var url = "reloadLinkAccueil.php?rand="+Math.random();
	var refreshdiv = "reloadLinkAccueil";
	if(window.XMLHttpRequest) xhr_object = new XMLHttpRequest();
	else
	if (window.ActiveXObject) xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
	
	xhr_object.open("GET", url, true);
	xhr_object.onreadystatechange = function()
	{
		if ( xhr_object.readyState == 4 )
		{
			document.getElementById(refreshdiv).innerHTML = xhr_object.responseText;
			 firstAuto();
		}
		else
		{
			document.getElementById(refreshdiv).innerHTML = 'Veuillez Patienter';
		}
	}
	xhr_object.send(null);
	
}


function BigVidzLink2(id,idRefresh)
{
	var xhr_object = null;
	var url = "testConnexionMembreBigvidz_link2.php?id="+id+"&rand="+Math.random();
	var position = "webtvReload";
	
	if(window.XMLHttpRequest) xhr_object = new XMLHttpRequest();
	else
	if (window.ActiveXObject) xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
	
	xhr_object.open("GET", url, true);
	xhr_object.onreadystatechange = function()
	{
		if ( xhr_object.readyState == 4 )
		{
			document.getElementById(idRefresh).innerHTML = xhr_object.responseText;
		}
		else
		{
			document.getElementById(idRefresh).innerHTML = 'Veuillez Patienter';
		}
	}
	xhr_object.send(null);	
}





function BigVidzThumbs(id,idRefresh)
{
	var xhr_object = null;
	var url = "testConnexionBigVidzThumb.php?id="+id+"&rand="+Math.random();
	var position = "webtvReload";
	
	if(window.XMLHttpRequest) xhr_object = new XMLHttpRequest();
	else
	if (window.ActiveXObject) xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
	
	xhr_object.open("GET", url, true);
	xhr_object.onreadystatechange = function()
	{
		if ( xhr_object.readyState == 4 )
		{
			document.getElementById(idRefresh).innerHTML = xhr_object.responseText;
		}
		else
		{
			document.getElementById(idRefresh).innerHTML = 'Veuillez Patienter';
		}
	}
	xhr_object.send(null);	
}



function BigVidzAccueil(id)
{
	var xhr_object = null;
	var url = "testConnexionMembreBigVidzAccueil.php?id="+id+"&rand="+Math.random();
	var position = "webtvReload";
	
	if(window.XMLHttpRequest) xhr_object = new XMLHttpRequest();
	else
	if (window.ActiveXObject) xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
	
	xhr_object.open("GET", url, true);
	xhr_object.onreadystatechange = function()
	{
		if ( xhr_object.readyState == 4 )
		{
			document.getElementById('_bigvidz_'+id).innerHTML = xhr_object.responseText;
		}
		else
		{
			document.getElementById('_bigvidz_'+id).innerHTML = 'Veuillez Patienter';
		}
	}
	xhr_object.send(null);	
}





function testConnexionWebTvs(chaine,categ_id)
{

	var xhr_object = null;
	var url = "testConnexionWebTvs.php?chaine="+chaine+"&categ_id="+categ_id+"&rand="+Math.random();
	var position = "webtvReload";
	
	if(window.XMLHttpRequest) xhr_object = new XMLHttpRequest();
	else
	if (window.ActiveXObject) xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
	
	xhr_object.open("GET", url, true);
	xhr_object.onreadystatechange = function()
	{
		if ( xhr_object.readyState == 4 )
		{
			document.getElementById(position).innerHTML = xhr_object.responseText;
		}
		else
		{
			document.getElementById(position).innerHTML = 'Veuillez Patienter';
		}
	}
	xhr_object.send(null);	
}



function testConnexionUser()
{

	var xhr_object = null;
	var url = "testConnexionMembre.php?rand="+Math.random();
	var position = "connexionMembre";
	
	if(window.XMLHttpRequest) xhr_object = new XMLHttpRequest();
	else
	if (window.ActiveXObject) xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
	
	xhr_object.open("GET", url, true);
	xhr_object.onreadystatechange = function()
	{
		if ( xhr_object.readyState == 4 )
		{
			document.getElementById(position).innerHTML = xhr_object.responseText;
			if(xhr_object.responseText != '')
			{
				// si l'user est connecté on masque le bouton de loggin dans le header
				document.getElementById('header_loggin_Style2').innerHTML = '';				
			}
		}
		else
		{
			document.getElementById(position).innerHTML = '';
		}
	}
	xhr_object.send(null);	
}



function testConnexionUserBigVidz(id)
{

	var xhr_object = null;
	var url = "testConnexionMembreBigvidz.php?id="+id+"rand="+Math.random();
	var position = 'video_'+id;
	
	if(window.XMLHttpRequest) xhr_object = new XMLHttpRequest();
	else
	if (window.ActiveXObject) xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
	
	xhr_object.open("GET", url, true);
	xhr_object.onreadystatechange = function()
	{
		if ( xhr_object.readyState == 4 )
		{
			document.getElementById(position).innerHTML = xhr_object.responseText;
		}
		else
		{
			document.getElementById(position).innerHTML = '';
		}
	}
	xhr_object.send(null);	
}



function testConnexionUserPageVideo(id)
{

	var xhr_object = null;
	var url = "testConnexionMembrePageVideo.php?id="+id+"rand="+Math.random();
	var position = 'boutonTelecharger';
	
	if(window.XMLHttpRequest) xhr_object = new XMLHttpRequest();
	else
	if (window.ActiveXObject) xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
	
	xhr_object.open("GET", url, true);
	xhr_object.onreadystatechange = function()
	{
		if ( xhr_object.readyState == 4 )
		{
			document.getElementById(position).innerHTML = xhr_object.responseText;
		}
		else
		{
			document.getElementById(position).innerHTML = '';
		}
	}
	xhr_object.send(null);	
}



// verification du formulaire de loggin
function formloggin()
{
	var erreur = false;
	var msg = '';
	if(document.formulaire_loggin.loggin.value == '') { erreur = true; msg += "Sans ton pseudo tu ne peut pas te logguer !\r\n" } 
	if(document.formulaire_loggin.password.value == '') { erreur = true; msg += "Sans ton mot de passe tu ne peut pas te logguer !\r\n" } 
	
	if(erreur == true)
	{
		alert(msg);
		return false;
	}
	else
	{
		return true;
	}

}



function sendVisitoAt(url)
{
	document.location = url;
}









/* ------------------------ wendise :  Missgald/Mesvip ------------------------------------- */

function writeframe()
{
	
}


function writewendise(trs)
{
	txt = '<script type="text/javascript" language="JavaScript"';
	txt += 'src="http://mb.archivesexy.com/?module=archivesexy&go=promo&promo=last&nb_lines=9';
	txt += '&nb_columns=1&size_th=250&doc_id=2102&target_win=popup&popup_width=100';
	txt += '&popup_width_type=pourcent&popup_height=100&popup_height_type=pourcent&date_txt=date_txt';
	txt += '&color_txt=%230000FF&face_txt=Arial"></script>';
	document.write(txt);
}


function writewendiseVideo()
{
	var url = '';
	var pct = 50; // pourcentage
	var rand = Math.random()*100;
	rand = Math.round(rand);
	/*
	if(rand<=pct)
	{
		url = 'http://mb.archivesexy.com/?go=pdp&docid=1214';
	}
	else
	{
		url = 'http://mb.wendise.com/pdv/pid-newworldsex/tid-mesvip2-large/cat-0/sexe.html';
	}
	*/
	url = 'http://mb.wendise.com/pdv/pid-newworldsex/tid-mesvip2-large/cat-0/sexe.html';
	
	document.write('<iframe src="'+url+'" width="100%" height="3000" frameborder="0" marginheight="0" marginwidth="0" scrolling="no"></iframe>');
	
}




/* ----------- Volume des players -------------- require coockie.js */

function MemoriseVolumePlayers(volume)
{
	Set_Cookie('MesvipVolumePlayersP_Vidz', volume, 1, '/');
}

function RestaureVolumePlayers()
{
	var volume = Get_Cookie('MesvipVolumePlayersP_Vidz');
	return volume;
}

/* ------------------------ */

function openLive()
{
	window.open('http://webcams.cocottes.com/');
}

/*- ------------------ on affiche le compteur missglad ----------------- */
function write_compteur()
{
	 document.write("<script language='javascript' type='text/javascript' src='http://604.stats.misstrends.com/stats/code.php?3643,1,"+document.referrer+"'></script>");
}

/*------------- player sur les pages de vidéos --------------------- */


function display_player(swf,url,id_video,starring,vidsize,countme)
{
	var volume = RestaureVolumePlayers();
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="450" height="350" id="fullscreen_flash" align="left">');
	document.write('<param name="movie" value="flashplayer/'+swf+'?video='+url+'&id_video='+id_video+'&starring='+starring+'&vidzsize='+vidsize+'&countme='+countme+'&StartVolume='+volume+'" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param id="allowFullScreen" name="allowFullScreen" value="true" />');
	document.write('<param name="bgcolor" value="#000000" />');
	document.write('<embed id="embed" src="flashplayer/'+swf+'?video='+url+'&id_video='+id_video+'&starring='+starring+'&vidzsize='+vidsize+'&countme='+countme+'&StartVolume='+volume+'"');
	document.write(' allowfullscreen="true" quality="high" bgcolor="#000000" width="450" height="350" name="fullscreen_flash" align="middle" ');
	document.write(' type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');
	
}


function display_playerErreur(swf)
{
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="450" height="350" id="fullscreen_flash" align="left">');
	document.write('<param name="movie" value="flashplayer/'+swf+'" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param id="allowFullScreen" name="allowFullScreen" value="true" />');
	document.write('<param name="bgcolor" value="#000000" />');
	document.write('<embed id="embed" src="flashplayer/'+swf+'"');
	document.write(' allowfullscreen="true" quality="high" bgcolor="#000000" width="450" height="350" name="fullscreen_flash" align="middle" ');
	document.write(' type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');
}


function popup_mail()
{
	window.open('getemail.php','email','toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=no,width=440,height=450,top=230,left=440');
	//document.write('sdfsdfsdfsdsdf');
}

/*------------------ POPUP PROPOSER UNE ACTRICE --------------------------*/

function propose_actrices(actrice)
{
	window.open('propose_actrices.php?actrice='+actrice,'email','toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=no,width=540,height=500,top=230,left=440');
}






/*------------------ POPUP EMAILS --------------------------*/

function popup_mail()
{
	window.open('getemail.php','email','toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=no,width=440,height=300,top=230,left=440');
}


/*------------- MOVE TO RESIZE TO ------------------*/

if (self != top) {top.location=self.location;}
self.moveTo(0,0)
self.resizeTo(screen.availWidth,screen.availHeight)
self.focus();




/*------------------ AFFICHER LES FLASH SANS LES POINTILLETS --------------------------*/

function RunFoo(swf, hauteur, largeur, couleur, nom)
{
	document.write("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width=\""+hauteur+"\" height=\""+largeur+"\" id=\""+nom+"\" align=\"middle\">\n");
	document.write("<param name=\"allowScriptAccess\" value=\"sameDomain\" />\n");
	document.write("<param name=\"movie\" value=\""+swf+"\" /><param name=\"quality\" value=\"high\" /><param name=\"bgcolor\" value=\""+couleur+"\" /><embed src=\""+swf+"\" quality=\"high\" bgcolor=\""+couleur+"\" width=\""+hauteur+"\" height=\""+largeur+"\" name=\""+nom+"\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />\n");
	document.write("</object>\n");
}






/*------------------ RECHERCHE LES VIDEOS DANS LE PLAYER --------------------------*/

function ReloadPlayer(fichier,id,visites,starring,num_boucle)
{

	var xhr_object = null;
	var url = 'http://www.mesvip.com/lxplayer2/videoFrame.php?video='+fichier+'&width=450&height=338&idMovie='+id+'&domain=accueil';
	//var url = "flashplayer/reload.php?flv="+fichier+"&id_video="+id+"&visites="+visites+"&starring="+starring+"&num_boucle="+num_boucle+"&rand="+Math.random();
	var position = "reload_player";
	document.getElementById(position).innerHTML = '<iframe id="frameVideo" src="'+url+'" width="450" height="338" allowtransparency="true" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" style="border:1px solid #000;"></iframe>';
	
	
	var url = "http://www.mesvip.com/lxplayer2/vu.php?id_video="+id;
	if(window.XMLHttpRequest) xhr_object = new XMLHttpRequest();
	else
	if (window.ActiveXObject) xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
	
	xhr_object.open("GET", url, true);
	xhr_object.onreadystatechange = function()
	{
		if ( xhr_object.readyState == 4 )
		{
			
		}
		else
		{
			
		}
	}
	// dans le cas du get
	xhr_object.send(null);
	
}



function incfirst(id)
{
	var url = "http://www.mesvip.com/lxplayer2/vu.php?id_video="+id;
	if(window.XMLHttpRequest) xhr_object = new XMLHttpRequest();
	else
	if (window.ActiveXObject) xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
	
	xhr_object.open("GET", url, true);
	xhr_object.onreadystatechange = function()
	{
		if ( xhr_object.readyState == 4 )
		{
			
		}
		else
		{
			
		}
	}
	// dans le cas du get
	xhr_object.send(null);
}


function user_donne_son_email(email,video,id_video)
{
	
	var var_email = email;
	var var_o = 'pcb';
	var var_t = '31';
	var var_pg_pcb_fourn = '87';
	var var_pgid = '1407';
	var var_tc1 = 'Mesvip20vidzVu';
	var var_tc2 = 'header';
	var var_n = '0';
	var var_prid = '31';
	var var_pg_mail = email;			
	
	window.open('http://acces.direction-x.com/a.php?t='+var_t+'&o='+var_o+'&pg_pcb_fourn='+var_pg_pcb_fourn+'&pgid='+var_pgid+'&tc1='+var_tc1+'&tc2='+var_tc2+'&n='+var_n+'&prid='+var_prid+'&pg_mail='+var_pg_mail+'');
	
	var xhr_object = null;
	var url = "flashplayer/donne_email_ok.php?video="+video+"&email="+email+"&id_video="+id_video+"&rand="+Math.random();
	var position = "player_video";

	if(window.XMLHttpRequest) xhr_object = new XMLHttpRequest();
	else
	if (window.ActiveXObject) xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
	
	xhr_object.open("GET", url, true);
	xhr_object.onreadystatechange = function()
	{
		if ( xhr_object.readyState == 4 )
		{
			document.getElementById(position).innerHTML = xhr_object.responseText;			
		}
		else
		{
			document.getElementById(position).innerHTML = '<br/><br/><center  style=" background-color:#000000; font-family:Arial, Helvetica, sans-serif; font-size:10px;"><b style="font-family:Arial, Helvetica, sans-serif; font-size:14px; color:#000000; font-weight:bold;">Chargement de la video veuillez patienter... </b><br/><img src="new_design/loading.gif" width="32" height="32" alt="chargement des donnees veuillez patienter" border="0" /></center>';
		}
	}
	// dans le cas du get
	xhr_object.send(null);
	
}





function send_my_vote(ip,note,actrice)
{
	if((ip && note) != '')
	{
		var xhr_object = null;
		var url = "actrice_send_my_vote.php?ip="+ip+"&note="+note+"&actrice="+actrice+"&rand="+Math.random();
		var refreshdiv = "zone_vote";
		if(window.XMLHttpRequest) xhr_object = new XMLHttpRequest();
		else
		if (window.ActiveXObject) xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
		
		xhr_object.open("GET", url, true);
		xhr_object.onreadystatechange = function()
		{
			if ( xhr_object.readyState == 4 )
			{
				document.getElementById(refreshdiv).innerHTML = xhr_object.responseText;
			}
			else
			{
				document.getElementById(refreshdiv).innerHTML = '<br/><br/><center  style=" background-color:#000000; font-family:Arial, Helvetica, sans-serif; font-size:10px;"><b style="font-family:Arial, Helvetica, sans-serif; font-size:14px; color:#000000; font-weight:bold;">Envois du vote, veuillez patienter... </b><br/><img src="new_design/loading.gif" width="32" height="32" alt="Envois du vote, veuillez patienter... " border="0" /></center>';
			}
		}
		// dans le cas du get
		xhr_object.send(null);
	}
}





function envoyer_a_un_amis(email,nom,lien)
{
	if((email && nom) != '')
	{
		var xhr_object = null;
		var url = "video_send_friend.php?email="+email+"&nom="+nom+"&lien="+lien+"&rand="+Math.random();
		var refreshdiv = "refresh_send_friend";
		if(window.XMLHttpRequest) xhr_object = new XMLHttpRequest();
		else
		if (window.ActiveXObject) xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
		
		xhr_object.open("GET", url, true);
		xhr_object.onreadystatechange = function()
		{
			if ( xhr_object.readyState == 4 )
			{
				document.getElementById(refreshdiv).innerHTML = xhr_object.responseText;
			}
			else
			{
				document.getElementById(refreshdiv).innerHTML = '<br/><br/><center  style=" background-color:#000000; font-family:Arial, Helvetica, sans-serif; font-size:10px;"><b style="font-family:Arial, Helvetica, sans-serif; font-size:14px; color:#000000; font-weight:bold;">Envois du vote, veuillez patienter... </b><br/><img src="new_design/loading.gif" width="32" height="32" alt="Envois du vote, veuillez patienter... " border="0" /></center>';
			}
		}
		// dans le cas du get
		xhr_object.send(null);
	}
}



function voter_video(vote,id)
{
	if((vote && id) != '')
	{
		var xhr_object = null;
		var url = "video_send_vote.php?vote="+vote+"&id_movie="+id+"&rand="+Math.random();
		var refreshdiv = "refresh_vote";
		if(window.XMLHttpRequest) xhr_object = new XMLHttpRequest();
		else
		if (window.ActiveXObject) xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
		
		xhr_object.open("GET", url, true);
		xhr_object.onreadystatechange = function()
		{
			if ( xhr_object.readyState == 4 )
			{
				document.getElementById(refreshdiv).innerHTML = xhr_object.responseText;
			}
			else
			{
				document.getElementById(refreshdiv).innerHTML = '<br/><br/><center  style=" background-color:#000000; font-family:Arial, Helvetica, sans-serif; font-size:10px; font-family:Arial, Helvetica, sans-serif; font-size:10px;"><b style="font-family:Arial, Helvetica, sans-serif; font-size:14px; color:#000000; font-weight:bold;">Envois du vote, veuillez patienter... </b><br/><img src="new_design/loading.gif" width="32" height="32" alt="Envois du vote, veuillez patienter... " border="0" /></center>';
			}
		}
		// dans le cas du get
		xhr_object.send(null);
	}
}




function affiche_masque_code_vidz()
{
	if(document.getElementById("code_video").style.visibility == 'hidden')
	{
		document.getElementById("code_video").style.visibility = 'visible';
		document.getElementById("code_video").style.display = '';
		document.getElementById("button_code2").value = '-';	
	}
	else
	{
		document.getElementById("code_video").style.visibility = 'hidden';
		document.getElementById("code_video").style.display = 'none';
		document.getElementById("button_code2").value = '+';							
		
	}
}


function affiche_masque_div(div,masque1,masque2,masque3,masque4,masque5)
{
	if(document.getElementById(div).style.visibility == 'hidden')
	{
		document.getElementById(div).style.visibility = 'visible';
		document.getElementById(div).style.display = '';
	}
	else
	{
		document.getElementById(div).style.visibility = 'hidden';
		document.getElementById(div).style.display = 'none';					
	}
	
	if(masque1){document.getElementById(masque1).style.visibility = 'hidden';document.getElementById(masque1).style.display = 'none';}
	if(masque2){document.getElementById(masque2).style.visibility = 'hidden';document.getElementById(masque2).style.display = 'none';}
	if(masque3){document.getElementById(masque3).style.visibility = 'hidden';document.getElementById(masque3).style.display = 'none';}
	if(masque4){document.getElementById(masque4).style.visibility = 'hidden';document.getElementById(masque4).style.display = 'none';}
	if(masque5){document.getElementById(masque5).style.visibility = 'hidden';document.getElementById(masque5).style.display = 'none';}
	
	
	//resizediv(div,'open');
	
}
					
function resizediv(div,statut)
{
	if(statut == 'open')
	{
		document.write(document.getElementById(div).style.height);
	}
//setTimeout("resizediv(div,statut)",1000);
}



function popup_sondage(id)
{
	window.open('sondage_stat.php?id='+id,null,'width=325,height=300, left=300, top=200, status=no, directories=no, toolbar=no, location=no, menubar=no, scrollbars=no, resizable=no');
}





function display_video_wmp(url_video, w, h)
{
	// apres on affiche la video
	var txt;

	if(!w) { w = 450; }
	if(!h) { h = 350; }

	var WMP7;

	txt = "";

	if ( navigator.appName != "Netscape" )
	{   
		try  {  WMP7 = new ActiveXObject('WMPlayer.OCX'); }
		catch(e) {}
	}

	// Windows Media Player 7 Code
	if ( WMP7 )
	{
		txt += '<OBJECT ID=MediaPlayer ';
		txt += ' CLASSID=CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6';
		txt += ' standby="Loading Microsoft Windows Media Player components..."';
		txt += ' TYPE="application/x-oleobject" width="'+ w +'" height="'+ h +'">';
		txt += '<PARAM NAME="url" VALUE="'+ url_video +'">';
		txt += '<PARAM NAME="AutoStart" VALUE="true">';
		txt += '<PARAM NAME="ShowControls" VALUE="1">';
		txt += '</OBJECT>';
	}

	// Windows Media Player 6.4 Code
	else
	{
		//IE Code
		txt += '<OBJECT ID=MediaPlayer ';
		txt += 'CLASSID=CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95 ';
		txt += 'CODEBASE=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715 ';
		txt += 'standby="Loading Microsoft Windows Media Player components..." ';
		txt += 'TYPE="application/x-oleobject" width="'+ w +'" height="'+ h +'">';
		txt += '<PARAM NAME="FileName" VALUE="'+ url_video +'">';
		txt += '<PARAM NAME="AutoStart" VALUE="true">';
		txt += '<PARAM NAME="ShowControls" VALUE="1">';

		//Netscape code
		
		txt += '    <Embed type="application/x-mplayer2"';
		txt += '        pluginspage="http://www.microsoft.com/windows/windowsmedia/"';
		txt += '        filename="'+ url_video +'"';
		txt += '        src="'+ url_video +'"';
		txt += '        Name="MediaPlayer"';
		txt += '        ShowControls=1';
		txt += '        Autostart=1';
		txt += '        ShowDisplay=0';
		txt += '        ShowStatusBar=0';
		txt += '        width='+ w;
		txt += '        height='+ h +'>';
		txt += '    </embed>';

		txt += '</OBJECT>';
	}

	document.write(txt);
}






function ajouter_mon_commentaire(pseudo,commentaire,id_video,ip)
{
	if((pseudo && commentaire && id_video) != '')
	{
		var xhr_object = null;
		var url = "insert_commentaire.php?rand="+Math.random();
		var refreshdiv = "reload_result_add_comment";
		if(window.XMLHttpRequest) xhr = new XMLHttpRequest();
		else
		if (window.ActiveXObject) xhr = new ActiveXObject("Microsoft.XMLHTTP");
		
		var data = "pseudo="+encodeURI(escape(pseudo))+"&commentaire="+encodeURI(escape(commentaire))+"&id_movie="+encodeURI(escape(id_video))+"&ip="+ip;
		xhr.open("POST", url, true);
		xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=ISO-8859-1");                  
		xhr.send(data);

		xhr.onreadystatechange = function()
		{
			if ( xhr.readyState == 4 )
			{
				document.getElementById(refreshdiv).innerHTML = decodeURI(xhr.responseText);
				document.getElementById('pseudo').value='';
				document.getElementById('comment_text').value='';
				document.getElementById('ajouter_un_commentaire').innerHTML = '<font color="#FF0000">Mesvip.com vous remmercie</font>';
				
			}
			else
			{
				document.getElementById(refreshdiv).innerHTML = '<br/><br/><center  style=" background-color:#000000; font-family:Arial, Helvetica, sans-serif; font-size:10px;"><b style="font-family:Arial, Helvetica, sans-serif; font-size:14px; color:#000000; font-weight:bold;">Envois du commentaire, veuillez patienter... </b><br/><img src="new_design/loading.gif" width="32" height="32" alt="Envois du commentaire, veuillez patienter... " border="0" /></center>';
			}
		}
		// dans le cas du get
		xhr.send(null);
	}
}







function verify_sondage()
{
	var boucle = document.formulaire_sondage.reponse.length;
	var id = document.formulaire_sondage.id.value;
	var ip = document.formulaire_sondage.ip.value;
	
	var checked = false;
	for(var i =0; i<boucle; i++)
	{
		if(document.formulaire_sondage.reponse[i].checked == true)
		{
			checked = true;
			var reponse = document.formulaire_sondage.reponse[i].value;
		}
	}
	if(checked == true)
	{
	
		//envois du sondage
		
		var xhr_object = null;
		var url = "sondage.php?id="+id+"&ip="+ip+"&reponse="+reponse+"&rand="+Math.random();
		var refreshdiv = "refresh_sondage";
		if(window.XMLHttpRequest) xhr_object = new XMLHttpRequest();
		else
		if (window.ActiveXObject) xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
		
		xhr_object.open("GET", url, true);
		xhr_object.onreadystatechange = function()
		{
			if ( xhr_object.readyState == 4 )
			{
				document.getElementById(refreshdiv).innerHTML = xhr_object.responseText;
			}
			else
			{
				document.getElementById(refreshdiv).innerHTML = '<br/><br/><center  style=" background-color:#000000; font-family:Arial, Helvetica, sans-serif; font-size:10px; font-family:Arial, Helvetica, sans-serif; font-size:10px;"><b style="font-family:Arial, Helvetica, sans-serif; font-size:14px; color:#000000; font-weight:bold;">Envois du vote, veuillez patienter... </b><br/><img src="new_design/loading.gif" width="32" height="32" alt="Envois du vote, veuillez patienter... " border="0" /></center>';
			}
		}
		// dans le cas du get
		xhr_object.send(null);
	
	
	}
	else
	{
		alert("Choisi une reponse.");
		return false;
	}

}



function add_this_page(value)
{
	var concatene = document.getElementById('message_contact').value;
	document.getElementById('message_contact').value = concatene + " " + value;
}


function verif_formulaire_contact()
{
	var message_erreur = '';
	var erreur = false;
	
	if(document.formulaire_de_contact.nom.value == '')
	{
		erreur = true;
		message_erreur += "Indique ton nom ou ton un pseudo \n";
	}
	if(document.formulaire_de_contact.email.value == '')
	{
		erreur = true;
		message_erreur += "Indique ton email \n";
	}
	if(document.formulaire_de_contact.sujet.value == 'Choisissez')
	{
		erreur = true;
		message_erreur += "Indique un sujet pour le message \n";
	}
	if(document.formulaire_de_contact.message.value == '')
	{
		erreur = true;
		message_erreur += "Ecris ton message dans le champ. \n";
	}
	if(document.formulaire_de_contact.captcha.value == '')
	{
		erreur = true;
		message_erreur += "Remplis le code de sécurité. \n";
	}


	if(erreur == true)
	{
		alert(message_erreur);
		return false;
	}
	else
	{
		return true;
	}
	
}






function favoris() 
{
	if ( navigator.appName != 'Microsoft Internet Explorer' )
	{ window.sidebar.addPanel("Mesvip.com","http://www.mesvip.com/mesvip.html",""); }
	else { window.external.AddFavorite("http://www.mesvip.com/mesvip.html","Mesvip.com"); }
} 




function assoc_vidz_auto_size(nbr_comment)
{
	// hauteur d'un block de vidéo associé
	var hauteur_block = 71;
	var hauteur_contener_assoc = nbr_comment * hauteur_block;
	if(nbr_comment > 1 ) hauteur_contener_assoc = nbr_comment * hauteur_block; else hauteur_contener_assoc = 200; 
	
	document.getElementById("videos_associe").style.height = hauteur_contener_assoc + "px"; 
	
}





function submit_error_bigvidz(id)
{

	var email = document.getElementById(id).value;
	
    longueur = document.getElementById(id).value.length;
    index = document.getElementById(id).value.indexOf("@");
    index2 = document.getElementById(id).value.indexOf(";");

    if ((index < 1) || (index==(longueur-1))) {
            alert("Entre ton email pour télécharger");
            document.getElementById(id).focus();
    return false;
    }
    if (index2 > 0){
            alert("Vous ne devez pas avoir de ; dans votre email");
            document.getElementById(id).focus();
      		return false;
    }
    domaine = document.getElementById(id).value.substring(index+1,longueur);
    longueur = domaine.length;
    index = domaine.indexOf(".");

    if ((index < 1) || (index==(longueur-1))){
            alert("Vous devez entrer un email de type nom@fournisseur.com");
            document.getElementById(id).focus();
        	return false;
    }
}




function loadUserPass()
{

	var mycookie = Get_Cookie('vipaccount');
	if(mycookie != null)
	{
		var explode = mycookie.split('&'); 
		var loggin = explode[0];
		var password = explode[1];
		var strLoggin =  loggin.split('=');
		var strpassword = password.split('=');
		login = strLoggin[1];
		password = strpassword[1];
		
		document.getElementById("loggin_top").value = login;
		document.getElementById("pass_top").value = password;
		document.getElementById("sesouvenirdemoi").checked = true;
		
	}

	
}

function firstAuto()
{
		
		var URL_VIDEO_FIRST_AUTO = document.getElementById('FIRSTAUTO').value;
		// FIRSTAUTO proviens de reloadLinkAccueil.php 
	 	var s1 = new SWFObject("jwp/player.swf","ply","450","338","9","#000");
		s1.addParam("allowfullscreen","true");
		s1.addParam("allowscriptaccess","always");
		s1.addParam("flashvars","streamer=lighttpd&file="+URL_VIDEO_FIRST_AUTO+"&autostart=true");
		s1.write("reload_player");
		
		//compte la première
		incfirst(URL_VIDEO_FIRST_AUTO);	
	
}
