/*
	Browser check
*/
var strAgent = navigator.userAgent.toLowerCase();

if(strAgent.indexOf("windows")!=-1) {

	if (strAgent.indexOf("msie")!=-1) {
		//writeLinkTag("ie.css");
	}

	if (strAgent.indexOf("msie 5.0")!=-1 || strAgent.indexOf("msie 5.5")!=-1) {
		//writeLinkTag("ie5.css");
	}

}

if(strAgent.indexOf("mac")!=-1) {

	if (strAgent.indexOf("safari")!=-1) {
		//writeLinkTag("safari.css");
	}
	if (strAgent.indexOf("msie")!=-1) {
		//writeLinkTag("iemac.css");
	}
}

/** writeLinkTag write link tag gets the name of the stylesheets as attribute
 * @param name name of the style sheet.
 *
 */
function writeLinkTag(name) {
	document.write("<link href=\"/css/" + name + "\" rel=\"stylesheet\" type=\"text/css\" media=\"screen\" />");
}


if ((screen.width < 1024))
{
	writeLinkTag('800x600.css');
}


//clearBullet:   Haalt de bullet voor het eerste servicemenu item weg

function clearBullet(){
	if (document.getElementById("othermenu_level0")){
		servicemenuRoot = document.getElementById("othermenu_level0");
		servicemenuFirstBullet = servicemenuRoot.getElementsByTagName("li")[0];
		servicemenuFirstBullet.style.background = 'none';
	}
}

function OpenWindow(url, w, h, r)
{
	sc = window.open(url , 'sc', 'width=' + w + ', height=' + h + ', resizable = ' + r + ',scrollbars=yes');

	if(sc && !sc.closed)
	{
		sc.focus();
	}
}

document.write('<div align="center" id="sending"><img id="wait" src="/img/wait.gif"><br/><br/>Een moment geduld...</div>')



function sending(button){

	if(button){ button.style.backgroundColor = "#EEEEEE"; button.style.color = "gray";}

	showsending();

	return true;
}


function showsending(){
	sending = getbyid('sending');
	sending.style.visibility = 'visible';

	sending.style.left = ((screen.width/2)-70) + 'px';
	sending.style.top = ((screen.height/2)-200) + 'px';

	if(document.all) setTimeout('document.images["wait"].src = document.images["wait"].src; document.images["wait"].style.visibility = "visible";', 10);
}



function getbyid(id){
  	var ie=document.all
	var ns6=document.getElementById && !document.all
	if (ie||ns6){
		return document.all? document.all[id] : document.getElementById? document.getElementById(id) : ""
	}
}



function klap(tabel, klasse, display)
{
    var active = false;
    var first = false
    table = getbyid(tabel);
    for(i=0; i < table.rows.length; i++)
    {
        if(table.rows[i].className == klasse)
        {
            active = !active;
            first = true;
        }

        if(active)
        {
            if(first){
               first = false;
            }else{
                table.rows[i].style.display = display;
            }
        }
    }
}


function klapuit(tabel, klasse)
{
    klap(tabel,klasse,'inline');
}

function klapin(tabel, klasse)
{
    klap(tabel,klasse,'none');
}

function toggle_on(id) {
	document.getElementById(id).style.display = 'block';
	document.getElementById('link_' + id).innerHTML = '<a rel="nofollow" href="#" onclick="javascript:toggle_off(\'' + id + '\');">verberg details</a>';
}

function toggle_off(id) {
	document.getElementById(id).style.display = 'none';
	document.getElementById('link_' + id).innerHTML = '<a rel="nofollow" href="#" onclick="javascript:toggle_on(\'' + id + '\');">toon details</a>';
}