/*<![CDATA[*/
// #_# DETECT NAVIGATOR TYPE
var nuA   = navigator.userAgent;

var M2    = (nuA.indexOf("Mozilla/2") != -1);
var M3    = (nuA.indexOf("Mozilla/3") != -1);
var M4    = (nuA.indexOf("Mozilla/4") != -1);
var M5    = (nuA.indexOf("Mozilla/5") != -1);

var OP    = (nuA.indexOf("Opera") != -1);
var OP3   = (nuA.indexOf("Opera/3") != -1) && M3;
var OP35  = (nuA.indexOf("Opera/3") != -1) && M4;
var OP36  = (nuA.indexOf("Opera 3") != -1) && M4;
var OP4   = (nuA.indexOf("Opera 4") != -1) || (nuA.indexOf("Opera/4") != -1);
var OP5   = (nuA.indexOf("Opera 5") != -1) || (nuA.indexOf("Opera/5") != -1);
var OP6   = (nuA.indexOf("Opera 6") != -1) || (nuA.indexOf("Opera/6") != -1);
var OP7   = (nuA.indexOf("Opera 7") != -1) || (nuA.indexOf("Opera/7") != -1);
var OP8   = (nuA.indexOf("Opera 8") != -1) || (nuA.indexOf("Opera/8") != -1);
var OP9   = (nuA.indexOf("Opera 9") != -1) || (nuA.indexOf("Opera/9") != -1);

var IE    = (nuA.indexOf("MSIE") != -1) && !OP;
var IE3   = (nuA.indexOf("MSIE 3") != -1);
var IE4   = (nuA.indexOf("MSIE 4") != -1);
var IE50  = (nuA.indexOf("MSIE 5.0") != -1) && !OP;
var IE55  = (nuA.indexOf("MSIE 5.5") != -1) && !OP;
var IE60  = (nuA.indexOf("MSIE 6.0") != -1) && !OP;
var IE70  = (nuA.indexOf("MSIE 7.0") != -1) && !OP;

var GECKO = (nuA.indexOf("Gecko") != -1);
var MOZ   = GECKO && (nuA.indexOf("Netscape") == -1) &&
            (nuA.indexOf("Firefox") == -1);
var MOZ1  = MOZ && (nuA.indexOf("rv:1") != -1);

var FF    = (nuA.indexOf("Firefox") != -1);
var FF10  = (nuA.indexOf("Firefox/1.0") != -1);
var FF15  = (nuA.indexOf("Firefox/1.5") != -1);
var FF20  = (nuA.indexOf("Firefox/2.0") != -1);

var NN    = (navigator.appName == "Netscape") && !OP && !MOZ;
var NN2   = NN && M2;
var NN3   = NN && M3;
var NN4   = NN && M4;
var NN6   = (nuA.indexOf("Netscape6") != -1);
var NN7   = (nuA.indexOf("Netscape/7") != -1);
var NN8   = (nuA.indexOf("Netscape/8") != -1);

// #_# CREATE POPUPWINDOW
function PopupVenster( Pagina, Titel, Breed, Hoog, Scroll, winObj)
{
	var venster = null;
	var Pagina;
	var Titel;
	var Breed;
	var Hoog;
	var Scroll;


    // first check to see if the window already exists
    if (winObj != null) {
          // the window has already been created, but did the user close it?
          // if so, then reopen it. Otherwise make it the active window.
          if (!winObj.closed) {
            winObj.focus();
            return winObj;
        }
      // otherwise fall through to the code below to re-open the window
    }

	VanafLinks = (screen.width)? (screen.width-Breed) /2 : 0;
	VanafBoven = (screen.height)?(screen.height-Hoog)/2 : 0;
	instellingen = 'height='+Hoog+',width='+Breed+',top='+VanafBoven+',left='+VanafLinks+', scrollbars=' + Scroll + ' ,directories=' + 0 + ', location=' + 0 + ', menubar=' + 0 + ', resizable=' + 0 + ', status=' + 0 + ', toolbar='+ 0 + ' '
	venster = window.open(Pagina,Titel,instellingen);
    return venster;
}

// Double klik for top page ==================================================== //
var goto_top_type = -1;
var goto_top_itv = 0;

function goto_top_timer() {
    var y = goto_top_type == 1 ? document.documentElement.scrollTop : document.body.scrollTop;
    //alert(y);
    var moveby = 20; // set this to control scroll seed. minimum is fast

    y -= Math.ceil(y * moveby / 100);
    if (y < 0)
    y = 0;

    if (goto_top_type == 1)
    document.documentElement.scrollTop = y;
    else
    document.body.scrollTop = y;

    if (y == 0) {
        clearInterval(goto_top_itv);
        goto_top_itv = 0;
    }
}

function goto_top() {
    if (goto_top_itv == 0) {
        if (document.documentElement && document.documentElement.scrollTop)
        goto_top_type = 1;
        else if (document.body && document.body.scrollTop)
        goto_top_type = 2;
        else
        goto_top_type = 0;

        if (goto_top_type > 0)
        goto_top_itv = setInterval('goto_top_timer()', 25);
    }
}
function dblclick() {
	goto_top();
}
if (document.layers) {
	document.captureEvents(Event.ONDBLCLICK);
}
document.ondblclick=dblclick;

// Swap an images on the same place  =========================================== //
    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_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_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];}
    }

// BLOCK MOUSE ACTIONS ========================================================= //
//    if(window.event)
//        document.captureEvents(Event.MOUSEUP);
        // No content menu ========================================================= //
//        function nocontextmenu(){
//            event.cancelBubble = true
//            event.returnValue = false;
//            return false;
//        }
//        document.oncontextmenu = nocontextmenu;

//        function disableselect(e){
//            return false
//        }

//        function reEnable(){
//            return true
 //       }

//        document.onselectstart=new Function ("return false")
//        if (window.sidebar){
//            document.onmousedown=disableselect
//            document.onclick=reEnable
//        }

// END BLOCK MOUSE ACTIONS ===================================================== //

// No right click ============================================================== //
//function disableRightClick(e)
//{
//  var message = "Right click don't works...\n\n                           ....but Glimpse works fine!!!    ";

//  if(!document.rightClickDisabled) // initialize
//  {
//    if(document.layers)
//    {
//      document.captureEvents(Event.MOUSEDOWN);
//      document.onmousedown = disableRightClick;
//    }
//    else document.oncontextmenu = disableRightClick;
//    return document.rightClickDisabled = true;
//  }
//  if(document.layers || (document.getElementById && !document.all))
//  {
 //   if (e.which==2||e.which==3)
 //   {
//      alert(message);
//      return false;
//    }
//  }
//  else
//  {
 //   alert(message);
 //   return false;
 // }
//}
//disableRightClick();

// #_# BLINK ID blink ========================================================== //
function BlinkOnOff(){
    document.getElementById('blink').style.visibility = (document.getElementById('blink').style.visibility == "hidden") ? "visible" : "hidden";
}
function Knipper(){
    setInterval('BlinkOnOff()',500);
}

// #_# REPLACE ENTERS IN FORM TO <br>  ========================================= //
function ReplRN(f){
    f.bericht.value = f.bericht.value.replace(/\r\n/g, "<br>");
}

function ReplRN(f){
    f.bericht.value = f.bericht.value.replace(/\r\n/g, "<br>");
}

function GetMonth(Mnd){
    switch(Mnd)
	{
		case 1:
			return "januari";
			break;
		case 2:
			return "februari";
			break;
		case 3:
			return "maart";
			break;
		case 4:
			return "april";
			break;
		case 5:
			return "mei";
			break;
		case 6:
			return "juni";
			break;
		case 7:
			return "juli";
			break;
		case 8:
			return "augustus";
			break;
		case 9:
			return "september";
			break;
		case 10:
			return "oktober";
			break;
		case 11:
			return "november";
			break;
		case 12:
			return "december";
			break;
		}
}

// #_# VALIDATE SPAMCODE ================================================= //
function validatespamcode(f){
    var temp;
    var usrenter;
    usrenter = false;
    temp = f.spamcode.value.toUpperCase();
    lang = temp.length;
    if(temp.indexOf("\r\n") > -1){
        usrenter = true;
        temp = temp.replace(/\r\n/g, "");
    }
    if(temp.indexOf("\r") > -1){
        usrenter = true;
        temp = temp.replace(/\r/g, "");
    }
    if(temp.indexOf("\n") > -1){
        usrenter = true;
        temp = temp.replace(/\n/g, "");
    }
    if(lang > 5){
        temp = temp.substr(0,5);
    }
    f.spamcode.value = temp
    lang = temp.length;
    if(lang == 5 && usrenter == true ) {
        f.contact.focus();
    }
}

function Input2upper(f){
    f.spamcode.value = f.spamcode.value.toUpperCase();
}
/*]]>*/
