var xmlhttp=false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
  try {
  xmlhttp=new ActiveXObject("Msxml2.XMLHTTP")
 } catch (e) {
  try {
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
  } catch (E) {
   xmlhttp=false
  }
 }
@else
 xmlhttp=false
@end @*/
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
 try {
  xmlhttp = new XMLHttpRequest();
 } catch (e) {
  xmlhttp=false
 }
}

function toggle(id) {
	if (document.getElementById(id).style.display == 'block') {
		document.getElementById(id).style.display = 'none'
	} else {
		document.getElementById(id).style.display = 'block'
	}
}

function previsualizar(id1, id2){
	var defvalue=(arguments.length==3)?arguments[2]:''; 
	var NewText = document.getElementById(id1).value;
	if (NewText.length == 0 && defvalue.length > 0) NewText = defvalue; 
	if (NewText.length > 0) {
		splitText = NewText.split(/\n/).join("<br />");
		var DivElement = document.getElementById(id2);
		DivElement.innerHTML = splitText;
	}
}

function previsualizar_select(id1, id2){
	var Select = document.getElementById(id1);
	previsualizar(id1,id2,Select.options[Select.selectedIndex].value);
}
