
document.observe("dom:loaded", function() {
  AlbaModa.app_init();
});


var AlbaModa = {
	app_init : function() {
    this.init_hoverbuttons()
	},
	cleanup_input : function(elem, default_text) {
		
	},
	init_hoverbuttons : function() {
    $$(".hover_btn").each( 
			function(elem) {
	      elem.onmouseover=function(){
					if (!elem.src.include("_high"))	elem.src = elem.src.gsub(/(\.)(gif|jpg|png)/, "_high#{1}#{2}")
		    },
	      elem.onmouseout=function(){
					if (elem.src.include("_high")) elem.src = elem.src.gsub("_high", "")
        }
			}   
		) 
	} 
	
}


var Popup = function() {
    var base = function(url, options, popupName) {
      popupName = window.open(url,popupName,options);
      if (popupName){
        if (popupName.focus) popupName.focus();
      }
      return false;
    };
    var with_size = function(url, width, height, name) {
      name = (!name || name == 'undefined') ? 'medium' : name  
      base(url, 'width='+width+',height='+height+',toolbar=0,menubar=0,resizable=1,scrollbars=1,status=1,left=200,top=100', name );
    }
    return {
        sized: function(url, width, height, name) {
          with_size(url, width, height, name )
          // kein return false für Verwendung in URL (href="javascript:Popup.with_size()")
        },
        standard: function(url, name) {
          with_size(url, '550', '650', name )
          return false;
        },
        medium: function(url, name) {
          with_size(url, '540', '420', name )
          return false;
        },
        small: function(url, name) {
          with_size(url, '400', '365', name )
          return false;
        }
    }
}()


