/* oplossing voor selecteren-tekst bug in IE bij gepositioneerde elementen  */
var detect = navigator.userAgent.toLowerCase();
var OS, browser,version,total,thestring;

function checkIt(string) {
   place = detect.indexOf(string) + 1;
   thestring = string;
   return place;
}

if (checkIt('msie')) {
   browser = "Internet Explorer";
   setTimeout (new Function("document.body.style.height = document.documentElement.scrollHeight+'px';"), 100);
}

/* achtergrondwisselaar homepage */
/** rij 1 **/
var rij1 = new Array() 
rij1[0] = 'table.overzicht td.bg01{background:url(' + file_path + 'images/bg_td_home01.jpg) no-repeat 0 100%;}'
rij1[1] = 'table.overzicht td.bg01{background:url(' + file_path + 'images/bg_td_home02.jpg) no-repeat 0 100%;}'
rij1[2] = 'table.overzicht td.bg01{background:url(' + file_path + 'images/bg_td_home03.jpg) no-repeat 0 100%;}'
rij1[3] = 'table.overzicht td.bg02{background:url(' + file_path + 'images/bg_td_home01.jpg) no-repeat 0 100%;}'
rij1[4] = 'table.overzicht td.bg02{background:url(' + file_path + 'images/bg_td_home02.jpg) no-repeat 0 100%;}'
rij1[5] = 'table.overzicht td.bg02{background:url(' + file_path + 'images/bg_td_home03.jpg) no-repeat 0 100%;}'
var p = rij1.length;
var welkeBox = Math.round(Math.random()*(p-1));
document.write('<style type="text/css">' + rij1[welkeBox] +'</style>');

/** rij 2 **/
var rij2 = new Array() 
rij2[0] = 'table.overzicht td.bg03{background:url(' + file_path + 'images/bg_td_home04.jpg) no-repeat 0 100%;}'
rij2[1] = 'table.overzicht td.bg03{background:url(' + file_path + 'images/bg_td_home05.jpg) no-repeat 0 100%;}'
rij2[2] = 'table.overzicht td.bg03{background:url(' + file_path + 'images/bg_td_home06.jpg) no-repeat 0 100%;}'
rij2[3] = 'table.overzicht td.bg04{background:url(' + file_path + 'images/bg_td_home04.jpg) no-repeat 0 100%;}'
rij2[4] = 'table.overzicht td.bg04{background:url(' + file_path + 'images/bg_td_home05.jpg) no-repeat 0 100%;}'
rij2[5] = 'table.overzicht td.bg04{background:url(' + file_path + 'images/bg_td_home06.jpg) no-repeat 0 100%;}'
var q = rij2.length;
var welkeBox = Math.round(Math.random()*(q-1));
document.write('<style type="text/css">' + rij2[welkeBox] +'</style>');

/* popup window */
var newWindow = null;
function closeWin(){
if (newWindow != null){
if(!newWindow.closed)
newWindow.close();
}
}
function popUpWin(url){
closeWin();
var tools="";
tools = "noresizable,toolbar=yes,location=no,scrollbars=yes,width=600,height=400,left=20,top=20";
newWindow = window.open(url, 'newWin', tools);
newWindow.focus();
}

/* algemene popup window functie */
function openPopup(source_page,title,toolbars,resizable,scrollbars,width,height) {
  var NewWindow = window.open(source_page, title, 'toolbars='+toolbars+',resizable='+resizable+',scrollbars='+scrollbars+',width='+width+',height='+height);
  NewWindow.focus();
}

/* externe links openen in nieuw venster */
function externalLinks() {
if (!document.getElementsByTagName) return;
var anchors = document.getElementsByTagName("a");
for (var i=0; i<anchors.length; i++) {
var anchor = anchors[i];
if (anchor.getAttribute("href") &&
anchor.getAttribute("rel") == "external")
anchor.target = "_blank";
}
}
window.onload = externalLinks;
