                                                                                                                                         // Static Javascript Library

  function unmask_email(name,domain) {
    document.location.href = "mailto:"+name+"@"+domain;
  }
  
	function displayElement(elmid,disp) {
		var elm = document.getElementById(elmid);
		elm.style.display = disp;
	}
	
	function flipup(elmid, disp) {
		var elm = document.getElementById(elmid);
		if (elm.style.display == disp) {
			elm.style.display = "none";
		} else {
			elm.style.display = disp;
		}
		for(elm in flips) {
			if (flips[elm] != elmid) 
				document.getElementById(flips[elm]).style.display = "none";
		}
			
	}
  
  function mask_info() {
    alert('DE STRIJD TEGEN SPAM!!!\n\nDeze website vermomt emailadressen\nzodat ze niet door email-verzamelende\nprogramma\'s gevonden kunnen worden.\nJe kunt dus rustig je echte email gebruiken.\n\nAlleen menselijke bezoekers van deze\npagina kunnen je een emailtje sturen.\n\nGroetjes, Marieke.');
  }

  function storeCaret(text) { 
  	if (text.createTextRange) text.caretPos = document.selection.createRange().duplicate();
  	//alert("test - " + text.caretPos);
  }

  function AddSelText(elm, bbopen, bbclose) {
  	if (elm.caretPos) elm.caretPos.text = bbopen + elm.caretPos.text + bbclose;
  	else elm.value += bbopen + bbclose;
  	elm.focus();
  }

  function switchLanguage(lg) {
  // functie aanpassen bij wijzigingen in de framesets
    if (top.main && top.menu) {
      vID = top.main.reloadForm.pageID.value;
      vFocus = top.menu.reloadForm.focus.value;
      url = "index.php?pageID=frameset&nextID="+vID+"&focus="+vFocus+"&switchlanguage="+lg;
      top.location.href = url;
    }
  }

  function areahref(targetUrl,targetFrame) {
    tf = eval("top."+targetFrame);
    tf.location.href = targetUrl;
  }

  function areYouSure(question,yeslocation) {
    if (confirm(question)) document.location.href=yeslocation;
  }

  function clearme(form,iput,def) {
    e = eval("document."+form+"."+iput);
    if (e.value == def) e.value="";
  }

  function setme(form,iput,def) {
    e = eval("document."+form+"."+iput);
    if (e.value=="") e.value=def;
  }

  function clearme2(iput,def) {
    if (iput.value == def) iput.value="";
  }

  function setme2(iput,def) {
    if (iput.value=="") iput.value=def;
  }
  // value="#" onFocus="clearme('topicuser','#')"  onBlur="setme('topicuser','#')"

	function popupImgnDesc2(imgurl) {
	  var openurl = "index.php?pageID=galleryzoom&imgurl="+imgurl;
	  var options = "locationbar=no,menubar=no,top=10,left=10,status=no,resizable=yes,WIDTH=100,HEIGHT=30";
	  window.open(openurl,"",options);
	}

	function popupImgnDesc3(imgurl, imgversion) {
	  var openurl = "index.php?pageID=galleryzoom&imgurl="+imgurl+"&imgversion="+imgversion;
	  var options = "locationbar=no,menubar=no,top=10,left=10,status=no,resizable=yes,WIDTH=100,HEIGHT=30";
	  window.open(openurl,"",options);
	}

  dateElm = "";
  dateShow = "";

  function getDateWindow(iPut,iShow,iFormElm) {
    dateElm = iPut;
    url = "popup.date.php?opener_input="+iPut+"&opener_show="+iShow+"&opener_isformelm="+iFormElm;
    waebdateWindow = open(url,"","locationbar=no,menubar=no,status=no,resizable=yes,width=215,height=211");
    waebdateWindow.focus();
  }

  function sprintf_02d(num) {
    if (num < 10) return "0"+num;
    else return num;
  }

  function dateElm2Show() {
    srcObj = eval(dateElm);
    muts = parseFloat(srcObj)*1000; // millisecond unix timestamp.
    aDate = new Date(muts);
    day = sprintf_02d(aDate.getDate());
    month = sprintf_02d(aDate.getMonth() + 1);
    year = aDate.getFullYear();
    dateShow = day +"."+ month +"."+ year;
  }

  function updateDate(id,isFormElm) {
    dateElm2Show();
    if (isFormElm) {
      tgObj = eval(id);
      tgObj.value = dateShow;
    } else {
      tgObj = eval("document.all."+id);
      tgObj.innerHTML = dateShow;
    }
  }

  function openBrowser(inputTarget, dirFetch, dirSelected) {
    webbrowser = window.open("popup.browser.php?xInput="+inputTarget+"&dirFetch="+dirFetch+"&dirSelected="+dirSelected,"webbrowser","height=200, width=400");
  }

  function openBrowser_v2(inputTargetId, dirFetch, dirSelected) {
    webbrowser = window.open("popup.browser.php?idInput="+inputTargetId+"&dirFetch="+dirFetch+"&dirSelected="+dirSelected,"webbrowser","height=200, width=400");
  }

  function openAny(url,x,y) {
    window.open(url,"","height="+y+", width="+x+", resizable, status=yes, scrollbars=yes");
  }

  function fitWindow(element) {
  	var newx = element.clientWidth+30;
  	var newy = element.clientHeight+60;
  	if (newy > 768) newy = 768;
    window.resizeTo(newx,newy);
  }

  function showtext(id,tekst){
      id.innerHTML=tekst;
  }

  function hidetext(id){
      id.innerHTML="";
  }

	function popupThumb(image) {
	  window.open("popupFull.php?img="+image,"","locationbar=no,menubar=no,top=100,left=100,status=no,resizable=yes,WIDTH=100,HEIGHT=30")
	}

  function formatHelp() {
    /*
Formatting

By inserting certain characters in the text, you can format text.
Formatting includes bold and italic, indents, bullet lists, website-
and emailaddresses.

[[ bold ]]\t\tUse double brackets for bold text
{{ italic }}\t\tUse double accolades for italic text.
>> indented <<\tUse double tags for indented text.
123. \tUse the combination: number, period, space
for numbered lists.
*\t\tUse stars for bullet-lists

Websites and emailadresses will automatically be recognized.
    */

    m = "F O R M A T T I N G\n\n\tTekstbewerkingen zoals bold, italic en dergelijke zijn niet als\n\tzodanig zichtbaar in dit bewerkingsvenster, maar worden getoond op de uiteindelijke internetpagina.";

    alert(m);
  }
