function insertTag(frmElm,startTag,endTag) {
       if (typeof frmElm.selectionStart == "number") {
             selectedtext = startTag+frmElm.value.substring(frmElm.selectionStart,frmElm.selectionEnd)+endTag;
             frmElm.value = frmElm.value.substring(0,frmElm.selectionStart)+selectedtext+frmElm.value.substr(frmElm.selectionEnd);
       }
       else if (document.selection) {
               frmElm.focus();
               r = document.selection.createRange();
               r.text = startTag+r.text+endTag;}
       else frmElm.value += startTag+endTag;
}

function insertLinkTag(frmElm) {
      strHref = prompt("Indtast adressen til den side du vil lave et link til. Husk http://","http://");
	    if (!strHref){
            return false;
		}
		else if(strHref == "" || strHref == "http://"){
            alert('Fejl: Intet link er indtastet');
            return false;
      }
      if (frmElm.selectionStart != undefined && frmElm.selectionEnd != undefined) {
            selectedtext = "<a href='" + strHref + "' title='" +frmElm.value.substring(frmElm.selectionStart,frmElm.selectionEnd)+ "'>"+frmElm.value.substring(frmElm.selectionStart,frmElm.selectionEnd)+"</a>";
            frmElm.value = frmElm.value.substring(0,frmElm.selectionStart)+selectedtext+frmElm.value.substr(frmElm.selectionEnd);
      }
      else if (document.selection) {frmElm.focus();r = document.selection.createRange();r.text = "<a href='" + strHref + "' title='" + r.text + "'>" +r.text+"</a>";}
      else frmElm.value += "<a href='" + strHref + "' title='" + strHref + "'></a>";
}

function popup(url) {
    popup = window.open(url,'infopopup','width=400,height=250,top=250,left=150,noresize');
    popup.focus();
}


function tjek(f) {
ind = f.Form1Start.selectedIndex;
f.Form2Start.disabled = (ind != 0) ? false : true;
}