$(function() {
    $("#gallery-home").PikaChoose({ show_prev_next: false, slide_enabled: true, auto_play: true });

    // validate signup form on keyup and submit
    $("#newsletterForm").validate();

    $("#aspnetForm").validate();

    //global vars
    var inputBoxes = $(".input");
    var firstName = $("#firstname");
    var firstNameVal = "First name";
    var surname = $("#surname");
    var surnameVal = "Surname";
    var email = $("#email");
    var emailVal = "Email";
    var phone = $("#phone");
    var phoneVal = "Phone number";
    var location = $("#city");
    var locationVal = "Living in?";
    var search = $("#search");
    var searchVal = "Search the site...";

    //Effects for both searchbox
    inputBoxes.focus(function(e) {
        $(this).addClass("active");
    });
    inputBoxes.blur(function(e) {
        $(this).removeClass("active");
    });

    //show/hide default text if needed

    search.focus(function() {
        if ($(this).attr("value") == searchVal) $(this).attr("value", "");
    });
    search.blur(function() {
        if ($(this).attr("value") == "") $(this).attr("value", searchVal);
    });

    /*firstName.focus(function() {
    if ($(this).attr("value") == firstNameVal) $(this).attr("value", "");
    });
    firstName.blur(function() {
    if ($(this).attr("value") == "") $(this).attr("value", firstNameVal);
    });

        surname.focus(function() {
    if ($(this).attr("value") == surnameVal) $(this).attr("value", "");
    });
    surname.blur(function() {
    if ($(this).attr("value") == "") $(this).attr("value", surnameVal);
    });

        email.focus(function() {
    if ($(this).attr("value") == emailVal) $(this).attr("value", "");
    });
    email.blur(function() {
    if ($(this).attr("value") == "") $(this).attr("value", emailVal);
    });

        phone.focus(function() {
    if ($(this).attr("value") == phoneVal) $(this).attr("value", "");
    });
    phone.blur(function() {
    if ($(this).attr("value") == "") $(this).attr("value", phoneVal);
    });

        location.focus(function() {
    if ($(this).attr("value") == locationVal) $(this).attr("value", "");
    });
    location.blur(function() {
    if ($(this).attr("value") == "") $(this).attr("value", locationVal);
    });*/
});
