$(document).ready(function(){
	
	if($('#introvideosmall').exists())
	{
		$('#introvideosmall').flash({
			swf:'wp-content/themes/v/media/flash/player.swf',
			width:360,
			height:214,
			flashvars:{
				videoPath:url + '/wp-content/uploads/2010/07/Sanne-Graulund-1-Stemmen.flv',
				screenshot:url + '/wp-content/uploads/videos/sanne.png',
				controlsOpacity:'0.7'
			},
			wmode:"transparent"
		});
	}

	if($('#mimimilogo .flashlogo').exists())
	{
		$('#mimimilogo .flashlogo').flash({
			swf:url + '/wp-content/themes/v/media/flash/logo.swf',
			wmode:'transparent',
			height:115,
			width:244
		});
	}
	
	$('#searcher').toggleVal('Søg på denne side..');
});

/* Own extensions */

$.fn.exists = function()
{
	return $(this).length !== 0;
}
$.fn.toggleVal = function(val)
{
	$(this).focus(function(){
		if($(this).val() == val)
		{
			$(this).val('');
		}
	});
	$(this).blur(function(){
		if($(this).val() == '')
		{
			$(this).val(val);
		}
	});
}
$.fn.dontWork = function()
{
	$(this).click(function(){
		return false;
	});
	return $(this);
}
