function ShowMenu(themenu){

	var el = document.getElementById(themenu);
	
	if (el){
		el.style.visibility = 'visible';
	}
}

function HideMenu(themenu){
	var el = document.getElementById(themenu);
	
	if (el){
		el.style.visibility = 'hidden';
	}
}

function offsite(url){
	var xpos = 0;
	var ypos = 0;
	var width=1024;
	var height=768;
	winOptions = 'toolbar=1,location=1,menubar=1,directories=1,screenx=' +  xpos + ',screeny='+ ypos + ',top='+ ypos +',left=' + xpos + ',status=1,menubar=1,scrollbars=1,resizable=1,width=' + width + ',height=' + height;
	var temp = window.open(url, '', winOptions);
	temp.focus();
}

function validateAmount(amount){
	if(amount.value.match( /^[0-9]+(\.([0-9]+))?$/)){
		return true;
	}else{
		alert('You must enter a valid donation.');
		amount.focus();
		return false;
	}
}

function amountFocus(){
	theElement = document.getElementById("item_price_1");
	theElement.value = "";
	theElement.style.color='black'; 
}

google.setOnLoadCallback(function() {
	$(".colorbox1").colorbox({innerWidth:910, innerHeight:600, inline:true, href:"#inline1", onComplete:function(){setMap();}});
}); 

function setMap(){
	var theHTML = writeFlash2({width:'900',src:'/assets/flash/map.swf?',allowscriptaccess:'always',allowfullscreen:'true',height:'550'});
	$('#mapflash').html(theHTML);
}

function setMapState(theState){
	var theHTML = writeFlash2({width:'900',src:'/assets/flash/map.swf?myState=' + theState ,allowscriptaccess:'always',allowfullscreen:'true',height:'550'});
	$('#mapflash').html(theHTML);
	$.fn.colorbox({innerWidth:910, innerHeight:600, inline:true, href:"#inline1"});
}

function clearText(field){
    if (field.defaultValue == field.value) field.value = '';
    else if (field.value == '') field.value = field.defaultValue;
}


$(document).ready(function(){

	$($(".slider > a")).click(function () {
		$(this).next("div").slideToggle("fast");
	});

	$("a.slideshow").each(function(){ $(this).colorbox({ title:$(this).attr('rev') }) });	
	$("a.slideshow").colorbox({current:""});

});


