/// <reference name="MicrosoftAjax.js"/>

function ChangeImage(objImage, strImage) 
{
	objImage.src = strImage;
}

function ChangeFond()
{
    document.body.style.backgroundImage = "url(" + document.getElementById("ctl00_ImageFond").value + ")";
}

// Move an element directly on top of another element (and optionally make it the same size)
function Cover(bottom, top, offsetLeft, offsetTop, ignoreSize) {

    try 
    {
        if (offsetLeft==null) {offsetLeft = 0;}
        if (offsetTop==null) {offsetTop = 0;}
        
        var location = Sys.UI.DomElement.getLocation(bottom);
        top.style.position = 'absolute';
        top.style.top = location.y + offsetTop + 'px';
        top.style.left = location.x + offsetLeft + 'px';
        
        if (!ignoreSize) {
            top.style.height = bottom.offsetHeight + 'px';
            top.style.width = bottom.offsetWidth + 'px';
        }
    }
    catch (e)
    {
        alert("Erreur fonction \"Cover\" : " + e.description)
    }

}

function Highlight(e, className) {
	if (className==null) {
		className = "highlight";
	}
    overClassName = e.className;
    e.className = className;
}

function Unhighlight(e, className) {
	if (className==null) {
		className = overClassName;
	}
    e.className = className;
}

function OpenWindow(url, target, width, height, top, left, scrollbars) {

	window.open(url,target,'width=' + width + ',height=' + height + ',left=' + left + ',top='+ top + ',toolbar=no,location=no,status=no,menubar=no,resizable=no,scrollbars=' + scrollbars );
	return false;

}
function openAttach(StrElement, StrKey, strPrefixe, strSubmit) {
	hauteur  = 400;
	largeur  = 400;
	var winl = 40;
	var wint = 40;
	winprops = 'height='+hauteur+',width='+largeur+',top='+wint+',left='+winl+',scrollbars=0,resizable=0';
	window.open(strPrefixe + "/Membres/Upload_SelectFile.aspx?Element=" + StrElement + "&Key=" + StrKey + "&submit=" + strSubmit, "framePopup", winprops);
}
function Upl_attachFile(element, value, submit)
{
    parent.document.getElementById(element).value = value;
    if (submit!="")
    {
    
    }
    var divPopup = parent.document.getElementById("divPopup")
    divPopup.style.display="none";
    
}
function Upl_ShowPopup()
{
    var divPopup = parent.document.getElementById("divPopup")
    
    divPopup.style.display = "";
    divPopup.style.left  = eval((screen.availWidth - 500)/2) + "px";

    if (document.all) { divPopup.style.top = document.documentElement.scrollTop + 100 ;}
    else {divPopup.style.top = eval(window.pageYOffset + 100) + "px" ;}
    
    parent.document.body.onclick = Upl_HidePopup;
}
function Upl_HidePopup()
{
    parent.document.getElementById("divPopup").style.display="none";

}
