
function putFocus(formInst, elementInst) {
  if (document.forms.length > 0) {
   document.forms[formInst].elements[elementInst].focus();
  }
}
 
 
 
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

// functie voor Historie
function mm_back() {
window.history.go(-1);
}
// functie voor openen in nieuw window via javascript met eventueel een melding erbij..
function popUp(URL,msg) {
day = new Date();
id = day.getTime();
if (msg != '' ) alert(msg);
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=1,scrollbars=1,location=0,statusbar=yes,menubar=1,resizable=1,width=800,height=500');");
}

function jumpTo(Page,URL_List){
   var URL = URL_List.options[URL_List.selectedIndex].value;
   window.location.href = Page+URL;
}


function CountWords (this_field, show_word_count, show_char_count,wordfield,charfield) {
if (show_word_count == null) { show_word_count = true; }
if (show_char_count == null) { show_char_count = false; }
var char_count = this_field.value.length;
var fullStr = this_field.value + " ";
var initial_whitespace_rExp = /^[^A-Za-z0-9]+/gi;
var left_trimmedStr = fullStr.replace(initial_whitespace_rExp, "");
var non_alphanumerics_rExp = rExp = /[^A-Za-z0-9]+/gi;
var cleanedStr = left_trimmedStr.replace(non_alphanumerics_rExp, " ");
var splitString = cleanedStr.split(" ");
var word_count = splitString.length -1;
if (fullStr.length <2) { word_count = 0; }
if (word_count == 1) { wordOrWords = " woord"; }
else { wordOrWords = " woorden"; }
if (char_count == 1) { charOrChars = " karakter"; } 
else { charOrChars = " karakters"; }
if (show_word_count & show_char_count) { 
charfield.value = char_count;
wordfield.value = word_count;
//alert(this_field);
//alert ("Aantal:\n" + "    " + word_count + wordOrWords + "\n" + "    " + char_count + charOrChars);
}
else {
	if (show_word_count) { alert ("Aantal woorden:  " + word_count + wordOrWords); }
	else {	if (show_char_count) { alert ("Aantal karakters:  " + char_count + charOrChars); }
	}
}
return word_count;
}


function Show_Help_Pane(Pane)
{ /* get the mouse left position */
//  x = event.clientX + document.body.scrollLeft+10;
  x = document.body.scrollLeft+10;
  /* get the mouse top position  */
//  y = event.clientY + document.body.scrollTop - 50;
  y = document.body.scrollTop + 10;
  /* display the pop-up */
  document.getElementById(Pane).style.display="block";
  /* set the pop-up's left */
  document.getElementById(Pane).style.left = x;
  /* set the pop-up's top */
  document.getElementById(Pane).style.top = y;
}
/* this function hides the pop-up when
user moves the mouse out of the link */
function Hide_Help_Pane(Pane)
{ /* hide the pop-up with a delay*/
  t = 2500;
  setTimeout("document.getElementById('"+Pane+"').style.display='none'" , t)
//  setTimeout("updateClock('"+id+"')",1000,"JavaScript")

  //document.getElementById(Pane).style.display="none";
}

function str_replace(str,stra,strb) 
{  while(str.indexOf(stra)!=-1) 
     { str=str.replace(stra,strb); 
     } 
   return str; 
}

function popupPage(page) {
var windowprops = "toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,left=300,top=300,width=500,height=500";
var website = "../Libraries/Help_popup.php?page="+page;
popup = window.open(website,"MenuPopup",windowprops);
}


function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

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_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


<!-- Key Launcher -->
keyBuffer = "";
var key = new Array();  // Define jump-key pages here
var name = new Array();  // Define jump-key name pages here
key['fwpub'] = "Adminpages.php";   name['fwpub'] = "Inloggen FW Publisher";
key['stats'] = "../../bbclone/index.php"; name ['stats'] = "Statistieken van uw website"


function getKeySite(keyStroke) {
isNetscape=(document.layers);
eventChooser = (isNetscape) ? keyStroke.which : event.keyCode;
which = String.fromCharCode(eventChooser).toLowerCase();
keyBuffer += which;
//window.status = "keyBuffer='" + keyBuffer + "'";
for (var i in key) if (keyBuffer == i) {
window.location = key[i];
keyBuffer = ""; // clear buffer
}
var matches = 0;
var kbLength = keyBuffer.length;
for (var i in key) if (keyBuffer == i.substr(0,kbLength)) matches++;
if (matches == 0)  {
//window.status = "No match on '" + keyBuffer + "'.";
keyBuffer = "";// clear buffer
   }
}
document.onkeypress = getKeySite; 


var panes = new Array();
function setupPanes(containerId, defaultTabId) {
  // go through the DOM, find each tab-container
  // set up the panes array with named panes
  // find the max height, set tab-panes to that height
  panes[containerId] = new Array();
  var maxHeight = 0; var maxWidth = 0;
  var container = document.getElementById(containerId);
  var paneContainer = container.getElementsByTagName("div")[0];
  var paneList = paneContainer.childNodes;
  for (var i=0; i < paneList.length; i++ ) {
    var pane = paneList[i];
    if (pane.nodeType != 1) continue;
    if (pane.offsetHeight > maxHeight) maxHeight = pane.offsetHeight;
    if (pane.offsetWidth  > maxWidth ) maxWidth  = pane.offsetWidth;
    panes[containerId][pane.id] = pane;
    pane.style.display = "none";
  }
    paneContainer.style.height = maxHeight-120 + "px";
    paneContainer.style.width  = maxWidth-120 + "px";
    document.getElementById(defaultTabId).onclick();
}

function showPane(paneId, activeTab) {
  // make tab active class
  // hide other panes (siblings)
  // make pane visible
  
    for (var con in panes) {
    activeTab.blur();
    activeTab.className = "tab-active";
    if (panes[con][paneId] != null) { // tab and pane are members of this container
      var pane = document.getElementById(paneId);
      pane.style.display = "block";
      var container = document.getElementById(con);
      var tabs = container.getElementsByTagName("ul")[0];
      var tabList = tabs.getElementsByTagName("a")
      for (var i=0; i<tabList.length; i++ ) {
        var tab = tabList[i];
        if (tab != activeTab) tab.className = "tab-disabled";
      }
      for (var i in panes[con]) {
        var pane = panes[con][i];
        if (pane == undefined) continue;
        if (pane.id == paneId) continue;
        pane.style.display = "none"
      }
    }
  }
  return false;    
}

var temp="";
function showhide(layer){

if(temp!=""){
var style2= document.getElementById(temp).style;
style2.visibility="hidden";
}

var whichLayer=layer;
var style2 = document.getElementById(whichLayer).style;
style2.visibility="visible";

temp=whichLayer
}

function showDIV(id){ 
if (document.getElementById){ 
obj = document.getElementById(id); 
if (obj.style.display == "none"){ 
obj.style.display = ""; 
} else { 
obj.style.display = "none"; 
} 
} 
} 
//  End -->
