// JavaScript Document
function copyField(a,b){
	$(b).value=$(a).value;
}


//------------------------------------------------------------DIV MANAGER
function swapText(id,s){
	var e=document.getElementById(id);
	if (e!=undefined) e.innerHTML=s;
	return e;
}
function getId(id){
	var e=document.getElementById(id);
	if (e==undefined) {
		e=document.getElementById("debug");
	}
	return e
}
function swapImage(id,s){
	return getId(id).src=s;
}
function setFocus(id) { 
	getId(id).focus();
}
function showDiv(id) {
	var v=getId(id).style;
	if (v.visibility!="visible") v.visibility="visible";
}
function hideDiv(id) {
	var v=getId(id).style;
	if (v.visibility!="hidden") v.visibility="hidden";
} 
function alphaDiv(id,n) {
	var v=getId(id).style;
	v.opacity=n;
} 
//----------------popup
function popup(url,nom,largeur,hauteur,options) {
	var haut=(screen.height-hauteur)/2;
	var Gauche=(screen.width-largeur)/2;
	fencent=window.open(url,nom,"top="+haut+",left="+Gauche+",width="+largeur+",height="+hauteur+","+options);
}

function checkFileName(o){
	o.value=o.value.toLowerCase().replace(/([^a-z\.\-])/g,"");
}	
//--------------

function resetEmpty(e,s){

	if ( e.value==s )  e.value="";
}