
function zoomText(Accion,Elemento){
//inicializacion de variables y parámetros 
var obj=document.getElementById(Elemento);
var max = 130 //tamaño máximo del fontSize
var min = 110 //tamaño mínimo del fontSize
if (obj.style.fontSize==""){
obj.style.fontSize="100%";
}
actual=parseInt(obj.style.fontSize); //valor actual del tamaño del texto 
incremento=10;// el valor del incremento o decremento en el tamaño 

//accion sobre el texto 
if( Accion=="reestablecer" ){
obj.style.fontSize="100%"
}
if( Accion=="aumentar" && ((actual+incremento) <= max )){
valor=actual+incremento;
obj.style.fontSize=valor+"%"
}
if( Accion=="disminuir" && ((actual+incremento) >= min )){
valor=actual-incremento;
obj.style.fontSize=valor+"%"
}
} 




function instag(tag){
var input = document.form1.texto;
//para mac
if(typeof document.selection != 'undefined' && document.selection) {
var str = document.selection.createRange().text;
input.focus();
var sel = document.selection.createRange();
sel.text = "[" + tag + "]" + str + "[/" +tag+ "]";
return;
}else if(typeof input.selectionStart != 'undefined'){
var start = input.selectionStart;
var end = input.selectionEnd;
var insText = input.value.substring(start, end);
input.value = input.value.substr(0, start) + '['+tag+']' + insText + '[/'+tag+']'+ input.value.substr(end);
return;
}else{
  input.value+=' ['+tag+']Reemplace este texto[/'+tag+']';
  return;
}
}

function inslink(){
var input = document.form1.texto;
if(typeof document.selection != 'undefined' && document.selection) {
var str = document.selection.createRange().text;
  input.focus();
  var my_link = prompt("Enter URL:","http://");
  if (my_link != null) {
    var sel = document.selection.createRange();
    sel.text = "[enlace] " + my_link + "[>]" + str + "[/enlace]";
  }
  return;
}else if(typeof input.selectionStart != 'undefined'){
var start = input.selectionStart;
var end = input.selectionEnd;
var insText = input.value.substring(start, end);
var my_link = prompt("Enter URL:","http://");
if (my_link != null) {
input.value = input.value.substr(0, start) +"[a href=\"" + my_link + "\"]" + insText  + "[/a]"+ input.value.substr(end);
}
return;
}else{
var my_link = prompt("Ingresar URL:","http://");
var my_text = prompt("Ingresar el texto del link:","");
input.value+= "[enlace] " + my_link + "[>]" + my_text + "[/enlace]";
return;
}
}


function instag2(tag){
var input = document.form1.requisitos;
//para mac
if(typeof document.selection != 'undefined' && document.selection) {
var str = document.selection.createRange().text;
input.focus();
var sel = document.selection.createRange();
sel.text = "[" + tag + "]" + str + "[/" +tag+ "]";
return;
}else if(typeof input.selectionStart != 'undefined'){
var start = input.selectionStart;
var end = input.selectionEnd;
var insText = input.value.substring(start, end);
input.value = input.value.substr(0, start) + '['+tag+']' + insText + '[/'+tag+']'+ input.value.substr(end);
return;
}else{
  input.value+=' ['+tag+']Reemplace este texto[/'+tag+']';
  return;
}
}

function inslink2(){
var input = document.form1.requisitos;
if(typeof document.selection != 'undefined' && document.selection) {
var str = document.selection.createRange().text;
  input.focus();
  var my_link = prompt("Enter URL:","http://");
  if (my_link != null) {
    var sel = document.selection.createRange();
    sel.text = "[enlace] " + my_link + "[>]" + str + "[/enlace]";
  }
  return;
}else if(typeof input.selectionStart != 'undefined'){
var start = input.selectionStart;
var end = input.selectionEnd;
var insText = input.value.substring(start, end);
var my_link = prompt("Enter URL:","http://");
if (my_link != null) {
input.value = input.value.substr(0, start) +"[a href=\"" + my_link + "\"]" + insText  + "[/a]"+ input.value.substr(end);
}
return;
}else{
var my_link = prompt("Ingresar URL:","http://");
var my_text = prompt("Ingresar el texto del link:","");
input.value+= "[enlace] " + my_link + "[>]" + my_text + "[/enlace]";
return;
}
}


function instag3(tag){
var input = document.form1.precios;
//para mac
if(typeof document.selection != 'undefined' && document.selection) {
var str = document.selection.createRange().text;
input.focus();
var sel = document.selection.createRange();
sel.text = "[" + tag + "]" + str + "[/" +tag+ "]";
return;
}else if(typeof input.selectionStart != 'undefined'){
var start = input.selectionStart;
var end = input.selectionEnd;
var insText = input.value.substring(start, end);
input.value = input.value.substr(0, start) + '['+tag+']' + insText + '[/'+tag+']'+ input.value.substr(end);
return;
}else{
  input.value+=' ['+tag+']Reemplace este texto[/'+tag+']';
  return;
}
}

function inslink3(){
var input = document.form1.precios;
if(typeof document.selection != 'undefined' && document.selection) {
var str = document.selection.createRange().text;
  input.focus();
  var my_link = prompt("Enter URL:","http://");
  if (my_link != null) {
    var sel = document.selection.createRange();
    sel.text = "[enlace] " + my_link + "[>]" + str + "[/enlace]";
  }
  return;
}else if(typeof input.selectionStart != 'undefined'){
var start = input.selectionStart;
var end = input.selectionEnd;
var insText = input.value.substring(start, end);
var my_link = prompt("Enter URL:","http://");
if (my_link != null) {
input.value = input.value.substr(0, start) +"[a href=\"" + my_link + "\"]" + insText  + "[/a]"+ input.value.substr(end);
}
return;
}else{
var my_link = prompt("Ingresar URL:","http://");
var my_text = prompt("Ingresar el texto del link:","");
input.value+= "[enlace] " + my_link + "[>]" + my_text + "[/enlace]";
return;
}
}






