// general corker binning functions

	//sidebar image regulator
	
	function regulateHeight(){

		//find the height of the sidebar, make it a factor of 3
		var sideBar = document.getElementById("sidebarContent");
		if(sideBar){
			var nCurrentHeight = sideBar.scrollHeight;
			var bRegulated = false;
			var i  = 0;
			
			while (bRegulated == false){
				var nRes = (nCurrentHeight + i) / 3;
				if (isInteger(String(nRes)) == true){
					bRegulated = true;
				}else{
					i++; 
				}
			}	

			sideBar.style.height = (nCurrentHeight - 1) + i + "px";
		}
	}
	
	function isInteger(val){
		
		if(val==null){
			return false;
		}
		if (val.length==0){
			return false;
		}
		for (var i = 0; i < val.length; i++){
			var ch = val.charAt(i)
			if (i == 0 && ch == "-"){
				continue;
			}
			if (ch < "0" || ch > "9"){
				return false;
			}
		}
		return true;
	}
	function addLoadEvent(func){

		//adds unlimited functions to onload event
		var oldonload = window.onload;
		if(typeof window.onload != 'function'){
			window.onload = func
		}else{
			window.onload = function(){oldonload();func();}
		}
	}
	
	addLoadEvent(regulateHeight);
	