function chatmaj() {
	parent.frames['chat'].location.href = 'chat.php'; 
}
function chatmaj2() {
	parent.frames['chat'].location.href = 'chat.php?nbpp=150'; 
}
function noright() {
	document.getElementById('aptxt').innerHTML='<big><font color="#FF0000">Attention: You must click on "Create definitive smilie" if you want to use the smilie on the forum!</font></big>';
}
function urlencode(plaintext) {
	var SAFECHARS = "0123456789" +
					"ABCDEFGHIJKLMNOPQRSTUVWXYZ" +
					"abcdefghijklmnopqrstuvwxyz" +
					"-_.!~*'()";
	var HEX = "0123456789ABCDEF";

	while(plaintext.indexOf("\r\n",1) > 0) {
	plaintext = plaintext.replace("\r\n", "[br]");
	}
	while(plaintext.indexOf("\n",1) > 0) {
	plaintext = plaintext.replace("\n", "[br]");
	}
	
	
	var encoded = "";
	for (var i = 0; i < plaintext.length; i++ ) {
		var ch = plaintext.charAt(i);
	    if (ch == " ") {
		    encoded += "+";
		} else if (SAFECHARS.indexOf(ch) != -1) {
		    encoded += ch;
		} else {
		    var charCode = ch.charCodeAt(0);
			if (charCode > 255) {

			} else {
				encoded += "%";
				encoded += HEX.charAt((charCode >> 4) & 0xF);
				encoded += HEX.charAt(charCode & 0xF);
			}
		}
	}
	return (encoded)
}
function maj(mode) {
	if (mode == 1) {document.getElementById('aptxt').innerHTML='Creation of sample ...';}
	if (mode == 0) {document.getElementById('aptxt').innerHTML='Image creation ...';}
	
	encoded = urlencode(document.form1.txt.value);
	url = 'GS2/imgv3.php?c=' + document.form1.cTexte.value.replace('#','') + document.form1.cCadre.value.replace('#','') + document.form1.cFond.value.replace('#','') + document.form1.co1.value.replace('#','') + document.form1.co2.value.replace('#','') + "&p=" + document.form1.p.value + "&f=" + document.form1.font.value + "&t=" + document.form1.size.value + "&id=1&s=" + document.form1.imgid.value + "&txt=" + encoded + "&a=" + document.form1.align.value + "&d=" + document.form1.d.value + "&bas=" + document.form1.bas.value;
	if (mode == 1) {document.img.src = url;}
	document.formftp.ftpimgpath.value = url;
}
function rien() {

}
function popup(champ) {
	if (champ == 'cFond') { couleur = document.form1.cFond.value.replace('#', '%23'); }
	if (champ == 'cCadre') { couleur = document.form1.cCadre.value.replace('#', '%23'); }
	if (champ == 'co1') { couleur = document.form1.co1.value.replace('#', '%23'); }
	if (champ == 'co2') { couleur = document.form1.co2.value.replace('#', '%23'); }
	if (champ == 'cTexte') { couleur = document.form1.cTexte.value.replace('#', '%23'); }
	url = 'couleurspopv2.php?champ='+ champ +'&couleur=' + couleur;
	window.open(url,'Couleurs','Width=500,height=240');
}

function charge(){document.getElementById("loading").style.visibility = "hidden"; }

function popup_page(page) {
	window.open('http://ameler.nexenservices.com/'+page,'gs','Width=550,height=535,scrollbars=yes,resizable=yes');
}

function dandy(mode) {
	encoded = urlencode(document.form1.txt.value);
	url = 'GS2/upload.php?c=' + document.form1.cTexte.value.replace('#','') + document.form1.cCadre.value.replace('#','') + document.form1.cFond.value.replace('#','') + document.form1.co1.value.replace('#','') + document.form1.co2.value.replace('#','') + "&p=" + document.form1.p.value + "&f=" + document.form1.font.value + "&t=" + document.form1.size.value + "&id=1&s=" + document.form1.imgid.value + "&txt=" + encoded + "&a=" + document.form1.align.value + "&d=" + document.form1.d.value + "&bas=" + document.form1.bas.value;
	location.href = url;
}