function popupURL(tURL, tWidth, tHeight) {
	var config = 'height='+tHeight+',width='+tWidth+',toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,directories=no,status=no';
	window.open(tURL, 'popup', config);
}

function popupImage(tURL, tWidth, tHeight) {
	popupURL('fenetre_popup.php?url='+tURL, tWidth, tHeight);
}

function popupMail(tURL, tWidth, tHeight) {
	var config = 'height='+tHeight+',width='+tWidth+',toolbar=no,menubar=no,scrollbars=yes,resizable=no,location=no,directories=no,status=no';
	window.open(tURL, 'popup', config);
}

function rollOver (tID) {
	document.getElementById(tID).style.opacity=1; 
	document.getElementById(tID).style.filter='alpha(opacity=100)';
}
function rollOut (tID) {
	document.getElementById(tID).style.opacity=0.5; 
	document.getElementById(tID).style.filter='alpha(opacity=50)';
}

function modifyContent (tID, tContent) {
	
	tContent = replace(tContent, "simplequote", "'");
	tContent = replace(tContent, "quote", '"');
	
	document.getElementById(tID).innerHTML = tContent;
	
}

function replace(string,text,by) {
	// Replaces text with by in string
    var strLength = string.length, txtLength = text.length;
    if ((strLength == 0) || (txtLength == 0)) return string;
    var i = string.indexOf(text);
    if ((!i) && (text != string.substring(0,txtLength))) return string;
    if (i == -1) return string;
    var newstr = string.substring(0,i) + by;
    if (i+txtLength < strLength)
        newstr += replace(string.substring(i+txtLength,strLength),text,by);
    return newstr;
}
