function confirmAction($action)	{
	switch($action)	{
		case 1 :
			if(confirm("Are you sure you want to modify the record ?"))	{
				return true ;
			}
			else	{
				return false ;
			}
			break ;
		case 2 :
			if(confirm("Are you sure you want to delete the record ?"))	{
				return true ;
			}
			else	{
				return false ;
			}
			break ;
	}
}

function openWin(theURL,winName,features) { 
  window.open(theURL,winName,features);
}

function linker(where) {
	top.location = where ;
}

function postSelfForm(theForm,theUrl)
	{
	    eval('document.' + theForm + '.action = "' + theUrl + '"') ;
	    eval('document.' + theForm + '.submit()') ;
	}
	
	function postFormPop(theForm,theInput)
	{
		if(eval('document.'+theForm+'.'+theInput+'.value') != '0')	{
			myUrl = 'pop_reseller.php?country=' + eval('document.'+theForm+'.'+theInput+'.value') ;
	     window.open(myUrl,'pop','width=380,height=400,left=100,top=100,toolbar=no, statusbar=no, scrollbars=default');
		}
	}
	
	<!-- a function to make a button available -->
function buttGen(theForm,theHandler,theButton)	{
	if(eval('document.' + theForm + '.' + theHandler + '.checked == true'))	{
		eval('document.' + theForm + '.' + theButton + '.disabled = false') ;
	}
	else	{
		eval('document.' + theForm + '.' + theButton + '.disabled = true') ;
	}
}

function openWysiwygPopup(ctrlName)
	{
		window.open('/admin/WYSIWYG/index.php?ctrlName=' + ctrlName, 'titre', 'resizable=yes, toolbar=no, statusbar=no, scrollbars=no, width=750, height=620') ;
	}
	
	function openCategPopup(obj)
	{
		if(obj == null)
			curKey = 0 ;
		else
			curKey = obj.options[obj.selectedIndex].value ;

		window.open('elementcateg.php?idRubr=DV_IDRUBR&idParent=' + curKey, 'titre', 'resizable=no, toolbar=no, statusbar=no, scrollbars=yes, width=416, height=500') ;
	}
	
//	afficher le calque
	function affiche(idCalque)	{
		if (document.getElementById) {
	    // Navigateur qui supporte DHTML
		document.getElementById(idCalque).style.visibility  = 'visible' ;
	    }

		if (document.layers) {
	    // Navigateur Netscape 4.X
		document.layers[idCalque].visibility = 'visible' ;
	  }

	  if ((document.all)&&(!document.getElementById)) {
	  	//Explorer 4 uniquement
	    document.all[idCalque].style.visibility = 'visible' ;
	  }

	  if ((!document.layers)&&(!document.all)&&(!document.getElementById)) {
	    // Navigateur trop ancien !
	  }
	}

//	masquer le calque
	function masque(id)	{
		if (document.getElementById) {
	    // Navigateur qui supporte DHTML
		document.getElementById(id).style.visibility  = 'hidden' ;
	    }

		if (document.layers) {
	    // Navigateur Netscape 4.X
		document.layers[id].visibility = 'hide' ;
	  }

	  if ((document.all)&&(!document.getElementById)) {
	  	//Explorer 4 uniquement
	    document.all[id].style.visibility = 'hidden' ;
	  }

	  if ((!document.layers)&&(!document.all)&&(!document.getElementById)) {
	    // Navigateur trop ancien !
	  }
	}

//	afficher le calque
	function afficheImg(idCalque,pSrc)	{
		if (document.getElementById) {
	    // Navigateur qui supporte DHTML
		document.getElementById(idCalque).src  = pSrc ;
	    }

		if (document.layers) {
	    // Navigateur Netscape 4.X
		document.layers[idCalque].visibility = 'visible' ;
	  }

	  if ((document.all)&&(!document.getElementById)) {
	  	//Explorer 4 uniquement
	    document.all[idCalque].style.visibility = 'visible' ;
	  }

	  if ((!document.layers)&&(!document.all)&&(!document.getElementById)) {
	    // Navigateur trop ancien !
	  }
	}

	function repetForm()	{
		if (document.forms.persData.company.value != null)	{
			document.forms.persData.company2.value = document.forms.persData.company.value ;
		}
		if (document.forms.persData.nom.value != null)	{
			document.forms.persData.nom2.value = document.forms.persData.nom.value ;
		}
		if (document.forms.persData.prenom.value != null)	{
			document.forms.persData.prenom2.value = document.forms.persData.prenom.value ;
		}
		if (document.forms.persData.adresse.value != null)	{
			document.forms.persData.adresse2.value = document.forms.persData.adresse.value ;
		}
		if (document.forms.persData.npa.value != null)	{
			document.forms.persData.npa2.value = document.forms.persData.npa.value ;
		}
		if (document.forms.persData.localite.value != null)	{
			document.forms.persData.localite2.value = document.forms.persData.localite.value ;
		}
		if (document.forms.persData.pays.value != 0)	{
			document.forms.persData.dpays.value = document.forms.persData.pays.value ;
		}
		if (document.forms.persData.email.value != null)	{
			document.forms.persData.email2.value = document.forms.persData.email.value ;
		}
		if (document.forms.persData.tel.value != null)	{
			document.forms.persData.tel2.value = document.forms.persData.tel.value ;
		}
		if (document.forms.persData.fax.value != null)	{
			document.forms.persData.fax2.value = document.forms.persData.fax.value ;
		}
	}


