function ferme_sondage()
{
	$("#sondage").hide();
}

function ouvre_popup(page) {
       window.open(page,"","menubar=no, status=no, scrollbars=no, menubar=no,toolbar=0, width=500, height=580");
   }

/*function goto_offre(valeur)
{
	if (valeur != "nok")
	{
		if(document.getElementById("select_rech1").value != "nok" && document.getElementById("select_rech2").value != "nok")
		{window.location.replace("page/offres.php?multi=ok&id="+document.getElementById("select_rech1").value);}
	}
}*/

function goto_offre(valeur)
{
	if (valeur != "nok"){
		window.location.replace("page/offres.php?id="+valeur);
	}
}
function mois_news(langue,mois,annee)
{
	if (mois != "nok" && annee != "nok"){
		if (annee == "" && mois != ""){
		window.location.replace("news.php?lang="+langue+"&mois="+mois);
		}
		if (mois == "" && annee != ""){
		window.location.replace("news.php?lang="+langue+"&annee="+annee);
		}
		if (mois != "" && annee != ""){
		window.location.replace("news.php?lang="+langue+"&mois="+mois+"&annee="+annee);
		}
	}
}
function ouvre_newsletter(page)
{
	window.open(page,"","menubar=no, status=no, scrollbars=no, menubar=no,toolbar=0, width=520, height=300");
}

function chargeVideo(id_projet, id_video){
	$.post("listeVideo.php",{id_projet:id_projet, id_video:id_video}, function(data){ $("#propositions_films").html(data); });
	$.post("urlVideo.php",{id_video:id_video}, function(data){ lanceVideo(data) });
}

function lanceVideo(url){
	var flash = new SWFObject( "../swf/video_player.swf" , "video.swf" , "400", "250", "9" , "#FFFFFF" );
	flash.addVariable("url", "../videos/"+url);
	flash.addParam("wmode","transparent");
	flash.write("player_video");
}

function chargeDefilement(){
	var flash = new SWFObject( "../swf/defilement.swf" , "defilement_swf" , "872", "140", "9" , "#FFFFFF" );
	flash.addParam("wmode","transparent");
	flash.write("bandeau_image");
}

function ouvreZoomImage(url){
	//alert($(document).height()+" "+$(document).width());
	$("#fondPopUp").height($(document).height());
	$("#fondPopUp").width($(document).width());
	$("#fondPopUp").css("display","block");
	$("#fondPopUp").fadeTo(1,.8);
	$("#fondImage").css("display","block");
	
	var flash = new SWFObject( "../swf/imageViewer.swf" , "imageViewer_swf" , "100%", "100%", "9" , "#FFFFFF" );
	flash.addParam("wmode","transparent");
	flash.addParam("scale","noscale");
	flash.addVariable("url",url);
	flash.addParam("menu","false");
	flash.write("fondImage");
	
	$("#fondPopUp").click(function(){ fermeZoomImage()});
	$("#fondImage").click(function(){ fermeZoomImage()});
}

function fermeZoomImage(){
	$("#fondImage").css("display","none");
	$("#fondPopUp").css("display","none");
	//goToBas();
}
function PopupImage(img) { 
titre="ELB Games - Etranges libellules"; 
w=open("",'image','width=400,height=400,toolbar=no,scrollbars=no,resizable=no'); 
w.document.write("<HTML><HEAD><TITLE>"+titre+"</TITLE></HEAD>"); 
w.document.write("<SCRIPT language=javascript>function checksize() { if (document.images[0].complete) { window.resizeTo(document.images[0].width+10,document.images[0].height+100); window.focus();} else { setTimeout('checksize()',250) } }</"+"SCRIPT>"); 
w.document.write("<BODY onload='checksize()' onblur='window.close()' onclick='window.close()' leftMargin=0 topMargin=0 marginwidth=0 marginheight=0>");
w.document.write("<TABLE width='100%' border='0' cellspacing='0' cellpadding='0' height='100%'><TR>");

w.document.write("<TD valign='middle' align='center'><IMG src='"+img+"' border=0 alt='Projet ELB'>"); 
w.document.write("</TD></TR></TABLE>");
w.document.write("</BODY></HTML>"); 
w.document.close(); 
}