/**
Function
*/
/*------------------------------------------------------------
Function pour créer un popup
-------------------------------------------------------------*/
function showPopUp(w, h, link) {
var awjspuwbwx = (screen.width-w)/2 ;
var awjspuwbwy = (screen.height-h)/2 ;
var awjspuwbwpos = "left="+awjspuwbwx+",top="+awjspuwbwy ;
awPopUpWin = window.open(link, "AWPopWin", "width="+w+",height="+h+",fullscreen=0,directories=0,location=0,menubar=0,resizable=1,scrollbars=1,status=0,maximize=0,toolbar=0,alwaysRaised=yes,"+awjspuwbwpos);
}
//Controle la sélection des types de manifestation
function ctrlAnMani1(ids){
var i = ids;
var nbEl = 0;
var nbEll = 0;
var inc = 1;
var valTmp = 0;
//Le nombre d'éléments dans la liste
nbEl = parseInt(document.forms["MyForm"].elements["hidTotalPriMani"].value,10)
nbEll = parseInt(document.forms["MyForm"].elements["hidLimitMani"].value,10)
//alert(nbEl)
with (document.forms["MyForm"]){
while ( inc <= nbEl) {
valTmp = valTmp + eval(elements["chkMani1"+inc].checked)
inc = inc + 1;
}
if (valTmp >= nbEll){//Il ne faut plus choisir d'avantage
inc = 1;
while ( inc <= nbEl) {
if(elements["chkMani1"+inc].checked==true){
//nothing
}else{
elements["chkMani1"+inc].disabled = true
}
inc = inc + 1;
}
}else{
inc = 1;
while ( inc <= nbEl) {
elements["chkMani1"+inc].disabled = false
inc = inc + 1;
}
}
}
}
function ctrlAnMani2(ids){
var i = ids;
var nbEl = 0;
var nbEll = 0;
var inc = 1;
var valTmp = 0;
//Le nombre d'éléments dans la liste
nbEl = parseInt(document.forms["MyForm"].elements["hidTotalProMani"].value,10)
nbEll = parseInt(document.forms["MyForm"].elements["hidLimitMani"].value,10)
with (document.forms["MyForm"]){
while ( inc <= nbEl) {
valTmp = valTmp + eval(elements["chkMani2"+inc].checked)
inc = inc + 1;
}
if (valTmp >= nbEll){//Il ne faut plus choisir d'avantage
inc = 1;
while ( inc <= nbEl) {
if(elements["chkMani2"+inc].checked==true){
//nothing
}else{
elements["chkMani2"+inc].disabled = true
}
inc = inc + 1;
}
}else{
inc = 1;
while ( inc <= nbEl) {
elements["chkMani2"+inc].disabled = false
inc = inc + 1;
}
}
}
}
//Conctrôle la sélection des types de lieu
function ctrlAnLieu(ids){
var i = ids;
var nbEl = 0;
var nbEll = 0;
var inc = 1;
var valTmp = 0;
//Le nombre d'éléments dans la liste
nbEl = parseInt(document.forms["MyForm"].elements["hidTotalLieu"].value,10)
nbEll = parseInt(document.forms["MyForm"].elements["hidLimitLieu"].value,10)
with (document.forms["MyForm"]){
while ( inc <= nbEl) {
valTmp = valTmp + eval(elements["chkLieu"+inc].checked)
inc = inc + 1;
}
if (valTmp >= nbEll){//Il ne faut plus choisir d'avantage
inc = 1;
while ( inc <= nbEl) {
if(elements["chkLieu"+inc].checked==true){
//nothing
}else{
elements["chkLieu"+inc].disabled = true
}
inc = inc + 1;
}
}else{
inc = 1;
while ( inc <= nbEl) {
elements["chkLieu"+inc].disabled = false
inc = inc + 1;
}
}
}
}
//Fonction d'ajout d'une ligne d'un tableau
function addRow(){
var inc = 0;
var i = 1;
var nbRow = 0;
var tnbRow = 0;
var tCode = "";
var tName = "";
var tLastname = "";
var strRows = "";
var tmp = "";
//Get the count row number
nbRow = parseInt(document.forms["MyForm"].elements["hidNbRow"].value, 10)
//alert('nbRow =' + nbRow)
//Le nombre de row, après ajout
tnbRow = nbRow + 1
for(inc=1; inc<=tnbRow; inc++){
//alert('inc =' + inc)
//Adds the row
if(inc == tnbRow){
//Get values
pKapazität = ""
pFläche = ""
pTheater = ""
pParlament = ""
pStuhlreihen = ""
pBanquet = ""
pCocktail = ""
//alert("oui1")
}else{
//alert("oui2 : " + inc)
//Get values
pKapazität = document.forms["MyForm"].elements["txtSKapazität" + inc].value
pFläche = document.forms["MyForm"].elements["txtSFläche" + inc].value
pTheater = document.forms["MyForm"].elements["txtSTheater" + inc].value
pParlament = document.forms["MyForm"].elements["txtSParlament" + inc].value
pStuhlreihen = document.forms["MyForm"].elements["txtSStuhlreihen" + inc].value
pBanquet = document.forms["MyForm"].elements["txtSBanquet" + inc].value
pCocktail = document.forms["MyForm"].elements["txtSCocktail" + inc].value
//alert("oui22")
}
//alert("oui3")
//Use value
tmp = makeRow(i, pKapazität, pFläche, pTheater, pParlament, pStuhlreihen, pBanquet, pCocktail)
//alert("oui4")
strRows = strRows + tmp
i = i + 1
}
//alert(strRows)
//if (confirm('Are you sure to add one row ?')){
setText("listsalon", strRows)
//}
//Décrémente le nombre de row
nbRow = nbRow + 1
document.forms["MyForm"].elements["hidNbRow"].value = nbRow
}
function deleteRow(number){
var inc = 0;
var i = 1;
var nbRow = 0;
var tCode = "";
var tName = "";
var tLastname = "";
var strRows = "";
var tmp = "";
//Get the count row number
nbRow = parseInt(document.forms["MyForm"].elements["hidNbRow"].value, 10)
for(inc=1;inc<=nbRow;inc++){
//Do not use the deleted row
if(inc == number){
inc = inc + 1
}
if(inc <= nbRow){
//Get values
pKapazität = document.forms["MyForm"].elements["txtSKapazität" + inc].value
pFläche = document.forms["MyForm"].elements["txtSFläche" + inc].value
pTheater = document.forms["MyForm"].elements["txtSTheater" + inc].value
pParlament = document.forms["MyForm"].elements["txtSParlament" + inc].value
pStuhlreihen = document.forms["MyForm"].elements["txtSStuhlreihen" + inc].value
pBanquet = document.forms["MyForm"].elements["txtSBanquet" + inc].value
pCocktail = document.forms["MyForm"].elements["txtSCocktail" + inc].value
//Use value
tmp = makeRow(i, pKapazität,pFläche, pTheater, pParlament,pStuhlreihen, pBanquet, pCocktail)
strRows = strRows + tmp
i = i + 1
}
}
if (confirm('Möchten Sie diese Location löschen ?')){
setText("listsalon", strRows)
//Décrémente le nombre de row
nbRow = nbRow - 1
document.forms["MyForm"].elements["hidNbRow"].value = nbRow
}
}
function deleteRowMac(number){
var inc = 0;
var i = 1;
var nbRow = 0;
var tCode = "";
var tName = "";
var tLastname = "";
var strRows = "";
var tmp = "";
//Get the count row number
nbRow = parseInt(document.forms["MyForm"].elements["hidNbRow"].value, 10)
//document.write("
Nb lignes= " +nbRow);
for(inc=1;inc<=nbRow;inc++){
//Do not use the deleted row
//document.write("
Nb inc= " + inc + "number= " + number);
if(inc == number){
inc = inc + 1
}
if(inc <= nbRow){
//Get values
tmp = "txtSKapazität" + inc
pKapazität = document.forms["MyForm"].elements[tmp].value
tmp = "txtSFläche" + inc
pFläche = document.forms["MyForm"].elements[tmp].value
tmp = "txtSTheater" + inc
pTheater = document.forms["MyForm"].elements[tmp].value
tmp = "txtSParlament" + inc
pParlament = document.forms["MyForm"].elements[tmp].value
tmp = "txtSStuhlreihen" + inc
pStuhlreihen = document.forms["MyForm"].elements[tmp].value
tmp = "txtSBanquet" + inc
pBanquet = document.forms["MyForm"].elements[tmp].value
tmp = "txtSCocktail" + inc
pCocktail = document.forms["MyForm"].elements[tmp].value
//Use value
tmp = makeRow(i, pKapazität,pFläche, pTheater, pParlament,pStuhlreihen, pBanquet, pCocktail)
strRows = strRows + tmp
i = i + 1
}
}
if (confirm('Möchten Sie diese Location löschen ?')){
setText("listsalon", strRows)
//Décrémente le nombre de row
nbRow = nbRow - 1
document.forms["MyForm"].elements["hidNbRow"].value = nbRow
//document.write(strRows);
}
}
function makeRow(index, pKapazität,pFläche, pTheater, pParlament,pStuhlreihen, pBanquet, pCocktail){
var strRow = "";
var tmp = "";
strRow = strRow + '
| '
tmp = "txtSKapazität" + index
strRow = strRow + ''
strRow = strRow + ' | '
tmp = "txtSFläche" + index
strRow = strRow + ''
strRow = strRow + ' | '
tmp = "txtSParlament" + index
strRow = strRow + ''
strRow = strRow + ' | '
tmp = "txtSStuhlreihen" + index
strRow = strRow + ''
strRow = strRow + ' | '
tmp = "txtSTheater" + index
strRow = strRow + ''
strRow = strRow + ' | '
tmp = "txtSBanquet" + index
strRow = strRow + ''
strRow = strRow + ' | '
tmp = "txtSCocktail" + index
strRow = strRow + ''
strRow = strRow + ' |