var toolTipBG = new Image();
toolTipBG.src = '_style/_images/bubble.png';


function isInteger( string ) {
    return !isNaN( parseInt( string ) );
}
function confirmDelete(ev) {
    if(!confirm("Are you sure you want to delete the following: " + this.title + "?")) {
        new Event(ev).stop()
    }
}
function initAccordian() {
    var accordion = new Accordion('.acc-action', '.acc-reaction', { 
    	opacity: true,
        display: -1,
        alwaysHide: true,
    	onActive: function(toggler, element){
    		var expand = toggler.getElement('.acc-expand');
            if (expand != null) {
                expand.style.display = 'none';
            }        
            var collapse = toggler.getElement('.acc-collapse');
            if (collapse != null) {
                collapse.style.display = 'inline';
            }
    	},
     
    	onBackground: function(toggler, element){
    		var expand = toggler.getElement('.acc-expand');
            if (expand != null) {
                expand.style.display = 'inline';
            }        
            var collapse = toggler.getElement('.acc-collapse');
            if (collapse != null) {
                collapse.style.display = 'none';
            }
            
    	}
    }, $('accordion'));


}
function initAnimation(){
    $$('.cta').each(function(element) {
    	var fx = new Fx.Styles(element, {duration:300, wait:false});

    	element.addEvent('mouseenter', function(){

    		fx.start({
    			'margin-top': '-125px',
                'height': '125px'
    		});
    	});
     
    	element.addEvent('mouseleave', function(){
    		fx.start({
    			'margin-top': '0px',
                'height': '0px'
    		});
    	});
 
    });
}
window.addEvent('domready', function() {
    initAnimation();
    initAccordian();
});
