function placeholderSetup(id) {
  var el=document.getElementById(id);
  if(!el) return;
  if(el.type=='search') return;

  var ph=el.getAttribute("alt");
  if (!ph||ph=="") {
    ph=el.getAttribute("placeholder");
  }
  if(!ph||ph=="") return;
  if(el.value==ph) el.value="";
  el.is_focused=(el.value!="");
  if(!el.is_focused){
    el.value=ph;el.style.color='#000000';
    el.is_focused=0;
  }
  //addEventBase(el,'focus',placeholderFocus);
  //addEventBase(el,'blur',placeholderBlur);
}

function placeholderFocus() {
  if(!this.is_focused) {
    this.is_focused=1;
    this.value='';
    this.style.color='#000';
    var rs=this.getAttribute("radioselect");
    if(rs&&rs!="") {
      var re=document.getElementById(rs);
      if(!re) {
	return;
      }
      if(re.type!='radio') return;
      re.checked=true;
    }
  }
}

function placeholderBlur() {
  var ph=this.getAttribute("alt");
  if (!ph||ph=="") {
    ph=this.getAttribute("placeholder");
  }
  if(this.is_focused&&ph&&this.value=="") {
    this.is_focused=0;
    this.value=ph;
    this.style.color='#777';
  }
}


var checkeditems2
  var message2
  var fieldtofocus2

  function isMailReady2(quickservice) {
    var passed = true;
    fieldtofocus2 = "";
    message2 ="Du mangler informasjon i følgende felt: \n"

      if (!document.quickservice.Regnummer.value || document.quickservice.Regnummer.value == "" || document.quickservice.Regnummer.value == "Regnummer") {
	message2 += "- - Regnummer \n";
	passed = false;
	if (fieldtofocus2 == "") {
	  fieldtofocus2 = document.quickservice.Regnummer;
	}
      }


    if (document.quickservice.Email.value && document.quickservice.Email.value.indexOf("@") + "" != "-1" && document.quickservice.Email.value.indexOf(".") + "" != "-1" && document.quickservice.Email.value != "") {
    } else {
      message2 += "- - Epost er ufullstendig \n";
      passed = false;
      if (fieldtofocus2 == "") {
	fieldtofocus2 = document.quickservice.Email
      }
    }
    if (!document.quickservice.Telefon.value || document.quickservice.Telefon.value == "" || document.quickservice.Telefon.value == "Telefon") {
      message2 += "- - Telefon \n";
      passed = false;
      if (fieldtofocus2 == "") {
	fieldtofocus2 = document.quickservice.Telefon;
      }
    }
    if (!document.quickservice.Melding.value || document.quickservice.Melding.value == "") {
      message2 += "- - Sted \n";
      passed = false;
      if (fieldtofocus2 == "") {
	fieldtofocus2 = document.quickservice.Melding;
      }
    }

    if (passed == false) {
      fixFieldInfo2(message2, fieldtofocus2);
    }

    return passed;
  }

function fixFieldInfo2(message2, fieldtofocus2) {
  alert(message2);
  fieldtofocus2.focus();
}


