function Exv2ClipBoard(exv2ct, exv2ht){
	exv2ht.innerText = exv2ct.innerText;
	Copied = exv2ht.createTextRange();
	Copied.execCommand("Copy");
}
	
function eXV2ClipBoard(ctxt){
	Copied=document.body.createTextRange();
	Copied.moveToElementText(document.getElementById(ctxt));
	Copied.execCommand('Copy');
}

function eXV2CheckStringLaenge(form, feld, rest, max) {
	var CharsLeft = 0;
	var StringLaenge = document.forms[form].elements[feld].value.length;
 	if (StringLaenge == 1 && document.forms[form].elements[feld].value.substring(0,1) == " ") {
  		document.forms[form].elements[feld].value = ""; 
		StringLaenge = 0;
 	}

 	if (StringLaenge > max ) {
  		document.forms[form].elements[feld].value = document.forms[form].elements[feld].value.substring(0,max);
   		CharsLeft = 0;
 	}else{
  		CharsLeft = max - StringLaenge;
 	}
	document.getElementById(rest).innerHTML = CharsLeft;
}

function eXV2check_confirm(ctext, url) {
	var Check = confirm(ctext);
	if (Check == false) {
  		return false;
  	}else{
		document.location.href=url;
		return true;
  	}
}

function getMinMax(anumber, another, mod) { 
    if(mod == "max"){
		return((anumber > another) ? another : anumber);
	}else{
		return((anumber < another) ? another : anumber);
	}
}

function resizeTextArea(id, minRows, minCols, mod) { 
    var dom = xoopsGetElementById(id);	
	aktRows = dom.rows;
	aktCols = dom.cols;
	if(mod == "max"){
		dom.rows = getMinMax(aktRows + 5, minRows*2, mod); 
		dom.cols = getMinMax(aktCols + 10, minCols*2, mod); 
	}else{
		dom.rows = getMinMax(aktRows - 5, minRows, mod); 
		dom.cols = getMinMax(aktCols - 10, minCols, mod); 
	}
	dom.focus();
} 
