function swf(file, w, h, params) 
{
	tags = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="' + w + '" height="' + h + '">'
    + '<param name="movie" value="swf/' + file + '.swf" />'
    + '<param name="quality" value="high" />'
	+ '<param name="wmode" value="transparent" />';
	if( params ) 
	{
		tags += '<param name="flashvars" value="' + params + '" />'
	}
    tags += '<embed';
	if( params )
	{
		tags += ' flashvars="' + params +'"';
	}
	tags += ' wmode="transparent" src="swf/' + file + '.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + w + '" height="' + h + '"></embed>'
  + '</object>'; 
	document.write(tags);
}

String.prototype.isEmpty = function()
{
	return this.match(/^\s*$/);
}

String.prototype.isInteger = function()
{
	return this.match(/^[0-9]+$/);
}

String.prototype.isFloat = function()
{
	return this.match(/^([0-9]+|[0-9]+\.[0-9]+)$/);
}

String.prototype.isEmail = function()
{
	return this.match(/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/);
}

String.prototype.trim = function() 
{
    return this.replace(/^\s*|\s*$/g, '')
}

function openPopUp(url, w, h, scrollb) 
{
	if( !scrollb ) scrollb = 0;
	var iLeft = (screen.width  - w) / 2 ;
	var iTop  = (screen.height - h) / 2 ;
	var sOptions = "toolbar=0,status=0,resizable=0,scrollbars=" + scrollb ;
		sOptions += ",width=" + w ; 
		sOptions += ",height=" + h ;
		sOptions += ",left=" + iLeft ;
		sOptions += ",top=" + iTop ;
		window.open( url, "_popup", sOptions ) ;
}

function verifCentrale(myForm)
{
	myForm = document.forms[myForm];
	k = 0;
	err = '';
	for(i=0; i<myForm.length; i++)
	{
		if( myForm.elements[i].value.trim() != '' )
			k ++;
	}
	if( k == 0 ) 
	{
		err = '- Indiquez au moins un critère de recherche';
	} else if( myForm.raison.value.trim() != '' && myForm.raison.value.length<2 )
	{
		err += '- Champ Raison sociale trop court\n';
	} else if( myForm.commune.value.trim() != '' && myForm.commune.value.length<2 )
	{
		err += '- Champ Commune trop court\n';	
	}
	if( err != '' ) 
	{
		alert('Vérifiez les erreurs ci-dessous:\n' + err)
		return(false);	
	}
	return(true);
}