// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

function destroy_loading(id, progress)
{
	Element.show(progress);
	highlight = "highlight_"
	highlightItem = highlight.concat(id)
	new Effect.Highlight(highlightItem, {startcolor: '#FFDFBF'});
	new Effect.Fade(highlightItem, {queue: 'end'});
}

function scroll_to(id)
{
	myHeight = window.innerHeight;
	myHeight = (0 - (myHeight/2)) + (document.getElementById(id).offsetHeight/2);
	new Effect.ScrollTo(id, {offset: myHeight});
}

function tickle_safari()
{
    // hack to fix safari's redraw bug 
    if (self.screenTop && self.screenX){
        window.resizeTo(self.outerWidth + 1, self.outerHeight);    
        window.resizeTo(self.outerWidth - 1, self.outerHeight);                
    }
}