<!--
function trimLength(textarea, maxChars)
{
	if(textarea.value.length <= maxChars) return;

	textarea.value = textarea.value.substr(0, maxChars)
}

function canAddCharacter(textarea, maxChars)
{
	if(typeof(textarea.onkeypress.arguments[0]) != 'undefined')
		var keyCode = textarea.onkeypress.arguments[0].keyCode;
	else
	{
		if(document.selection.createRange().text.length != 0) return true;
		var keyCode = event.keyCode;
	}

	var allowedChars = new Array(8, 37, 38, 39, 40, 46);	//Backspace, delete and arrow keys
	for(var x=0; x<allowedChars.length; x++) if(allowedChars[x] == keyCode) return true;

	if(textarea.value.length < maxChars) return true;

	return false;
}

function new_captcha() {
	var capurl = '/images/security?' + Math.random();
	document.getElementById('captcha').src=capurl;
}

function HighlightAll(theField) {
	var tempval=eval("document."+theField)
	tempval.focus()
	tempval.select()
	textcopy = theField.split('.')
	copy(document.getElementById(textcopy[1]).value)
}

function copy(text2copy) {
  if (window.clipboardData) {
    window.clipboardData.setData("Text",text2copy);
  } else {
    var flashcopier = 'flashcopier';
    if(!document.getElementById(flashcopier)) {
      var divholder = document.createElement('div');
      divholder.id = flashcopier;
      document.body.appendChild(divholder);
    }
    document.getElementById(flashcopier).innerHTML = '';
    var divinfo = '<embed src="/images/_clipboard.swf" FlashVars="clipboard='+escape(text2copy)+'" width="0" height="0" type="application/x-shockwave-flash"></embed>';
    document.getElementById(flashcopier).innerHTML = divinfo;
  }
}

if (window.name != "opener"){
   window.name = 'opener';
}

function openPreview(url,height,width){
	window.open(url,"preview", "height="+height+",width="+width+",status=yes,toolbar=no,menubar=no,location=no");
}

//-->
