var is_dhtml=0;
var is_id=0;
var is_all=0;
var is_layers=0;

if (document.getElementById)
{
	is_id=1;
	is_dhtml=1;
}
else
{
	if (document.all)
	{
		is_all=1;
		is_dhtml=1;
	}
	else
	{
		browserVersion=parseInt(navigator.appVersion);
		if ((navigator.appName.indexOf('Netscape')!=-1) &&(browserVersion==4))
		{
			is_layers=1;
			is_dhtml=1;
		}
	}
}

function find_dom(object_id,with_style)
{
	if (with_style==1)
	{
		//style de l'objet
		if (is_id)
		{
			return (document.getElementById(object_id).style);
		}
		else
		{
			if (is_all)
			{
				return (document.all[object_id].style);
			}
			else
			{
				if (is_layers)
				{
					return (document.layers[object_id]);
				}
			}
		}
	}
	else
	{
		//propri�t�s de l'objet
		if (is_id)
		{
			return (document.getElementById(object_id));
		}
		else
		{
			if (is_all)
			{
				return (document.all[object_id]);
			}
			else
			{
				if (is_layers)
				{
					return (document.layers[object_id]);
				}
			}
		}
	}
}

// flag_obj=="style" pour manipuler les styles de l objet: exp background-color, font-color
// sinon flag_obj=="" pour manipuler les proprietes de l objet: exp size, value, name

function capt_obj(id_obj,flag_obj)
{
    if (document.getElementById)
    {
        //mozilla(linux),konqueror,opera(linux) 
        if (flag_obj=="style")
            return (document.getElementById(id_obj).style);
        else
            return (document.getElementById(id_obj));   
    }   
    else
    {
        if (document.all)
        {
            //ie
            if (flag_obj=="style")
                return (document.all[id_obj].style);
            else
                return (document.all[id_obj]);
        }
    }
}
//navigation sur les pages precente, suivante, premiere, derniere
function page_html_table(id_form,id_elmt,start_aff,url)
{
	var obj_form = capt_obj(id_form,"");
	var obj_elmt = capt_obj(id_elmt,"");
	obj_elmt.value=start_aff;
	obj_form.method="post";
	obj_form.action=url;
	obj_form.submit();
}

//------------------------------------------------------------------------
//envoi de formulaire classique avec methode post 
//------------------------------------------------------------------------
function post_form (id_form,url)
{
    var obj_form=capt_obj(id_form,"");
    obj_form.method="post";
    obj_form.action=url;
    obj_form.submit();
}
//-->

// Permet d'ouvrir la photo en plus grande taille dans une window
function aff_photo(photo)
{

var fen = window.open("fenpopup.php?nomphoto="+photo, "", "menubar=0,tollbar=0,location=0,directories=0,status=0,scrollbars=0,screenX=500,screenY=500,top=500,left=500");
//largeur=document.images[0].width;
//hauteur=document.images[0].height;
//nomphoto='./img-mairie-rions/'+nomphoto;
//window.open(nomphoto,null,'scrollbars=no,toolbar=no,width='+ largeur +',height='+ 90 );

}

//highlight des lignes de tableau html (couleur)
function highlight(object_id,color)
{
	var obj_style=find_dom(object_id,1);
	obj_style.backgroundColor=""+color;
}

//highlight des cellules de tableau html (classe)
function highlight_cel(object_id,classe)
{
	var obj_prop=find_dom(object_id,0);
	obj_prop.className=""+classe;
}
