var Popup = {
	open: function(options) {
		this.options = {
			url: '#',
			width: 10,
			height: 10,
			name:"_new",
			location:"no",
			menubar:"no",
			toolbar:"no",
			status:"no",
			scrollbars:"no",
			resizable:"no",
			left:"",
			top:"",
			normal:false
		}
		Object.extend(this.options, options || {});

		if (this.options.normal){
			this.options.menubar = "yes";
			this.options.status = "yes";
			this.options.toolbar = "yes";
			this.options.location = "yes";
		}

		this.options.width = this.options.width < screen.availWidth?this.options.width:screen.availWidth;
		this.options.height=this.options.height < screen.availHeight?this.options.height:screen.availHeight;
		var openoptions = 'width='+this.options.width+',height='+this.options.height+',location='+this.options.location+',menubar='+this.options.menubar+',toolbar='+this.options.toolbar+',scrollbars='+this.options.scrollbars+',resizable='+this.options.resizable+',status='+this.options.status
		if (this.options.top!="") {
			openoptions+=",top="+this.options.top;
		}
		if (this.options.left!="") {
			openoptions+=",left="+this.options.left;
		}
		window.open(this.options.url, this.options.name,openoptions);
		return false;
	}
}

function showHarding_grass()
{
	performContentRequest('species_pages/harding_grass.html', 'harding_grass');
}

function showPerennial_pepperweed()
{
	performContentRequest('species_pages/perennial_pepperweed.html', 'perennial_pepperweed');
}

function showPoison_hemlock()
{
	performContentRequest('species_pages/poison_hemlock.html', 'poison_hemlock');
}

function showSpanish_Broom()
{
	performContentRequest('species_pages/spanish_broom.html', 'spanish_broom');
}

function showTerracina_spurge()
{
	performContentRequest('species_pages/terracina_spurge.html', 'terracina_spurge');
}

function showYellow_Starthistle()
{
	performContentRequest('species_pages/yellow_starthistle.html', 'yellow_starthistle');
}

function showPhone_help()
{
	performContentRequest('phone_help.html');
}


function performContentRequest(url, hash)
{
	var myAjax = new Ajax.Request(url, {
		method: 'get',
		onComplete: function(request) {
			$('content').update(request.responseText);
			if (hash != undefined) {
				this.location.hash = hash;
			}
		}
	});
}

function showContentResponse(request)
{
}
