function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}

var horizontal_offset="9px" //horizontal offset of hint box from anchor link

/////No further editting needed

var vertical_offset="0" //horizontal offset of hint box from anchor link. No need to change.
var ie=document.all
var ns6=document.getElementById&&!document.all

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=(whichedge=="rightedge")? parseInt(horizontal_offset)*-1 : parseInt(vertical_offset)*-1
if (whichedge=="rightedge"){
var windowedge=ie && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-30 : window.pageXOffset+window.innerWidth-40
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure+obj.offsetWidth+parseInt(horizontal_offset)
}
else{
var windowedge=ie && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetHeight
}
return edgeoffset
}

function showhint(menucontents, obj, e, tipwidth){
if ((ie||ns6) && document.getElementById("hintbox")){
dropmenuobj=document.getElementById("hintbox")
dropmenuobj.innerHTML=menucontents
dropmenuobj.style.left=dropmenuobj.style.top=-500
if (tipwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=tipwidth
}
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+obj.offsetWidth+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+"px"
dropmenuobj.style.visibility="visible"
obj.onmouseout=hidetip
}
}

function hidetip(e){
dropmenuobj.style.visibility="hidden"
dropmenuobj.style.left="-500px"
}

function createhintbox(){
var divblock=document.createElement("div")
divblock.setAttribute("id", "hintbox")
document.body.appendChild(divblock)
}

if (window.addEventListener)
window.addEventListener("load", createhintbox, false)
else if (window.attachEvent)
window.attachEvent("onload", createhintbox)
else if (document.getElementById)
window.onload=createhintbox
<!--
//Highlight form element- © Dynamic Drive (www.dynamicdrive.com)
//For full source code, 100's more DHTML scripts, and TOS,
//visit http://www.dynamicdrive.com

var highlightcolor="silver"

var ns6=document.getElementById&&!document.all
var previous=''
var eventobj

//Regular expression to highlight only form elements
var intended=/INPUT|TEXTAREA|SELECT|OPTION/

//Function to check whether element clicked is form element
function checkel(which){
if (which.style&&intended.test(which.tagName)){
if (ns6&&eventobj.nodeType==3)
eventobj=eventobj.parentNode.parentNode
return true
}
else
return false
}

//Function to highlight form element
function highlight(e){
eventobj=ns6? e.target : event.srcElement
if (previous!=''){
if (checkel(previous))
previous.style.backgroundColor=''
previous=eventobj
if (checkel(eventobj))
eventobj.style.backgroundColor=highlightcolor
}
else{
if (checkel(eventobj))
eventobj.style.backgroundColor=highlightcolor
previous=eventobj
}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' debe de contener un e-mail.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' debe contener un numero telefonico.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' debe contener un numero telefonico'+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' se requiere.\n'; }
  } if (errors) alert('Los siguiente errores han ocurrido:\n'+errors);
  document.MM_returnValue = (errors == '');
}

  

function calCarFaltan1( formulario ) {

   var maxLongitud = 100
   var libres = 100 		//si cambia este valor, debe modificarse en el atributo value de campo numero

   if ( formulario.frases.value.length > maxLongitud ) {

      formulario.frases.value = formulario.frases.value.substring(0,maxLongitud)
      libres = 0
      alert("¡Ha superado el límite!\nRecuerde que dispone de\n" + maxLongitud + " caracteres")
   } else {
      libres = maxLongitud - formulario.frases.value.length
   }
   
   formulario.numero1.value = libres
}
function calCarFaltan2( formulario ) {

   var maxLongitud = 150
   var libres = 150 		//si cambia este valor, debe modificarse en el atributo value de campo numero

   if ( formulario.descripcion.value.length > maxLongitud ) {

      formulario.descripcion.value = formulario.descripcion.value.substring(0,maxLongitud)
      libres = 0
      alert("¡Ha superado el límite!\nRecuerde que dispone de\n" + maxLongitud + " caracteres")
   } else {
      libres = maxLongitud - formulario.descripcion.value.length
   }
   
   formulario.numero2.value = libres
}
function calCarFaltan( formulario ) {

   var maxLongitud = 50
   var libres = 50 		//si cambia este valor, debe modificarse en el atributo value de campo numero

   if ( formulario.titulo.value.length > maxLongitud ) {

      formulario.titulo.value = formulario.titulo.value.substring(0,maxLongitud)
      libres = 0
      alert("¡Ha superado el límite!\nRecuerde que dispone de\n" + maxLongitud + " caracteres")
   } else {
      libres = maxLongitud - formulario.titulo.value.length
   }
   
   formulario.numero.value = libres
}
var checkobj

function agreesubmit(el){
checkobj=el
if (document.all||document.getElementById){
for (i=0;i<checkobj.form.length;i++){  //hunt down submit button
var tempobj=checkobj.form.elements[i]
if(tempobj.type.toLowerCase()=="submit")
tempobj.disabled=!checkobj.checked
}
}
}

function defaultagree(el){
if (!document.all&&!document.getElementById){
if (window.checkobj&&checkobj.checked)
return true
else{
alert("Lea y acepte los TERMINOS DE USO para enviar el Formulario")
return false
}
}
}


<!----------------
// Newsletter Email Address Validation
var submitcount=0;

function reset() {
document.emailform.reset();

}

var reqFields = new parseArray("email");
var reqFieldsDesc = new parseArray("Tu E-mail");

function parseArray() {
        this.length = parseArray.arguments.length
        for (var i = 0; i < this.length; i++) {
           this[i+1] = parseArray.arguments[i]
           } 
 }
function validEmail(email) {
   invalidChars = " £$%*?!#/:,;"
 
   if (email == "") {      
    return false
   }
   for (i=0; i<invalidChars.length; i++) { 
    badChar = invalidChars.charAt(i)
    if (email.indexOf(badChar,0) > -1) {
     return false
    }
   }
   atPos = email.indexOf("@",1)   
   if (atPos == -1) {
    return false
   }
   if (email.indexOf("@",atPos+1) != -1) {
    return false
   }
   periodPos = email.indexOf(".",atPos)
   if (periodPos == -1) {     
    return false
   }
   if (periodPos+3 > email.length) {  
    return false
   }
   return true
  }
//start of valid Recipients name  
function validname(name) {
   invalidChars = "£$%*?!#/:,;1234567890"
 
   if (recip_name == "") {      
    return false
   }
  for (i=0; i<invalidChars.length; i++) { 
    badChar = invalidChars.charAt(i)
    if (name.indexOf(badChar,0) > -1) {
     return false
    }
   }
   return true
  } 

// start of valid form  
function validForm(obj) {
    var errMsg = '';    
    var x = 0;

   for (x = 1; reqFields.length >= x ; x++) {

  if ((obj.elements[reqFields[x]].value == '') || (obj.elements[reqFields[x]].value == ' ')) {
  errMsg = errMsg + '' + reqFieldsDesc[x] + ' se requiere.\n';
            }
    }  

  if (errMsg != '') {
    errMsg = 'La suscripción a nuestro BOLETIN ELECTRONICO no es posible:\n\n' + errMsg + '\nPor Favor chequea si el email esta correcto';
    alert(errMsg); 
    return false;
  } 


//Email Validation Check
 if (!validEmail(obj.email.value)) {
    alert("Necesitas un email correcto para recibir nuestro BOLETIN ELECTRONICO")
    obj.email.focus()
    obj.email.select()
    return false
   }  
   if (submitcount == 0)
      {
      submitcount++;
      return true;
      }
   else 
      {
      alert("Este formulario ya se ha enviado.");
      return false;
      }  
return true
}

//------------------------------>

