$(document).ready(function () {
    $("#logo").click(function () { 
      window.location="http://www.automeklarit.fi/public/index.php";
    });

$("#infoBtn").click(function () { 
      window.location="http://www.automeklarit.fi/public/page.php?106";
    });
	
	$(".field").focus(function(){
		var cssObj = {
        borderColor: "#fb8f13",
        backgroundColor: "#FFF"
      }
      $(this).css(cssObj);
	});
	
	$(".field").blur(function(){
		var cssObj = {
        borderColor: "#ccc",
        backgroundColor: "#e1e1e1"
      }
      $(this).css(cssObj);
	});
	
	$("#pwholder").focus(function(){
      $(this).hide(); 
	  $(".pw").show();
	  $("#realpw").focus();
	});
	
	$("#pwholderbig").focus(function(){
      $(this).hide(); 
	  $("#pwbig").show();
	  $("#pwbig").focus();
	});
	
	$(".un").focus(function(){
		var val = $(this).attr("value");
		if (val == "Tunnus")
		{
			$(this).attr("value","");
		}
	});
	
	$(".nm").focus(function(){
		var val = $(this).attr("value");
		if (val == "Yrityksesi nimi")
		{
			$(this).attr("value","");
		}
	});
	
	$(".em").focus(function(){
		var val = $(this).attr("value");
		if (val == "Sähköpostiosoite")
		{
			$(this).attr("value","");
		}
	});
	
	$(".un").blur(function(){
		if ($(this).attr("value") == "") $(this).attr("value", "Tunnus");
	});
	
	$(".nm").blur(function(){
		if ($(this).attr("value") == "") $(this).attr("value", "Yrityksesi nimi");
	});
	
	$(".em").blur(function(){
		if ($(this).attr("value") == "") $(this).attr("value", "Sähköpostiosoite");
	});
	
	$(".pw").blur(function(){
		if ($(this).attr("value") == "") $(this).attr("value", "Salasana ");
	});
	
	$("#realpw").blur(function(){
		if ($("#realpw").attr("value") == ""){
			$(".realpw").show(); 
			//$(this).hide(); 
		}
	});
	
	$("#pwbig").blur(function(){
		if ($("#pwbig").attr("value") == ""){
			$("#pwholderbig").show(); 
			$(this).hide(); 
		}
	});
	
});
