function check( next ) {
  var display = unescape( next );
	var msg = "Do you really want to complete this action?\n\n"
				  	+ display +
				  	"\n\nIt is not possible to reverse the action.\n";
	return confirm(msg);
}

function calcChar(fields,counters,maxLength) {
 clipped = false
 maxLength = maxLength
 
 if (fields.value.length > maxLength) {
   fields.value = fields.value.substring(0,maxLength)
   charleft = 0
   clipped = true
 } else {
   charleft = maxLength - fields.value.length
 }
   counters.value = charleft
   return clipped
}

function openTarget (form, features, windowName) {
  if (!windowName)
    windowName = 'formTarget' + (new Date().getTime());
  form.target = windowName;
  open ('', windowName, features);
}

function browse(url){
	pop=window.open(url,'browse','width=500,height=500,scrollbars=yes,resizable=yes,status=no,location=no');
	pop.focus();
}

function tr_onmouseover(element,style) {

		var style = style;
	
    var oTR = getElement(element, "TR");
    if (oTR != null && !eval(oTR.active)) {
    	if(style == 'link') {
      	oTR.style.backgroundColor = "#FFFFCC";
    	} else {
      	oTR.style.backgroundColor = "#FFFFCC";
    	}
    }
}
function tr_onmouseout(element) {
    var oTR = getElement(element, "TR");
    if (oTR != null && !eval(oTR.active)) {
        oTR.style.backgroundColor = "";
    }
}
function getElement(src, tagName) {
    var obj = src;
    while (obj != null && obj.tagName != tagName) {
        obj = obj.parentElement;
    }
    return obj;
}

function getLink(link_to) {
	window.location.href = link_to;
}

function toYellow(id) {
	document.getElementById(id).style.backgroundColor = "#FFFFCC";
	document.getElementById(id).value = '';
}

function toWhite(id) {
	document.getElementById(id).style.backgroundColor = "#FFFFFF";
}
