$(function() {
if ( typeof Modernizr !== 'undefined' && !Modernizr.input.placeholder ) {
// always declare javascript variables at the top of the script
var $elements, $i, $x, $len, $formInput, $inputField, $form;

$('form').each(function() {
	$form = this;
	//$form = document.getElementById('frm-form').elements;
	
	$i = 0;
	
	//set placeholder values for internet explorer
	for ($len = $form.length; $i < $len; $i += 1) {
	    if ($form[$i].getAttribute("placeholder") != undefined && $form[$i].type !== "submit" && $form[$i].type !== "password") {
	
	        $form[$i].value = $form[$i].getAttribute("placeholder");
	
	    } // if not undefined
	} // end for loop
	
	$inputField = $form.getElementsByTagName('input');
	
	$x = 0;
	
	// loop through input areas to make sure placeholder disappears on focus
	for ($len = $inputField.length; $x < $len; $x += 1) {
	
	    // Don't change the submit input!
	    if ($inputField[$x].type !== "submit" && $inputField[$x].type !== "password") {
	
	        // Give placeholder text a grey colour
	        $inputField[$x].style.color = "#999";
	
	        //Delete the placeholder text and change CSS text colour to black on user focus
	        $inputField[$x].onfocus = function () {
	
	            this.value = "";
	            this.style.color = "#000";
	
	        };
	
	    }
	
	} // if not undefined
});
}
});
