
// check browsertype
var isMinNS4 = (navigator.appName.indexOf("Netscape") >= 0 &&
                parseFloat(navigator.appVersion) >= 4) ? 1 : 0;
var isMinIE4 = (document.all) ? 1 : 0;
var isMinIE5 = (isMinIE4 && navigator.appVersion.indexOf("5.") >= 0) ? 1 : 0;
var isNS6 = (navigator.userAgent.indexOf("Gecko")    > 0) ? 1 : 0;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1);

//if (isMinNS4) {alert ('isMinNS4');};
//if (isMinIE4) {alert ('isMinIE4');};
//if (isMinIE5) {alert ('isMinIE5');};
//if (isNS6) {alert ('isNS6');};
//if (this.opera) {alert ('isOpera');}; 

// bepaald variabelen voor later gebruik
if (isMinNS4 || isNS6) {
	doc="document.";				// document
	val = ".value";					// waarde
	stijl="";						// stijl
	horz=".left";					// horizontale afstand
	vert=".top";					// vertikale afstand
	innerW="window.innerWidth";		// breedte scherm
	innerH="window.innerHeight";	// hoogte scherm
	offsetX="window.pageXOffset";	// offset breedte
	offsetY="window.pageYOffset";	// offset hoogte
};
if (isMinIE4){
	doc="";
	val = ".value";
	stijl=".style";
	horz=".pixelLeft";
	vert=".pixelTop";
	innerW="document.body.clientWidth";
	innerH="document.body.clientHeight";
	offsetX="document.body.scrollLeft";
	offsetY="document.body.scrollTop";
};
 
// functie om form te submitten + verplichte velden controle +disable submitknop
// getest: ie5.5 ok, ie6.0 ok, ns4.7 ok, ns6.2 ok, opera5.12 ok,
// gebruik: in form tag: onSubmit="return checkverplicht('formuliernaam','naam van 
// velden','titel van velden');" 
function checkverplicht(formulier,reqlijstveld,reqlijstnaam) {
var Checkveld = reqlijstveld;
var Checknaam = reqlijstnaam;
var isok ='ja';
form = formulier;
var buttontekst = eval(doc+form+".verstuur"+val);
eval(doc+form+".verstuur"+val+"='Even geduld aub'");
eval(doc+form+".verstuur.disabled=true");
if (Checkveld != '') {
var CheckveldArray = Checkveld.split(",");
var ChecknaamArray = Checknaam.split(","); 
for (var i=0; i<CheckveldArray.length; i++)
	{
	var naam = ChecknaamArray[i];
	veld = "."+CheckveldArray[i]+"";
	waarde = eval(doc+form+veld+val);
		if (waarde == ''|| waarde == null) {
		alert(''+naam+' is een verplicht veld!');
		var isok = 'nee';
		};
	};
};
if (isok == 'nee') {
eval(doc+form+".verstuur"+val+"='"+buttontekst+"'");
eval(doc+form+".verstuur.disabled=false");
return false;
}else
{return true};
};


function PopIt(filename, w, h, s){  
	var wp = (screen.width/100)*w;
	var hp = (screen.height/100)*h;
	var midw = (screen.width/2)-(wp/2);
	var midh = (screen.height/2)-(hp/2);
	popup = window.open(filename,"popDialog","left="+midw+" top="+midh+" height="+hp+",width="+wp+",scrollbars=yes resizable=1")  
	if ( popup.document.close() ) {
		popup.document.close()
	}
};

function PopItpx(filename, w, h, s){  
	var wp = w;
	var hp = h;
	var midw = (screen.width/2)-(wp/2);
	var midh = (screen.height/2)-(hp/2);
	popup = window.open(filename,"popDialog","left="+midw+" top="+midh+" height="+hp+",width="+wp+",scrollbars=yes resizable=1")  
	if ( popup.document.close() ) {
		popup.document.close()
	}
};

function DoMainImage(nr){
document.getElementById('menuphoto').src="http://www.gmpromotions.be/foto/productmaingroup_"+nr+".jpg";
}

function DoSubImage(nr){
document.getElementById('menuphoto').src="http://www.gmpromotions.be/foto/productsubgroup_"+nr+".jpg";
}


