/*
var Buttons = new Hash();
*/
/*
document.observe("dom:loaded", function() {
//    $('ServiceButton').observe('mouseover', function(){alert('Test');});
    new Button('Service');
    new Button('About');
    new Button('Contacts');
    new Button('Clients');
});

*/
/*
function Button(id) {
    this.id = id;
    this.buttonContent = '\
			<div class="Gradients" >\
				<div class="LeftGradient '+this.id+'Wrapper"></div>\
				<div class="RightGradient '+this.id+'WrapperRight"></div>\
			</div>\
			<div class="MenuButton '+this.id+'Button" id="'+this.id+'Content"></div>';
    this.hoverContent = this.buttonContent;    

    new Ajax.Request('/index.php/it/buttonContent', {
        method:'post',	
        parameters: new Hash({'id':id}),
        onSuccess: function (resp) {
            var obj = Buttons.get(id);
            obj.hoverContent = resp.responseText;
//            alert('ajax');
        },
        onFailure: function () {
        }
    });

    Buttons.set(this.id, this);    

    this.hover = function() {
        $(this.id).setStyle({height:'100px'});
        $(this.id).update(this.hoverContent);
        Element.observe(this.id+'Content', 'mouseout', this.onMouseOut);    
    }
    this.out = function() {
        $(this.id).setStyle({height:'28px'});
        $(this.id).update(this.buttonContent);
        Element.observe(this.id+'Content', 'mouseover', this.onMouseHover);
    }
    
    this.onMouseHover = function (event) {
        var obj = Buttons.get(this.parentNode.id);
//        alert(obj.id);
        obj.hover();
    }
    
    this.onMouseOut = function (event) {
        if (this.parentNode != null) {
            var obj = Buttons.get(this.parentNode.id);
            obj.out();
        }
    }

    $(this.id).update(this.buttonContent);        
    Element.observe(this.id+'Content', 'mouseover', this.onMouseHover);
 //   Element.observe(this.id+'Content', 'mouseout', this.onMouseOut);    
}

*/

function buttonHover(id) {        
    var y = $(id+'Scrolling').style.top;
    if (parseInt(y) < 0)
        return;
    $(id).setStyle({height:'84px'});
    $(id+'Scrolling').setStyle({top:'-28px'});
  //  $('bodyWrapper').setStyle({top:'-56px'});
}

function buttonOut(id) {
    var y = $(id+'Scrolling').style.top;
    if (parseInt(y) >= 0)
        return;
    $(id).setStyle({height:'28px'});
    $(id+'Scrolling').setStyle({top:'0px'});
 //   $('bodyWrapper').setStyle({top:'0px'});
}

/*
function Button(id) {
    this.id = id;
    this.hoverContent = '';
    this.mouseOut = function() {
//        $(id).empty();
        alert(this.id);
        $(this.id).update('\
        <div class="ButtonWrapper" id="'+this.id+'Button">\
			<div class="Gradients">\
				<div class="LeftGradient '+this.id+'Wrapper"></div>\
				<div class="RightGradient '+this.id+'WrapperRight"></div>\
			</div>\
			<div class="MenuButton '+this.id+'Button"></div>\
		</div>');
    }
    this.mouseOver = function () {
        $(this.id).update('<div class="ButtonWrapper">Fffff</div>');
        //alert();
    }
    
    $(this.id).observe('mouseout', this.mouseOut);
    $(this.id).observe('mouseover', this.mouseOver);
//    this.mouseOut();
}

*/
