window.onload = function()
{
	initSelect();
	initAutoBlankFields();
}

function initSelect()
{
	_initSelect('date');
	_initSelect('theme');
	_initSelect('commune');
}

function _initSelect(ids)
{
	var sel = document.getElementById(ids);
	if ( !sel )
		return ;
	sel.onchange = function() { redirectSelect(sel); }
}


function redirectSelect(sel)
{
	var opt= sel.options[sel.selectedIndex];
	document.location.href = opt.value;
}


function pop_img(url){
	window.open(url, 'photo','width=800,height=600,menubar=no,resizable=yes,scrollbars=yes');
}

function initAutoBlankFields()
{
	_initAutoBlankField('SearchText');
}

function _initAutoBlankField(idf)
{
	var f = document.getElementById(idf);
	if ( !f )
		return ;
	f.onfocus = function() { if ( f.value==f.defaultValue ) { f.value=''; } }
}

