$(document).ready(function(){ 
	//Sitespecific javascript here
	//Greybox closebox
$(".greybox").click(function(){
			$("#GB_window").css("background-color","#aaaaaa").prepend('<span class="closeMe">St&auml;ng</span>');
			$(".closeMe").click(GB_hide);
			});
	//Searchbox clear and fill
	function input_values()
	{	
		var inputBox = $('#newsletter input, #search input');
	
		
		inputBox.focus(function(){
			if ($(this).val() != "") {
				
				var theValue = $(this).val();
				$(this).attr('temp', theValue)
				$(this).val('');
			};
		
		});
		inputBox.blur(function(){
			if ($(this).val() == "") {
				var theValue = $(this).attr('temp');
				$(this).val(theValue);
			};
			
		});
	}
	input_values();
	
	//Even and odd rows in tables
	/* if Environment is NOT Editor */
		$("table tr").mouseover(function() {
			$(this).addClass("over");}).mouseout(function() {$(this).removeClass("over");
		});
		$("table tr:nth-child(even), table tr td:nth-child(even)").addClass("even");
		$("table tr:nth-child(odd), table tr td:nth-child(odd)").addClass("odd");
		$("table tr:first-child").removeClass('even').addClass("th");
		$('table tr td:first').addClass('first');
		$('table tr td:last').addClass('last');
		
    //List even odd and first and last list
    $('ul li:nth-child(even)').addClass('even');
    $('ul li:nth-child(odd)').addClass('odd');
    $('ul li:first-child').addClass('first');
    $('ul li:last-child').addClass('last');
		
		//Show links with flowplayer as embedded media
		if ($('p > a').attr('title') == 'flowplayer') {
			$('a[title=flowplayer]').jmedia(
			{version:"6,0"},
			{width:"630", 
			height:"355", 
			autoplay: true,
			maintainaspect:"true"});
		};
		
		$('#content #main .promo img,#content #main table img,#content #main img.border').addClass('box-shadow');


});
