// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults


function wopen(url, name, w, h)
{
// Fudge factors for window decoration space.
 // In my tests these work well on all platforms & browsers.
w += 32;
h += 96;
 var win = window.open(url,
  name,
  'width=' + w + ', height=' + h + ', ' +
  'location=no, menubar=no, ' +
  'status=no, toolbar=no, scrollbars=no, resizable=no');
 win.resizeTo(w, h);
 win.focus();
}

// Blankets the screen in opaque gray. 
function show_cover() 
{
	$('page_cover').show();
	$('page_cover').setStyle({'height':''+document.body.scrollHeight+'px'});
	$('page_cover').setStyle({'width':''+document.body.scrollWidth+'px'});
	$('page_msg').show();
	$('page_msg').setStyle({'top':''+(200 + document.body.scrollTop)+'px'});
	$('page_msg').setStyle({'left':''+document.body.scrollLeft+'px'});
}

// Just show a loading message
function show_loading() {
	$('page_cover').setStyle({'background':'none'});
	$('page_cover').show();
	$('page_cover').setStyle({'height':''+document.body.scrollHeight+'px'});
	$('page_cover').setStyle({'width':''+document.body.scrollWidth+'px'});
	$('page_msg').show();
	$('page_msg').setStyle({'top':''+(200 + document.body.scrollTop)+'px'});
	$('page_msg').setStyle({'left':''+document.body.scrollLeft+'px'});

}

function hide_cover()
{
	$('page_cover').hide();
	$('page_msg').hide();
}

function submitform(id)
{
    $('venue_id').value = id;
	document.forms["venue_form"].submit();
}

function remove_tree_forms() {
	$$('.tree_forms').each(function(elm) {elm.remove();});
}

