//---------------------------------------------------------

var Nwin = null;

function openWin(theUrl,winW,winH,options){ // alles behalve theUrl is optioneel, anders worden default waarden gebruikt(800x600)

	if(!winW&&!winH){ winW=800;winH=600; }

	wL = (screen.availWidth - winW) / 2 ;

	wT = (screen.availHeight - winH) / 2;

	winLoc = "width=" + winW + ",height=" + winH + ",top=" + wT + ",left=" + wL;

	if(Nwin && !Nwin.closed){

		Nwin.location.href=theUrl;

		Nwin.focus();

		}

	else{

		if(options){

			if(options==0){

	  		winOptions = ",menubar=no,resizable=no,scrollbars=no,status=no,titlebar=no,toolbar=no";

	      			}

			if(options==1){

			winOptions = ",menubar=no,resizable=no,scrollbars=yes,status=no,titlebar=no,toolbar=no";

	      			}

			if(options==2){

			winOptions = ",location=yes,menubar=yes,resizable=yes,scrollbars=yes,status=yes,titlebar=yes,toolbar=yes"; 

	      			} 

		}

		else{

			winOptions = ",menubar=no,resizable=yes,scrollbars=yes,status=yes,titlebar=yes,toolbar=no";

		}  

	  Nwin=window.open(theUrl,"NewWin",winLoc + winOptions);

	  Nwin.focus();

	  }

}

//---------------------------------------------------------

var ntPics=9;

var nbPics=6;

var pArr1 = new Array(ntPics);

var pArr2 = new Array(nbPics);

//---------------------------------------------------------

for(var i=0;i<ntPics;i++){

	pArr1[i]='../images/navpics/tpic'+i+'.jpg';

}

for(var i=0;i<nbPics;i++){

	pArr2[i]='../images/navpics/bpic'+i+'.jpg';

}

//---------------------------------------------------------

function r(max){

	var num = 0;

	while (num == 0 || num > max || isNaN(num)){

		num = parseInt(Math.random()*max)

	}

	return num;

}

//---------------------------------------------------------

var x;

function fill(htmlStr1,htmlStr2,id){

	if (document.getElementById){

		x = document.getElementById(id);

		x.innerHTML = htmlStr1 + htmlStr2;

	}

	else if (document.all){

		x = document.all[id];

		x.innerHTML = htmlStr1 + htmlStr2;

	}

}

//---------------------------------------------------------

function rpics(){

	var i1 = r(ntPics);

	var i2 = r(nbPics);

	var str1,str2 = "";

	str1 = "<img src='"+pArr1[i1]+"' width='140px' height='140px' alt='' />";

	str2 = "<img src='"+pArr2[i2]+"' width='140px' height='40px' alt='' />";

	fill(str1,str2,'fotobar');

}

//---------------------------------------------------------

var agt=navigator.userAgent.toLowerCase();

var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));

var is_ie7    = (agt.indexOf("msie 7") != -1);

var is_win    = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );

var is_mac    = (agt.indexOf("mac")!=-1);

//for ie7 we need to reduce all font sizes

if (is_ie7) {

  if (is_win) {

    var nLink=document.createElement('LINK');  

    nLink.rel="stylesheet";

    nLink.type="text/css";

    nLink.href="../style/layout_ie7.css";

    var oHEAD=document.getElementsByTagName('HEAD').item(0);

    oHEAD.appendChild(nLink);

  } 



}

else if (is_ie) {

  if (is_win) {

    var nLink=document.createElement('LINK');  

    nLink.rel="stylesheet";

    nLink.type="text/css";

    nLink.href="../style/layout_ie.css";

    var oHEAD=document.getElementsByTagName('HEAD').item(0);

    oHEAD.appendChild(nLink);

  } 

  else if (is_mac) { document.write('<link rel="stylesheet" type="text/css" href="../style/layout_iemac.css" />') }

}


//---------------------------------------------------------
//if(hM && bw.mac && bw.ie5 && bw.ie6) hM.construct();
