$(document).ready(function()
{


	var input = document.createElement('input');

	// only bind if placeholder isn't natively supported by the browser
	if (!('placeholder' in input))
	{
		$('input[placeholder]').each(function()
		{
			var self = $(this);

			self.val(self.attr('placeholder')).bind(
			{
				focus: function()
				{
					if (self.val() === self.attr('placeholder'))
					{
						self.val('');
					}
				},
				blur: function()
				{
					var label = self.attr('placeholder');
					if (label && self.val() === '')
					{
						self.val(label);
					}
				}
			});
		});
	}

/* ------------------------------------------------------------------ */

	var chart_heading = $('#chart_values li.odd');
	var chart_text = $('#chart_values li.even');

	$('area').each(function(index)
	{
		$(this).bind('mouseenter', function(e)
		{
			e.preventDefault();

			var heading = chart_heading.eq(index).html();
			var text = chart_text.eq(index).html();

			$('#chart_description h3').html(heading);
			$('#chart_description p').html(text);
		});
	});

/* ------------------------------------------------------------------ */

	$('#downloads').expand(
	{
		triggers:'h3 a',
		expandables:'.download-content',
		duration:300
	});

	$('.expandable').expand_one(
	{
		trigger:'h3 a',
/*		expandable:'.exp-content',*/
		expandable:'p.bodytext',
		duration:300
	});

	$('a.enlarge').enlarge();

/* ------------------------------------------------------------------ */

/*
	if ($('#player').length > 0)
	{
		flowplayer('player', '/typo3conf/ext/gmc_video/Resources/Public/Flowplayer/flowplayer-3.2.7.swf');
	}
	if ($('.box-dark-large #player').length > 0)
	{
		flowplayer('player', '/typo3conf/ext/gmc_video/Resources/Public/Flowplayer/flowplayer-3.2.7.swf', {
		    clip: {
		        eventCategory: 'GMC Newslounge Video'
		    },
			plugins: {
				gatracker: {
					url: '/typo3conf/ext/gmc_video/Resources/Public/Flowplayer/flowplayer.analytics-3.2.2.swf',
					events: {
						all: true,
						finish: 'Finish'
					},
					labels: {
						start: 'Start',
						play: 'Play',
						pause: 'Pause',
						resume: 'Resume',
						seek: 'Seek',
						stop: 'Stop',
						finish: 'Finish',
						mute: 'Mute',
						unmute: 'Unmute',
						fullscreen: 'Full Screen',
						fullscreenexit: 'Full Screen Exit'
						},
				debug: false,
				trackingMode: 'AS3',
				accountId: 'UA-4664265-1'
				}
			}
		});
	}
*/
	/* ------------------------------------------------------------------ */

	$(".aggregator-carousel").jCarouselLite({
		'auto': 1500,
		'speed': 1800,
		'vertical': true
	});

	/* ------------------------------------------------------------------ */

});
