function getViewportSize()
{
	var size = [0, 0];
	
	if (typeof window.innerWidth != 'undefined')
	{
		size = [
		window.innerWidth,
		window.innerHeight
		];
	}
	else if (typeof document.documentElement != 'undefined'	&& typeof document.documentElement.clientWidth !=
	'undefined' && document.documentElement.clientWidth != 0)
	{
		size = [
		document.documentElement.clientWidth,
		document.documentElement.clientHeight
		];
	}
	else
	{
		size = [
		document.getElementsByTagName('body')[0].clientWidth,
		document.getElementsByTagName('body')[0].clientHeight
		];
	}
	
	return size;
}

function setHeight()
{
	viewport = getViewportSize();
	$('content').style.left = (viewport[0] - 680)/2 + "px";
	$('content').style.top = "50px";
}

function toggleSubmenu()
{
		new Effect.toggle('submenu','blind');
}

function hideSubmenu()
{
	if ($('submenu').style.display != "none")
		new Effect.toggle('submenu','blind');
}

function toggleState(id)
{
	var tableElement = $("content" + id); 

	new Effect.toggle("content" + id,"blind");
}

function cnum(value)
{
    return ( (new Number(value)) + 0);
}

function DrawFlashMp3() {
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="272" height="30" align="middle">');
	document.write('<param name="allowScriptAccess" value="sameDomain" />');
	document.write('<param name="movie" value="/flash/mp3.swf" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="bgcolor" value="#ffffff" />');
	document.write('<param name="wmode" value="transparent" />');
	document.write('<embed src="/flash/mp3.swf" wmode="transparent" quality="high" bgcolor="#ffffff" width="279" height="30" name="mp3" align="middle" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');
}

function DrawFlashVideo() {
	/*document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="272" height="30" align="middle">');
	document.write('<param name="allowScriptAccess" value="sameDomain" />');
	document.write('<param name="movie" value="video.swf"/>');
	document.write('<param name="quality" value="high"/>');
	document.write('<param name="bgcolor" value="#ffffff"/>');
	document.write('<embed src="/flash/video.swf" quality="high" bgcolor="#ffffff" width="320" height="240" name="video" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />')
	document.write('</object>');
	*/
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="280" height="240">');
		document.write('<param name="movie" value="/flash/video.swf">');
		document.write('<param name="quality" value="high">');
		document.write('<embed src="/flash/video.swf" quality="high" bgcolor="#ffffff" width="288" height="240" name="video" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');

}	


function sendNewsletterRequest()
{
	var opt = 
	{
		// Use POST
		method: 'post',
		// Send this lovely data
		postBody: "&newsletter_request=true&email_address=" + $('newsletter_textinput').value,
		// Handle successful response
		onSuccess: function(t) {
			$('newsletter_textinput').value = "...thanks for joining!";
		},
		// Handle 404
		on404: function(t) {
			alert('Error 404: location "' + t.statusText + '" was not found.');
		},
		// Handle other errors
		onFailure: function(t) {
			alert('Error ' + t.status + ' -- ' + t.statusText);
		}
	}
	new Ajax.Request('/contact_process.php', opt);
}
