function getElementsByClassName(oElm, strTagName, strClassName){
var arrElements = (strTagName == "*" && document.all)? document.all : oElm.getElementsByTagName(strTagName);
	    var arrReturnElements = new Array();
	    strClassName = strClassName.replace(/\-/g, "\\-");
	    var oRegExp = new RegExp("(^|\\s)" + strClassName + "(\\s|$)");
	    var oElement;
	    for(var i=0; i<arrElements.length; i++){
	        oElement = arrElements[i];
	        if (oRegExp.test(oElement.getAttribute("class"))) {
	            arrReturnElements.push(oElement);
	        }
	    }
	    return (arrReturnElements);
	}

function popup(myURL) {
	var day = new Date();
	var id = day.getTime();
	eval("page" + id + " = window.open('" + myURL + "', '" + id + "', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=600,height=550');");
};

function popupB(myURL) {
	var day = new Date();
	var id = day.getTime();
	eval("page" + id + " = window.open('" + myURL + "', '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=600,height=550');");
};

function toggleform(bar,e) {
	e.style.display="none";
	var foo= document.getElementById(bar);
	foo.style.display="block";
};

function Verzend(Formulier) {
	document.forms[Formulier].submit();
};

function PopUpInfo(notering,jaar, lijst) {
  window.open('http://muziek.gijs.info/Top2000Details.php?Notering='+notering+'&Jaar='+jaar+'&Lijst='+lijst,'','scrollbars=1,width=500,height=550,pageXOffset=25,pageYOffset=450');
};

function LokaalInit() {

	var winW = 600;
	var winH = 340;
	var defLW = 0;
	var defLH = 0;
	var BldW = 0;
	var defBldmar = 20;

	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		winW = window.innerWidth;
		winH = window.innerHeight; }
	else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
			//IE 6+ in 'standards compliant mode'
			winW = document.documentElement.clientWidth;
			winH = document.documentElement.clientHeight; }
		else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
			//IE 4 compatible
			winW = document.body.clientWidth;
			winH = document.body.clientHeight; };

	defLW = winW - ((winW / 10) * 2);
	if (document.body.currentStyle) {
		BldW = winW - parseInt(document.body.currentStyle.marginLeft) - parseInt(document.body.currentStyle.marginRight);
	} else {
		BldW = winW - parseInt(window.document.body.style.marginLeft) - parseInt(window.document.body.style.marginRight);
	}
	BldW = BldW - (defBldmar * 2); // margin

	foo=eval("document.images.SunderlandImg");
	if (foo) {
		foo.style.width=defLW+"px";
	};

	foo = document.getElementById("SunderlandDiv");
	if (foo) {
		foo.style.left = (winW - defLW)+"px";
		foo.style.top = "0px";
	};

	foo = document.getElementById("KopRegel");
	if (foo) {
		defLW = parseInt(foo.offsetWidth);
		foo.style.left = (winW - defLW - 20 - 2)+"px";
		foo.style.top = (20 - 2)+"px";
		foo.style.width = defLW+"px";
		defLH = parseInt(foo.offsetTop) + parseInt(foo.offsetHeight);
	};

	foo = document.getElementById("KopRegelSchaduw");
	if (foo) {
		defLW = parseInt(foo.offsetWidth);
		foo.style.left = (winW - defLW - 20)+"px";
		foo.style.top = "20px";
		foo.style.width = defLW+"px";
		defLH = parseInt(foo.offsetTop) + parseInt(foo.offsetHeight);
	};

	foo = document.getElementById("Credits");
	if (foo) {
		defLW = parseInt(foo.offsetWidth);
		foo.style.left = (winW - defLW - 20 - 2)+"px";
		foo.style.top = (10 + defLH)+"px";
		foo.style.width = defLW+"px";
		defLH = parseInt(foo.offsetTop) + parseInt(foo.offsetHeight);
	};

	if (defLH>0) {
		defLH = defLH + 20;
		document.body.style.marginTop = defLH + "px";
	};

	foo = getElementsByClassName(document, 'div', 'container');
	for (var i in foo) {
		foo[i].style.left = (winW - BldW - defBldmar) +"px";
	    foo[i].style.width= BldW +"px";
	}
};
