//benodigde functie voor foto overzichts bouwsteen
var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
var popupscherm=0;

function popup_afbeelding(filename, fileid, width, height, scrollbars, resizable, menubar, toolbar, status, location) {
	if (popupscherm && ! popupscherm.closed)	popupscherm.close();
	if (!filename || filename=="")				filename="http://www.grundel.nl";
	if (!fileid || fileid=="")					fileid="Grundel";
	if (!width || width=="")					width="50";
	if (!height || height=="")					height="50";
	if (!scrollbars || scrollbars=="")			scrollbars="no";
	if (!resizable || resizable=="")			resizable="no";
	if (!menubar || menubar=="")				menubar="no";
	if (!toolbar || toolbar=="")				toolbar="no";
	if (!status || status=="")					status="no";
	if (!location || location=="")				location="no";
	popupscherm=0;
	var args = "height=" + height + ", width=" + width + ", scrollbars=" + scrollbars + ", resizable=" + resizable +  ", menubar=" + menubar + ", toolbar=" +toolbar + ", status=" + status + " ,location=" + location;
	popupscherm = open(filename, fileid, args);
	if (!InternetExplorer) 						popupscherm.focus();
}

//popup voor modules binnen admin
top.window.popupBestelmodule = function () {
	popupModules('bestelmodule');
}

function popupModules(modulenaam) {
	var filename="/admin/modules/"+modulenaam+"/index.php";
	var fileid="Activiteiten";
	var width="650";
	var height="580";
	var scrollbars="no";
	var resizable="no";
	var menubar="no";
	var toolbar="no";
	var status="no";
	var location="no";
	var popupscherm=0;
	var args = "height=" + height + ", width=" + width + ", scrollbars=" + scrollbars + ", resizable=" + resizable +  ", menubar=" + menubar + ", toolbar=" +toolbar + ", status=" + status + " ,location=" + location;
	popupscherm = top.window.open(filename, fileid, args);
}

//Functies voor online shop
function popup(url) {
	var filename="/"+url;
	var fileid="1";
	var width="500";
	var height="480";
	var scrollbars="no";
	var resizable="no";
	var menubar="no";
	var toolbar="no";
	var status="no";
	var location="no";
	var popupscherm=0;
	var args = "height=" + height + ", width=" + width + ", scrollbars=" + scrollbars + ", resizable=" + resizable +  ", menubar=" + menubar + ", toolbar=" +toolbar + ", status=" + status + " ,location=" + location;
	popupscherm = top.window.open(filename, fileid, args);
}
function bestelProduct(id) {
	if (document.winkelmand.prodid) {
		document.winkelmand.actie.value = 'producttoevoegen';
		document.winkelmand.prodid.value = id;
		document.winkelmand.submit();
	}
}
function verwijderProduct(id) {
	if (document.winkelmand.prodid) {
		document.winkelmand.actie.value = 'productverwijderen';
		document.winkelmand.prodid.value = id;
		document.winkelmand.submit();
	}
}
function bestellingBevestigen() {
	if (document.winkelmand.actie) {
		document.winkelmand.actie.value = 'bestellingbevestigen';
		document.winkelmand.submit();
	}
}

//zet label bij mouseover van de icons
function setLabel(actie,value) {
	if (document.getElementById('iconbarlabel')) {
		if (actie == 'show')
			document.getElementById('iconbarlabel').innerHTML = value;
		else
			document.getElementById('iconbarlabel').innerHTML = '';
	}
}