// JavaScript Document
// oorspronkelijk bedoeld voor navigatie kolom. 
// nu wat extra, algemene functies toegevoegd
if ((top != self.parent) && !self.disabled)
	top.location.href = '/index.asp';

if (top.navi && top.navi.setNav) top.navi.setNav(location.href,'currentPage');
top.setNav = location.href;

window.onunload = remove;

function remove () {
	if (top.navi && top.navi.setNav) top.navi.setNav(location.href,'');
	top.setNav = '';
	if (self.exit) self.exit();
}

//APB: toegevoegd 6 sep 2008. Zorgen dat frame wordt geladen bij diep linken
if (top.frames.length == 0) {
	top.location = "/index.asp?" + escape(document.URL);
};

//APB: toegevoegd 6-mar-2011
//NAW gegevens van roeier
//aanroepen vanuit docready - requires jquery!
function setup_roeier_info(s) {
	if (s) {
		$('#info_roeier').hide()
		$('#info_roeier_sluiten').click(function() {
			$('#info_roeier').hide()
		})
	}
	$(".roeier").click(function() {
		var params = {functie: 'geef_klusser_info', klusser_id: $(this).attr('roeier')}
	
		$.ajax({type:"POST", url: "/pages/vereniging/_klusserver.asp", data: jQuery.param(params), dataType: "text", 
			success: function(data, textStatus) {
				$('#info_roeier').children('table').html(data)
				set_popup_position('info_roeier')
				$('#info_roeier').show()	
			},
			error: function (XMLHttpRequest, textStatus, errorThrown) {
			  alert('error 41: quirksmode.js')
			}
		});
	})
}
//log function
function my_log(melding) {
	if (ipad) {
		console.log(melding)
	}
}
// zet positie van pop-up op window
// pop-up staat altijd 200px onder de rand van het venster
// gebruik van de jquery postion function is nog niet gelukt - krijg foutmelding
// werkt niet voor iPad, daar is ypos altijd 0
function set_popup_position(popup) {
	if ( $('#'+popup).css("top").match(/(^$)|(0px)|(auto)/) ) {
		var ypos = (document.all)?document.body.scrollTop:window.pageYOffset
		// console.log(ypos)
		$('#'+popup).css({top:(ypos+200) + 'px'})
	}
}

