window.onload = function() {

    //window.moveTo(0,0);
    //window.resizeTo(screen.availWidth,screen.availHeight);
    //window.resizeTo(1024,768);
    //window.focus();

    var busca = document.getElementById('ctl00_controlMenuLateral_txb_buscadorLeft');
    if (!busca){
        //alert("El textbox de Buscador no existe");
    } 
    else {
        applyDefaultValueBusca(document.getElementById('ctl00_controlMenuLateral_txb_buscadorLeft'), 'O escribe tu b\u00FAsqueda r\u00E1pida aqu\u00ED'); 
        //alert("textbox Buscador existe");
    }

    var Responde = document.getElementById('ctl00_controlMenuLateral_txb_respondeLeft');
    if (!Responde){
        //alert("El textbox de -Calleja Responde- no existe");
    } 
    else {
        //alert("textbox -Calleja Responde- existe");
        applyDefaultValue(document.getElementById('ctl00_controlMenuLateral_txb_respondeLeft'), 'Escribe aqu\u00ED tu pregunta. \u00A0 \u00A0 \u00A0 \u00A0 \u00A0 \u00A0 Te responderemos en 24 horas.'); 
        //applyDefaultValue(document.getElementById('ctl00_User1_tbPassword'), '1'); 
    }

    var BuscaModeloMoto = document.getElementById('ctl00_controlMenuLateral_tbMarcaModeloMoto');
    if (!BuscaModeloMoto) {
        //alert("El textbox de -Calleja Responde- no existe");
    }
    else {
        //alert("textbox -Calleja Responde- existe");
        applyDefaultValueBuscaModeloMoto(document.getElementById('ctl00_controlMenuLateral_tbMarcaModeloMoto'), 'Escribe aqu\u00ED');
        //applyDefaultValue(document.getElementById('ctl00_User1_tbPassword'), '1'); 
    }

    var BuscaModeloMotoMail = document.getElementById('ctl00_controlMenuLateral_tbMailMoto');
    if (!BuscaModeloMotoMail) {
        //alert("El textbox de -Calleja Responde- no existe");
    }
    else {
        //alert("textbox -Calleja Responde- existe");
        applyDefaultValueBuscaModeloMotoMail(document.getElementById('ctl00_controlMenuLateral_tbMailMoto'), 'Escribe aqu\u00ED tu mail');
        //applyDefaultValue(document.getElementById('ctl00_User1_tbPassword'), '1'); 
    }
}


function applyDefaultValueBusca(elem, val) { 
    elem.style.color = '#999999'; 
    elem.value = val;
    elem.onfocus = function () {
        if (this.value == val) {
            this.style.color = '';
            //this.style.fontSize = '1.2em';
            this.style.fontWeight = 'bold';
            this.value = ''; //On focus, make blank 
        }
    } 
    elem.onblur = function() { 
        if(this.value == '') {
            this.style.color = '#999999';
            //this.style.fontSize = '0.9em';
            this.style.fontWeight = 'normal';
            this.value = val; //If it's not in focus, use declared value 
        } 
    } 
}


function applyDefaultValue(elem2, val2) { 
  elem2.style.color = '#848484'; 
  elem2.value = val2; 
  elem2.onfocus = function() { 
    if(this.value == val2) { 
      this.style.color = ''; 
      this.value = ''; //On focus, make blank 
    } 
  } 
  elem2.onblur = function() { 
    if(this.value == '') { 
      this.style.color = '#848484'; 
      this.value = val2; //If it's not in focus, use declared value 
    } 
  } 
}


function applyDefaultValueBuscaModeloMoto(elem, val) {
    elem.style.color = '#999999';
    elem.value = val;
    elem.onfocus = function () {
        if (this.value == val) {
            this.style.color = '';
            //this.style.fontSize = '1.2em';
            this.style.fontWeight = 'bold';
            this.value = ''; //On focus, make blank 
        }
    }
    elem.onblur = function () {
        if (this.value == '') {
            this.style.color = '#999999';
            //this.style.fontSize = '0.9em';
            this.style.fontWeight = 'normal';
            this.value = val; //If it's not in focus, use declared value 
        }
    }
}


function applyDefaultValueBuscaModeloMotoMail(elem2, val2) {
    elem2.style.color = '#848484';
    elem2.value = val2;
    elem2.onfocus = function () {
        if (this.value == val2) {
            this.style.color = '';
            this.value = ''; //On focus, make blank 
        }
    }
    elem2.onblur = function () {
        if (this.value == '') {
            this.style.color = '#848484';
            this.value = val2; //If it's not in focus, use declared value 
        }
    }
}



function Muestra(subm){	
	document.getElementById(subm).style.display ="block";
}
function Oculta(subm){
	document.getElementById(subm).style.display ="none";
}



    

