function confirm_delete_post(url, div_id, form_id)
{
	if (confirm("Etes vous sûr de vouloir effacer cette entrée ?"))
		RemoveTinyMcePOST(url, div_id, form_id);
}

function right_manager(module, section, object, value)
{
	document.getElementById('rightManagerContainer').innerHTML = "";
	document.getElementById('rightManagerContainer').style.display = "";
	ajaxGET("ajax.php?section=/"+module+"/rightManager&module="+module+"&section_name="+section+"&object="+object+"&value="+value, "rightManagerContainer");
}


function getPageSize(){

        var xScroll, yScroll;

        if (window.innerHeight && window.scrollMaxY) {
                xScroll = document.body.scrollWidth;
                yScroll = window.innerHeight + window.scrollMaxY;
        } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
                xScroll = document.body.scrollWidth;
                yScroll = document.body.scrollHeight;
        } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
                xScroll = document.body.offsetWidth;
                yScroll = document.body.offsetHeight;
        }

        var windowWidth, windowHeight;
        if (self.innerHeight) { // all except Explorer
                windowWidth = self.innerWidth;
                windowHeight = self.innerHeight;
        } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
                windowWidth = document.documentElement.clientWidth;
                windowHeight = document.documentElement.clientHeight;
        } else if (document.body) { // other Explorers
                windowWidth = document.body.clientWidth;
                windowHeight = document.body.clientHeight;
        }

        // for small pages with total height less then height of the viewport
        if(yScroll < windowHeight){
                pageHeight = windowHeight;
        } else {
                pageHeight = yScroll;
        }

        // for small pages with total width less then width of the viewport
        if(xScroll < windowWidth){
                pageWidth = windowWidth;
        } else {
                pageWidth = xScroll;
        }
		
        arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight)
        return arrayPageSize;
}

/* suppression d'element */
function confirmAjax(url, div, msg)
{
        if (confirm(msg))
        {
                ajaxGET(url, div);
        }
}

function confirmAjaxPOST(url, div, form, msg)
{
        if (confirm(msg))
        {
                ajaxPOST(url, div, form);
        }
}

function none()
{
	return false;
}




	var interv = null;
	var valInterval = 0;
	var valScroll = 0;
	var positionScroll = 0;
	var speed = 0;
	
	function setScroll(type)
	{
		//alert(type+ ' : '+positionScroll + ' --> '+document.getElementById('divScroller').scrollWidth + ' > '+(positionScroll + 880));
		if (interv != null || (positionScroll <= 0 && type == 'Left') || ((positionScroll + 385) > document.getElementById('divScroller').scrollWidth && type == 'Right'))
			return;
		interv = setInterval('scrollCategorie'+type+'()', 20);
		valInterval = 20;
		valScroll = 0;
		speed = 20;
	}
	
	function scrollCategorieLeft()
	{
		if (interv != null && valScroll <= 385)
		{
			positionScroll -= (1 + speed);
			document.getElementById('divScroller').scrollLeft = positionScroll;
			valScroll += (1 + speed);
		}
		else
		{
			clearInterval(interv);
			interv = null;
			if (positionScroll <= 0)
				document.getElementById('btnMoveCategorieLeft').style.display = 'none';
			document.getElementById('btnMoveCategorieRight').style.display = 'block';
		}
	}
	
	function scrollCategorieRight()
	{
		if (interv != null && valScroll <= 385)
		{
			positionScroll += (1 + speed);
			document.getElementById('divScroller').scrollLeft = positionScroll;
			valScroll += (1 + speed);
		}
		else
		{
			clearInterval(interv);
			interv = null;
			if ((positionScroll + 385) > document.getElementById('divScroller').scrollWidth)
				document.getElementById('btnMoveCategorieRight').style.display = 'none';
			document.getElementById('btnMoveCategorieLeft').style.display = 'block';
		}
	}

function changeStateBtnRadio(obj, id, name)
{
	var radio = document.getElementById(id);
	var tab = document.getElementsByName(name);
	
	radio.checked = true;

	var reg = new RegExp('Select');
	for (var i = 0; i < tab.length; i++)
	{
		if (tab[i] != radio)
		{
			var img = document.getElementById('radioImg'+tab[i].id);
			img.src = img.src.replace(reg, '');
		}
	}
	var reg = new RegExp('\.jpg');
	obj.src = obj.src.replace(reg, 'Select\.jpg');
}

function adminProfileUpdateImg(path, filename)
{
        $('image').value = filename;
        $('adminUserFormImageContainer').innerHTML = "<img src='"+path+"' style='display:block; margin-left:auto; margin-right:auto;' />";
}

