$(document).ready(function() {
	$('#pageleft :input[name=keywords]').bind('focus', function(e){
		if($(this).val()=="Fyll i ditt sökord här...")
		{
			$(this).val('');	
		}
	});
	
	$('#pageleft :input[name=keywords]').bind('blur', function(e){
		if($(this).val()=='')
		{
			$(this).val('Fyll i ditt sökord här...');	
		}
	});
	
	// Start value for login
	$('.login_box :input[name=email_address]').val("Din E-post");
	$('.login_box :input[name=password]').val("Lösenord");
	
	// Login functionality
	$('.login_box :input[name=email_address]').bind('focus', function(e){
		if($(this).val()=='Din E-post')
		{
			$(this).val('');	
		}
	});
	
	$('.login_box :input[name=email_address]').bind('blur', function(e){
		if($(this).val()=='')
		{
			$(this).val('Din E-post');	
		}
	});
	
	$('.login_box :input[name=password]').bind('focus', function(e){
		if($(this).val()=='Lösenord')
		{
			$(this).val('');	
		}
	});
	
	$('.login_box :input[name=password]').bind('blur', function(e){
		if($(this).val()=='')
		{
			$(this).val('Lösenord');	
		}
	});


});

var current_switch = 2;
var image_switcher_interval = setInterval("switchToImage()", 10000);

	
// Function for switching to a product
function switchToImage()
{
	$(".switcher_image").attr('id','switcher_image'+current_switch);
	
	$("div#pagecontent div#firstpage_switcher li").removeClass('active');
	$("div#pagecontent div#firstpage_switcher li:nth-child(" + current_switch + ")").addClass('active');

	
	clearInterval(image_switcher_interval);
	image_switcher_interval = setInterval("switchToImage()", 10000);
	current_switch = current_switch + 1;
	if(current_switch>3)
	{
		current_switch = 1;
	}
}

