// JavaScript Document
var RolloverButtons = {
	
	init: function(){
		var list_of_input = document.getElementsByTagName("input");
		for(var i=0; i<list_of_input.length; i++){
			var input_type = list_of_input[i].getAttribute("type");
			if(input_type == "submit" || input_type == "reset" || input_type == "button"){ 
				// Event: onmouseover
				Core.addEventListener(list_of_input[i],"mouseover",RolloverButtons.changeBackgroundOverListener);
				// Event: onmouseout
				Core.addEventListener(list_of_input[i],"mouseout",RolloverButtons.changeBackgroundOutListener);
			}
		}
	},
	
	changeBackgroundOverListener: function(event){
		RolloverButtons.changeBackgroundOver(this);
		Core.preventDefault(event);
	},
	
	changeBackgroundOutListener: function(event){
		RolloverButtons.changeBackgroundOut(this);
		Core.preventDefault(event);
	},
	
	changeBackgroundOver: function(button){
		if(window.ActiveXObject){
     		button.style.background='#484848 url(/fileadmin/templates/images/bg_button_search_h.gif) repeat-x top left;';
		}else{
    		button.style.backgroundImage = 'url(/fileadmin/templates/images/bg_button_search_h.gif)';
    		button.style.backgroundRepeat = 'repeat-x';
    		button.style.backgroundPosition = 'top left';
		}
	},
	
	changeBackgroundOut: function(button){
		if(window.ActiveXObject){
     		button.style.background='#484848 url(/fileadmin/templates/images/bg_button_search_n.gif) repeat-x top left;';
		}else{
    		button.style.backgroundImage = 'url(/fileadmin/templates/images/bg_button_search_n.gif)';
    		button.style.backgroundRepeat = 'repeat-x';
    		button.style.backgroundPosition = 'top left';
		}
	}
	
};

Core.start(RolloverButtons);
