var ua = navigator.userAgent.toLowerCase(); 

window.onload = function(){

	try{
		parent.showpopup();
		parent.zetPositie(curloc);
	} catch(e){}

	
	if (eId('titelkop')) document.title = eId('titelkop').innerHTML;

	eId('sluitknop').onclick = function(){try{ parent.sluit(); return false} catch(e){}}

	if (document.referrer != '') eId('terugknop').onclick = function(){history.back(); return false}	
	
	if (eId('uwverhaal')) eId('uwverhaal').onmouseover = function(){this.style.display='none';}
	
}


if (eId('mobiel')) {
	try{ window.addEventListener('load', function() {
		setTimeout(scrollBy, 0, 0, 1);

	}, false);} catch(e){};
}


function toonRoute(obj){if (eId('mobiel')) {location.href=obj.href} else {window.open(obj.href)}}
																				  

function setLoc(locstr){
	try{
		var krt = parent.document.getElementById('kaart').getAttribute('data-kaart');
		if (krt == undefined || krt == ''){
			parent.zetPositie(locstr);
		}
		
	} catch(e){}
	
	//hoort eigenlijk op een andere plek: tabs kleiner maken bij veel
	var tabs = eId('detabs').getElementsByTagName('a');

	if (navigator.standalone){
		for (var i=0; i<tabs.length; i++) tabs[i].onclick = function(){location.href = this.href; return false};
	}

	if (tabs.length > 5 && !eId('mobiel')){

		for (var i=5; i<tabs.length; i++){
		tabs[i].title=tabs[i].innerHTML;
		tabs[i].innerHTML='&nbsp; ';
		tabs[i].style.paddingRight='0';
		}
	}
	
	//idem / is alleen correctie voor reacties: base target=_blank
	var as = eId('onder').getElementsByTagName('a');
	for (var i=0; i<as.length; i++){
		as[i].target='_self';
	}
	
	
}

function eId(id){return document.getElementById(id)}
	
