﻿function MaxC(Object, MaxLen)
{
return (Object.value.length <= MaxLen);
}
function tag1(open, end){ 
	var tArea = document.myform.nicktxt; 
	var isIE = (document.all)? true : false; 
	var open = (open)? open : ""; 
	var end = (end)? end : ""; 
if(isIE){ 
	tArea.focus(); 
	var curSelect = document.selection.createRange(); 
if(arguments[2]){ 
	curSelect.text = open + arguments[2] + "]" + curSelect.text + end ; 
}else{ 
	curSelect.text = open + curSelect.text + end; 
 } 
}else if(!isIE && typeof tArea.selectionStart != "undefined"){ 
	var selStart = tArea.value.substr(0, tArea.selectionStart); 
	var selEnd = tArea.value.substr(tArea.selectionEnd, tArea.value.length); 
	var curSelection = tArea.value.replace(selStart, '').replace(selEnd, '');
if(arguments[2]){ 
	tArea.value = selStart + open + arguments[2] + "]" + curSelection + end + selEnd ;
}else{ 
	tArea.value = selStart + open + curSelection + end + selEnd; 
 } 
}else{ 
	tArea.value += (arguments[2])? open + arguments[2] + "]" + end : open + end ; 
 }
}

function tagleft(x) {
document.myform.nicktxt.value = x + document.myform.nicktxt.value;
}

function tagright(x) {
document.myform.nicktxt.value = document.myform.nicktxt.value + x;
}

function colore_unico(x) {
var name = prompt("Inserisci il codice esadecimale del colore (ad esempio):\n\n#000000 (nero)\n#FFFFFF (bianco)\n#0000FF (blu)\n#FF0000 (rosso)\n#32CD32 (verde)\n#FF1493 (rosa)\n\n", "#000000");
if (name==null){name = "#000000"; document.myform.nicktxt.value = "["+x+"="+name+"]"+document.myform.nicktxt.value+"[/"+x+"]";}
else{document.myform.nicktxt.value = "["+x+"="+name+"]"+document.myform.nicktxt.value+"[/"+x+"]";}
}

function colore_sfum(x) {
var name = prompt("Inserisci il codice esadecimale del 1° colore (ad esempio):\n\n#000000 (nero)\n#FFFFFF (bianco)\n#0000FF (blu)\n#FF0000 (rosso)\n#32CD32 (verde)\n#FF1493 (rosa)\n\n", "#000000");
var name2 = prompt("Inserisci il codice esadecimale del 2° colore (ad esempio):\n\n#000000 (nero)\n#FFFFFF (bianco)\n#0000FF (blu)\n#FF0000 (rosso)\n#32CD32 (verde)\n#FF1493 (rosa)\n\n", "#000000");
if (name==null){name = "#000000";}
if (name2==null){name2 = "#000000";}
document.myform.nicktxt.value = "["+x+"="+name+"]"+document.myform.nicktxt.value;
document.myform.nicktxt.value = document.myform.nicktxt.value+"[/"+x+"="+name2+"]";
}