function getStyle(el, styleProp) {
	var x = el;
	if (x.currentStyle) {
		var y = x.currentStyle[styleProp];
	 } else if (window.getComputedStyle) {
		var y = document.defaultView.getComputedStyle(x,null).getPropertyValue(styleProp);
	}
	return y;
}



function addClass(elem, classname) {
	// als er geen className is, voeg classname toe
	elem = document.getElementById(elem)
	if(!elem.className) {
		elem.className = classname;
		return
	}
	
	// als de class nog niet toegevoegd is, voeg de classname toe	
	if (!elem.className.match(new RegExp('(\\s|^)'+classname+'(\\s|$)'))) {
		elem.className += " " + classname;
	}
}

function removeClass(elem, classname) {
	elem = document.getElementById(elem)
	if (elem.className) {
		var reg = new RegExp('(\\s|^)'+classname+'(\\s|$)');
		elem.className=elem.className.replace(reg,' ');
		
	}

}

function resize() {

/*
document.getElementById("inhoud").innerHTML += "<center>" +  getStyle(document.getElementById("gradienttop"), "display") + "</center>";
	if (getStyle(document.getElementById("gradienttop"), "display") != "block") {
		return true;
	}
*/

	if (document.body.offsetWidth <= 1050) {
		addClass("base", "base_small_width");
		addClass("adres", "adres_small_width");
		addClass("addthis", "addthis_toolbox_small_width");
	} else {
		removeClass("base", "base_small_width");
		removeClass("adres", "adres_small_width");
		removeClass("addthis", "addthis_toolbox_small_width");
	}
	
	
	
	if (document.body.offsetHeight <= 650) {
		addClass("backgroundinhoud", "backgroundinhoud_small_height");
		addClass("sluit", "sluit_small_height");
		addClass("inhoud", "inhoud_small_height");
		addClass("backgroundnavigatie", "backgroundnavigatie_small_height");
		addClass("navigatie", "navigatie_small_height");
		addClass("backgroundimage", "backgroundimage_small_height");
		addClass("topimage", "topimage_small_height");
		addClass("base", "base_small_height");
		addClass("content", "content_small_height");

		
	} else {
		removeClass("backgroundinhoud", "backgroundinhoud_small_height");
		removeClass("sluit", "sluit_small_height");
		removeClass("inhoud", "inhoud_small_height");
		removeClass("backgroundnavigatie", "backgroundnavigatie_small_height");		
		removeClass("navigatie", "navigatie_small_height");
		removeClass("backgroundimage", "backgroundimage_small_height");
		removeClass("topimage", "topimage_small_height");
		removeClass("base", "base_small_height");
		removeClass("content", "content_small_height");
	
	}
}
