function del( Obj ) {
	var label = ( Obj.title ) ? Obj.title : 'Etes vous sûr de vouloir supprimer cet élément ?';
	return confirm( label );	
}

function popup( href, h, l ) {
	var hauteur = Math.round( ( screen.availHeight - h ) / 2 );
	var largeur = Math.round( ( screen.availWidth - l ) / 2 );
	window.open( href, 'product', 'toolbar=0,location=0,directories=0,status=0, scrollbars=0,resizable=1,menubar=0,top='+hauteur+',left='+largeur+',width='+l+',height='+h);
	return false;	
}

/*
function popupProduct( Obj ) {
	return popup( Obj.href, 500, 500 );
}
*/

function changeMenuStates( menu, idp ) {
	var menuObj = document.getElementById( menu );
	if( menuObj ) {
		clearAll( menu );
		menuObj.disabled = false;
		menuObj.options[0] = new Option( "", "" );
		for( var i=0; i<states.length; i++ ) {
			if( states[i].idcountry == idp ) {
				menuObj.options[ menuObj.length ] = new Option( states[i].state, states[i].id );
			}
		}
		if( menuObj.length == 1 ) {
			menuObj.disabled = true;
		}
	}
}

function changeMenuSubFonctions( menu, idp ) {
	var menuObj = document.getElementById( menu );
	if( menuObj ) {
		clearAll( menu );
		menuObj.disabled = false;
		menuObj.options[0] = new Option( "", "" );
		for( var i=0; i<subfunctions.length; i++ ) {
			if( subfunctions[i].idfunction == idp ) {
				menuObj.options[ menuObj.length ] = new Option( subfunctions[i].subfunction, subfunctions[i].id );
			}
		}
		if( menuObj.length == 1 ) {
			clearAll( menu );
			menuObj.disabled = true;
		}
	}
}

function clearAll( menu ) {			
	var menuObj = document.getElementById( menu );			
	for( var j=menuObj.length; j>=0; j-- ) {
		menuObj.options[j] = null;
	}
	menuObj = null;
}
