
	function addLoadEvent(func) {
  		var oldonload = window.onload;
  		if (typeof window.onload != 'function') {
    		window.onload = func;
  		} else {
    		window.onload = function() {
      		oldonload();
      		func();
    	}
  	}
}
	function setDivElementHeight(id, id2) {
		var heightContent = 45;
		if (document.getElementById(id) != null && document.getElementById(id2) != null) {
			if (document.getElementById(id)) {
				heightContent = document.getElementById(id).offsetHeight > heightContent ? document.getElementById(id).offsetHeight : heightContent;
			}
			if (document.getElementById(id2)) {
				heightContent = document.getElementById(id2).offsetHeight > heightContent ? document.getElementById(id2).offsetHeight : heightContent;
			}
			document.getElementById(id).style.height=heightContent + "px";
			document.getElementById(id2).style.height=heightContent + "px";
		}
	}
	
	function getWindowHeight() {
		var windowHeight = 0;
		if (typeof(window.innerHeight) == 'number') {
			windowHeight = window.innerHeight;
		}
		else {
			if (document.documentElement && document.documentElement.clientHeight) {
				windowHeight = document.documentElement.clientHeight;
			}
			else {
				if (document.body && document.body.clientHeight) {
					windowHeight = document.body.clientHeight;
				}
			}
		}
		return windowHeight;
	}
	function setWrapperHeight() {
		if (document.getElementById) {
			var windowHeight=getWindowHeight();
			if (windowHeight>0) {
				var pageWrapper=document.getElementById('pageWrapper');
				var bodyContainer=document.getElementById('body-container');
				if (pageWrapper && bodyContainer) {
					windowHeight = bodyContainer.offsetHeight  > windowHeight ? bodyContainer.offsetHeight : windowHeight;
				}
				pageWrapper.style.height=windowHeight + 'px';
			}
			
		}
	}

	function fixMacIE(classname) {        
		var divs=document.getElementsByTagName("DIV");   
  		for(var d=0; d < divs.length;d++){     
 			if(divs[d].className.indexOf(classname)==0){    
 				divs[d].innerHTML+= "<div class='mac-clearfix'> </div>"; 
			}  
  		}      
	}
	function init(){
		if( navigator.appVersion.indexOf('Mac')!=-1 && document.all){     
		/* Pass the class name on the container to fix mac ie  */    
 		fixMacIE("clearfix");
		}
	}
	function registerButtonEvents() 
	{
		if(!document.getElementsByTagName){return;}
		var buttons = document.getElementsByTagName('button');
		if(!buttons){return;}
		for(i=0;i<buttons.length;i++)
		{
			buttons[i].onmouseover=changeButtonClass;
			buttons[i].onmouseout=changeButtonClass;
	
		}
	}
	function changeButtonClass()
	{
		var newButtonClass;
		var buttonClass = this.className;
		var buttonPattern = /-hover/;
		if(buttonPattern.test(buttonClass)) 
		{
			newButtonClass = buttonClass.replace('-hover','');
		}
		else
		{
			newButtonClass = buttonClass.replace(buttonClass, buttonClass + '-hover');
		}
	 this.className=newButtonClass;
	}
addLoadEvent(registerButtonEvents);
