$(document).ready(function() {

	activatePlaceholders();


});

//placeholder function for other browsers
function activatePlaceholders() {
    var detect = navigator.userAgent.toLowerCase();
    if (detect.indexOf("safari") > 0) return false;
    var inputs = document.getElementsByTagName("input");
    for (var i = 0; i < inputs.length; i++) {
        var input = inputs[i];
        if (input.getAttribute("placeholder")) {
            var placeholderValue = input.getAttribute("placeholder");
            if (placeholderValue.length > 0) {
                if (input.value.length == 0) {
                    input.value = placeholderValue;
                }
                jQuery(input).css({"color": "#aaa"});//set gray color for placeholder
                input.onclick = function() {
                    if (this.value == placeholderValue) {
                        $(this).css({"color": "#333"});//set darker color for input value (user started write)
                        this.value = "";
                    }
                    return false;
                };
                input.onblur = function() {
                    if (this.value.length == 0) {
                        this.value = placeholderValue;
                        $(this).css({"color": "#aaa"});//set back gray color for placeholder
                    }
                }
            }
        }
    }
}
