var addLineNumber = 0;

function openPOPUP(varpath, varname, varwidth, varheight){
	var varparam = 'menubar=no, width='+varwidth+', height='+varheight;
	window.open(varpath, varname, varparam).focus();
}

function PHPPageToDisplay(page){
	//alert(page);
	document.location.replace("../html/"+page+".html");
}

function skipIntro(){
	$('indexEnFlash').echo('skip');
}

function callWindow(title, width, height)
{
  window.open("",title,"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=" + width + ",height=" + height);
}

function callWindowScroll(title, width, height)
{
  window.open("",title,"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=" + width + ",height=" + height);
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function ouvre_plan(){
	var page="../html/plan.html";
	window.open(page,"nom_popup","menubar=no, status=no, scrollbars=no, menubar=no, width=425, height=325");
}

function disp_alert()
{
	alert("Vous avez s�lectionn� Suppression. Etes-vous sur de vouloir supprimer ce stand?");
}
function disp_alert_gle()
{
	alert("Vous avez modifi� les informations du compte. Souhaitez vous les enregistrez?");
}

function addLine_configSalle(){
	var insertLine2 ="<div style=\"width:100%\">";
	insertLine2+="<input type=\"text\" style=\"text-align:left; width:160px;\" value=\"Nom de la salle\">";
	insertLine2+="<input type=\"text\" size=\"4\" maxlength=\"4\" style=\"text-align:center; width:50px;\" >";
	insertLine2+="<input type=\"text\" size=\"4\" maxlength=\"4\" style=\"text-align:center; width:55px;\" >";
	insertLine2+="<input type=\"text\" size=\"4\" maxlength=\"4\" style=\"text-align:center; width:55px;\" >";
	insertLine2+="<input type=\"text\" size=\"4\" maxlength=\"4\" style=\"text-align:center; width:55px;\" >";
	insertLine2+="<input type=\"text\" size=\"4\" maxlength=\"4\" style=\"text-align:center; width:55px;\" >";
	insertLine2+="<input type=\"text\" size=\"4\" maxlength=\"4\" style=\"text-align:center; width:55px;\" >";
	insertLine2+="<input type=\"button\" value=\"-\" onClick=\"rmLine_configSalle(event);\" style=\"text-align:center; width:20px;\">";
	insertLine2+="</div>";
	$('content_table').insert({bottom:insertLine2});
}

function rmLine_configSalle(e){
	alert('hi');
	//alert(divID);
	//$(divID).remove();
	var _target = e.target;
	_target.up().remove();
	//remove($('content_table').getChildren[divID]);
}

function serializeCapacity(){
	var capacite_salle = "";
	$('content_table').childElements().each(function(ligne){
						 //R�cup�ration du DIV ligne :
						 if(capacite_salle!="") capacite_salle+="|";
						 
						 for(i=0;i<7;i++){
							 if(i==0) capacite_salle += ligne.childElements()[i].value;
							 else {
								 if(ligne.childElements()[i].value=="") capacite_salle += ",0";
								 else capacite_salle += ","+ligne.childElements()[i].value;
							 }
						 }
						 });
	return capacite_salle;
}

function serializeHowKnown(){
	var returnHowKnown = "";
	if($('1').checked == true) {
		if(returnHowKnown=="") returnHowKnown = "1";
		else returnHowKnown += ",1";
	}
	if($('2').checked == true) {
		if(returnHowKnown=="") returnHowKnown = "2";
		else returnHowKnown += ",2";
	}
	if($('3').checked == true) {
		if(returnHowKnown=="") returnHowKnown = "3";
		else returnHowKnown += ",3";
	}
	if($('4').checked == true) {
		if(returnHowKnown=="") returnHowKnown = "4";
		else returnHowKnown += ",4";
	}
	if($('5').checked == true) {
		if(returnHowKnown=="") returnHowKnown = "5";
		else returnHowKnown += ",5";
	}
	if($('6').checked == true) {
		if(returnHowKnown=="") returnHowKnown = "6";
		else returnHowKnown += ",6";
	}
	if($('7').checked == true) {
		if(returnHowKnown=="") returnHowKnown = "7";
		else returnHowKnown += ",7";
	}
	if($('8').checked == true) {
		if(returnHowKnown=="") returnHowKnown = "8";
		else returnHowKnown += ",8";
	}
	return returnHowKnown;
}

function serializedSecuredPDF(){
	var securised_pdf = "";
	
	if($('label_securised_pdf1').value!="" && $('file_path_securised_pdf1').value!="") securised_pdf = $('file_path_securised_pdf1').value+","+$('label_securised_pdf1').value;
	if($('label_securised_pdf2').value!="" && $('file_path_securised_pdf2').value!="") {
		if(securised_pdf=="") securised_pdf = $('file_path_securised_pdf2').value+","+$('label_securised_pdf2').value;
		else securised_pdf += "|"+$('file_path_securised_pdf2').value+","+$('label_securised_pdf2').value;
	}
	if($('label_securised_pdf3').value!="" && $('file_path_securised_pdf3').value!="") {
		if(securised_pdf=="") securised_pdf = $('file_path_securised_pdf3').value+","+$('label_securised_pdf3').value;
		else securised_pdf += "|"+$('file_path_securised_pdf3').value+","+$('label_securised_pdf3').value;
	}
	if($('label_securised_pdf4').value!="" && $('file_path_securised_pdf4').value!="") {
		if(securised_pdf=="") securised_pdf = $('file_path_securised_pdf4').value+","+$('label_securised_pdf4').value;
		else securised_pdf += "|"+$('file_path_securised_pdf4').value+","+$('label_securised_pdf4').value;
	}
	return securised_pdf;
}

function selfDelete($id){
	var req = confirm("Voulez-vous vraiment supprimer votre compte ?");
	if(req == true){
		removeUserVis($id);
		alert("Votre comte a �t� int�gralement supprim�,\nMerci d'avoir visit� le salon virtuel 1001 Salles");
	}
}


