function bwcheck(){ 
	this.ver=navigator.appVersion;
	this.agent=navigator.userAgent;
	this.dom=document.getElementById?1:0;
	this.opera5=this.agent.indexOf("Opera 5")>-1;
	this.opera6=this.agent.indexOf("Opera 6")>-1;
	this.opera7=this.agent.indexOf("Opera 7")>-1;
	this.opera8=this.agent.indexOf("Opera 8")>-1;
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; 
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
	this.ie7=(this.ver.indexOf("MSIE 7")>-1 && this.dom && !this.opera5)?1:0;
	this.ie8=(this.ver.indexOf("MSIE 8")>-1 && this.dom && !this.opera5)?1:0;
	this.ie=(document.all && !this.dom && !this.opera5)?1:0;
	this.ie=this.ie4||this.ie5||this.ie6||this.ie7||this.ie8;
	this.mac=this.agent.indexOf("Mac")>-1;
	this.nsplus=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie8||this.ie7||this.ie6||this.ie5||this.ie4||this.ns4||this.nsplus||this.opera8||this.opera7||this.opera6);
	return this;
}
bw=new bwcheck();
function testObj(o){
	var w="";
	for(var i in o){
		w+= i + " : " + o[i] +"\r\n"
	}
	alert(w);
}
var _pop,_poptim;
function wopen(url,w,h,c,win,op,aot,tim){
	var sw=screen.width;
	var sh=screen.height;
	var _W=w?w:800;
	var _H=h?h:600;
	var _l=(sw-_W)/2;
	var _t=(sh-_H)/2;
	var _n=win||"nwin";
	var _o="location=0,directory=0,status=0,titlebar=0,menubar=0,resizable=1,copyhistory=0";
	var _p=",width="+_W+",height="+_H+",";
	if(c) _p+="left="+_l+",top="+_t+",screenX="+_l+",screenY="+_t;
	if(_pop&&!_pop.closed) { _pop.close(); _pop=null; clearTimeout(_poptim);}
	if(!op||op==null||op=='') _pop=window.open('about:blank',_n,_o+_p);
	else _pop=window.open('about:blank',_n,op+_p);	
	_pop.location.href=url;
	if(_pop.focus()) _pop.focus();
	if(aot && !tim) _poptim=setTimeout('focPop()',1000);
	else if(tim) _poptim=setTimeout('_pop.close()',tim);
}
function focPop(){
	if(_pop&&!_pop.closed){
		_pop.focus();
		_poptim=setTimeout('focPop()',1500);
	}
}
function openFoto(){
	
}
function checkSend(){
    var f = document.contactform;
    f.submit();
}
function checkDoorsturen(){
    var f = document.contactform;
    f.submit();
}
function doSearch(){
    var f = document.searchform;
    f.submit();
}
function resetAPT(){
    var f = document.searchform;    
    f.apl.selectedIndex = 0;
    f.amt.value = "";
}
function resetAPL(){
    var f = document.searchform;
    f.apt.selectedIndex = 0;
    f.amt.value = "";
}
function resetAMT(){
    var f = document.searchform;
    f.apt.selectedIndex = 0;
    f.apl.selectedIndex = 0;
}
function delayCloseRemark(){
	deltim = setTimeout('closeRemark()',3000);
}
function closeRemark(){
	clearTimeout(deltim);
	//alert("close")
	$("#remark").fadeOut("normal");
}
function checkSend(){
    var f=document.contactform;
    var er="";
    if(!f.bn.value.length) er +="- Uw bedrijfsnaam is niet ingevuld\r\n";
    if(!f.cp.value.length) er +="- Uw naam is niet ingevuld\r\n";
    if(!f.e.value.length) er +="- Uw E-mailadres is niet ingevuld\r\n";
    if(!f.t.value.length) er +="- Uw telefoonnummer is niet ingevuld\r\n";
    if(er.length){ 
        alert(er);
        return false;
    }
    else{ 
        document.contactform.submit();
    };
}
function checkDoorsturen(){
    var f=document.contactform;
    var er="";
    if(!f.cp.value.length) er +="- Uw naam is niet ingevuld\r\n";
    if(!f.doorsturen.value.length) er +="- Het E-mailadres is niet ingevuld\r\n";
    if(er.length){ 
        alert(er);
        return false;
    }
    else{ 
        document.contactform.submit();
    };
}
function checkZoekopdracht(){
    var f=document.zoekopdrachtform;
    var er="";
    if(!f.bn.value.length) er +="- Uw bedrijfsnaam is niet ingevuld\r\n";
    if(!f.cp.value.length) er +="- Uw naam is niet ingevuld\r\n";
    if(!f.e.value.length) er +="- Uw E-mailadres is niet ingevuld\r\n";
    if(!f.t.value.length) er +="- Uw telefoonnummer is niet ingevuld\r\n";
    if(er.length){ 
        alert(er);
        return false;
    }
    else{ 
        document.zoekopdrachtform.submit();
    };
}
/*
window.onload = function() {
	if (!document.getElementsByTagName) {
		return false; 
	} 
	var popuplinks = document.getElementsByTagName("a");
	for (var i=0; i < popuplinks.length; i++) {		
		if (popuplinks[i].getAttribute("class") == "popup") {	
			popuplinks[i].onclick = function() {	
			openPopUp(this.getAttribute("href"));	
			return false; 	
			} 	
		}
	} 
} 
*/
$(document).ready(function(){
	if (!document.getElementsByTagName) {
		return false; 
	} 
	var popuplinks = document.getElementsByTagName("a");
	for (var i=0; i < popuplinks.length; i++) {		
		if (popuplinks[i].getAttribute("class") == "popup") {	
			popuplinks[i].onclick = function() {	
			openPopUp(this.getAttribute("href"));	
			return false; 	
			} 	
		}
	} 
});

function openPopUp(linkURL) {
	window.open(linkURL,'popup','width=1000,height=600,scrollbars=1')
}
/*
$(document).ready(function(){
	$('a.popup').click(function(){
		openPopUp(this.attr('href'));
		//wopen(this.attr('href'),1000,600,1,'regwin','scrollbars=1');
		return false;
	}) 
});
*/