
function PopUp(page) 
{
var top=(screen.height-700)/2;
var left=(screen.width-800)/2;
window.open(page,"","top="+top+",left="+left+",width="+800+",height="+700+","+"menubar=no,scrollbars=no,statusbar=no");
}
/******************************************************/
function ValidatDuoForme(bAjax,moduleName)
	{

	 var signe1= window.document.forms["formSession"].signe1.value;
	 var signe2= window.document.forms["formSession"].signe2.value;
	 var param;


	 if(signe1==0)
	 {
	 	alert("vous devez saisir votre signe !!!");
	 	return false;
	 }
	 if(signe2==0)
	 {
	 	alert("vous devez son signe à lui (elle)!!!");
	 	return false;
	 }

	 	 	param="signe1-"+signe1+"|"+"signe2-"+signe2;

	 			 window.document.forms["formSession"].Params.value=param;
			 window.document.forms["formSession"].action="index.php";
 	}

function ValidatDateForme(bAjax,moduleName,blYear)
	{

	 var j= window.document.forms["formSession"].dayList.value;
	 var m= window.document.forms["formSession"].monthList.value;
	 var param;
	 if(j==0)
	 {
	 	alert("vous devez saisir le jour !!!");
	 	return false;
	 }
	 if(m==0)
	 {
	 	alert("vous devez saisir le mois !!!");
	 	return false;
	 }
	 if(blYear)
	 {
		 var y= window.document.forms["formSession"].yearList.value;
			 if(y==0)
			 {
			 	alert("vous devez saisir l\'année !!!");
			 	return false;
			 }
		 param="date-"+j+"_"+m+"_"+y;
	 }
	 else
	 	param="date-"+j+"_"+m;

 			 window.document.forms["formSession"].Params.value=param;
			 window.document.forms["formSession"].action="index.php";
 	}

/************************************************************/
var cntTirage=0;
var nbTirage=0;
function InitTarotForme(nb)
{
cntTirage=0;
nbTirage=nb;	
}
function getElem(elemID) 
{
	if(document.all){if(document.all[elemID]) elem=document.all[elemID]; else elem=false;}
	else{if(document.getElementById(elemID)) elem=document.getElementById(elemID); else elem=false;}
	return elem; 
}
function ValidatTarotForme()
	{
 	 var param;
 	 var moduleName= window.document.tirage.iblocks.value;
 	 var bAjax= window.document.tirage.bAjax.value;
	 var theme= window.document.tirage.theme.value;
	 var CarteChoisie= window.document.tirage.CarteChoisie.value;
	 param="theme-"+theme+"|CarteChoisie-"+CarteChoisie;

	window.document.tirage.Params.value=param;
	window.document.tirage.action="index.php";
	return true;
	}
function TirageTarot(variable1, chaine,theme)
{
if(theme==1)
{
if(document.tirage.theme.value=="")
		{
			alert("Veuillez choisir un thème");
			return false;
		}
}	
elem1=getElem(variable1+"_"+chaine+"choisi");
elem2=getElem(variable1+"1_"+chaine);

elem1.style.display="block";
elem2.style.display="none";
cntTirage++;
if(document.tirage.CarteChoisie.value!="")
		document.tirage.CarteChoisie.value=document.tirage.CarteChoisie.value+" ";
document.tirage.CarteChoisie.value=document.tirage.CarteChoisie.value+chaine;		
if (nbTirage==cntTirage)
				{
				ValidatTarotForme();
				document.tirage.submit();
				}

	}
function TirageTheme( chaine)
{

elem1=getElem("choix_theme");
 
elem1.innerHTML=chaine;

document.tirage.theme.value=chaine;
}
/******************************************************************/
function ValidatOracleForme()
	{
 	 var param;
 	 var moduleName= window.document.tirage.iblocks.value;
 	 var bAjax= window.document.tirage.bAjax.value;
	 var theme= window.document.tirage.theme.value;
	 param="theme-"+theme;
 
	if(bAjax=='true')
		{
			RefreshMods(moduleName,param);
			 return false;
		}
	else
		{
			 window.document.tirage.Params.value=param;
			 window.document.tirage.action="index.php";
			 return true;
		}
	}
/*********************************************************************/
function getCheckedValue(radioName)
{
	 var radioObj= getElem(radioName);

	if(!radioObj)
		return "0";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "0";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "0";
}

function ValidatQCMForme()
	{
  var param;
 	 var i ;
 	 var val;
 	 var choix;
 	 var act;
 	 var moduleName= window.document.QCM.iblocks.value;
 	 var typeQCM= window.document.QCM.typeQCM.value;
 	 var bAjax= window.document.QCM.bAjax.value;
	 var nbQry= window.document.QCM.nbQry.value;

	 act="OK";
	 choix="0a";
	 for(i=1;i<=nbQry;i++)
	 {
 	  	 val= getCheckedValue("question"+i);
			choix+=val;
 	 		choix+="a";
			if(val=="0")
		 			act="NO";
		}
	 param="type-"+typeQCM+"|action-"+act+"|choix-"+choix;
	if(bAjax=='true')
		{
			RefreshMods(moduleName,param);
			 return false;
		}
	else
		{
			 window.document.QCM.Params.value=param;
			 window.document.QCM.action="index.php";
			 return true;
		}
	}

	