$(document).ready(function()
{
	// HEADER FLASH CONFIG
	// the default file to load - if a rel attribute exists on the div it is used instead.
	var defaultImage = '/images/header_robot.jpg';	
	// the number of seconds to show the image for - default=10
	var durationShow = 10;
	// the number of seconds to show the black - default=1
	var durationHide = 1;
	// END HEADER FLASH CONFIG
	
	
	
	var l = document.getElementById('logo');
	var logoFile = $.attr(l, 'class');
	if (!logoFile) {
		logoFile = 'logo1';
	}
	var so = new SWFObject("/swf/" + logoFile + ".swf", "logo", "120", "70", "5", "#ffffff");
	so.write('logo');
	
	var halftoneImage = $('#halftone-head img');

	if (halftoneImage.size() > 0) {
		var imgHeight = halftoneImage.css('height');
		var imageFile = $.attr(document.getElementById('halftone-head'), 'title');
		if (!imageFile) imageFile = defaultImage;

		var headFlash = new SWFObject("/swf/halftone.swf", "halftone", "244", imgHeight, "8", "#000000");
		headFlash.addVariable('imageFile', imageFile); 
		headFlash.addVariable('durationShow', durationShow);
		headFlash.addVariable('durationHide', durationHide);
		headFlash.addParam('style', 'float:left;');
		headFlash.write('halftone-head');
	}
	
	$('#subscribe-box').focus(function()
	{
		if (this.value == 'Email address') this.value = '';
	}).blur(function()
	{
		if (this.value == '') this.value = 'Email address';
	});
	
	$('ul.discussion-edit-tools a').mouseover(function()
	{
		$('#current-tool').html($(this).html());
	}).mouseout(function()
	{
		$('#current-tool').html('');
	});
	
});

var newwindow = '';

function popup(url)
{
	
	if (!newwindow.closed && newwindow.location)
		{
			newwindow.location.href = url;
		}
	else
		{
			newwindow=window.open(url,'name','height=284,width=690');
			if (!newwindow.opener) newwindow.opener = self;
		}
	
	if (window.focus) {newwindow.focus()}
	
	return false;
}

function popup_wide(url)
{
	
	if (!newwindow.closed && newwindow.location)
		{
			newwindow.location.href = url;
		}
	else
		{
			newwindow=window.open(url,'name','height=284,width=774');
			if (!newwindow.opener) newwindow.opener = self;
		}
	
	if (window.focus) {newwindow.focus()}
	
	return false;
}