function ConfirmDelete(element)
{
    return confirm('Voulez-vous vraiment supprimer cet élément ?');
}

function ConfirmAllDelete()
{
    url = window.location+"page-delete/"; 
    if(confirm("Voulez-vous vraiment supprimer la gamme entière du catalogue de l'opération ?"))
      document.location = url;

}

function DeleteGood(inputId)
{
    document.getElementById(inputId).value="0";
    document.getElementById("Front____submit").click();
}

var oldClass = null;
function OnRowOver(row)
{
    oldClass = row.className;
    row.className = "over";
}
function OnRowOut(row)
{
    row.className = oldClass;
}
function GetScrollXY() 
{
    var scrOfX = 0, scrOfY = 0;
    if( typeof( window.pageYOffset ) == 'number' ) 
    {
        //Netscape compliant
        scrOfY = window.pageYOffset;
        scrOfX = window.pageXOffset;
    }
    else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) 
    {
        //DOM compliant
        scrOfY = document.body.scrollTop;
        scrOfX = document.body.scrollLeft;
    }
    else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) 
    {
        //IE6 standards compliant mode
        scrOfY = document.documentElement.scrollTop;
        scrOfX = document.documentElement.scrollLeft;
    }
    return [ scrOfX, scrOfY ];
}
function FindPosition(obj)
{
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}
function WindowSize() 
{
    var myWidth = 0, myHeight = 0;
    if( typeof( window.innerWidth ) == 'number' ) 
    {
        //Non-IE
        myWidth = window.innerWidth;
        myHeight = window.innerHeight;
    }
    else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) 
    {
        //IE 6+ in 'standards compliant mode'
        myWidth = document.documentElement.clientWidth;
        myHeight = document.documentElement.clientHeight;
    }
    else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) 
    {
        //IE 4 compatible
        myWidth = document.body.clientWidth;
        myHeight = document.body.clientHeight;
    }
    return [myWidth,myHeight];
}
function DisplayHint(node)
{
    if(node)
    {
        n = node.getElementsByTagName('span');
        i = node.getElementsByTagName('img');
        if(n[0])
        {
            if(i[0])
            {
                n[0].style.width = i[0].width + "px";
            }
            n[0].style.display = 'block';
            if(i[0])
            {
                n[0].style.width = i[0].width + "px";
            }
            var poss = FindPosition(node);
            var windowSize = WindowSize();
            var scrollSize = GetScrollXY();
            if ((windowSize[1] + scrollSize[1]) < (poss[1] + n[0].offsetHeight))
            {
                n[0].style.top = poss[1] -  n[0].offsetHeight + "px";
            }
            else
            {
                n[0].style.top = poss[1] + "px";
            }
        }
    }
}
function HideHint(node)
{
    if(node)
    {
        n = node.getElementsByTagName('span');
        if(n[0])
        {
            n[0].style.display = 'none';
        }
    }
}
