/*
 * jQuery Placeholder 0.2
 * 
 * http://www.dimeg.net/code/jquery/placeholder/
 * 
 * 
 * MIT License
 * ----
 *
 * Copyright (c) 2011 Vadim Sitel
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy 
 * of this software and associated documentation files (the "Software"), to deal 
 * in the Software without restriction, including without limitation the rights 
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 
 * copies of the Software, and to permit persons to whom the Software is 
 * furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in 
 * all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 
 * THE SOFTWARE.
 */
(function(d){d.fn.placeholder=function(j){var b={name:null,"css-field-class":null,"css-placeholder-class":null,"css-placeholder-focused-class":null,color:null,"focused-color":null,callback:function(){},"callback-delay":null};return this.each(function(){j&&d.extend(b,j);var i=d(this),g="";d(this).attr("placeholder")!=null&&(g=d(this).attr("placeholder"),d(this).removeAttr("placeholder"));if(b.name!=null)g=b.name;var k=640;b["callback-delay"]!=null&&(k=b["callback-delay"]);var c=i.clone(!0);b["css-field-class"]!=
null?c.toggleClass(b["css-field-class"]):(c.css("padding","8px"),c.css("margin","0"),c.css("border","none"),c.css("border-width","1px"),c.css("border-style","solid"),c.css("border-color","#cccccc"),c.css("font-size","10pt"),c.css("font-family","Arial"));var f=d("<span/>");f.css("position","relative");f.css("display","inline-block");var m=parseFloat(c.css("border-top-width"))+parseFloat(c.css("margin-top")),n=parseFloat(c.css("border-left-width"))+parseFloat(c.css("margin-left")),a=d("<div/>");a.html(g);
a.css("display","block");a.css("position","absolute");a.css("top",m);a.css("left",n);a.css("margin-left","1px");a.css("padding",c.css("padding"));b["css-placeholder-class"]!=null?a.toggleClass(b["css-placeholder-class"]):(a.css("text-align",c.css("text-align")),a.css("font-size",c.css("font-size")),a.css("font-family",c.css("font-family")),b.color!=null?a.css("color",b.color):a.css("color","#cdd0d1"));var e=d("<div/>");e.addClass("placeholder-clear");e.css("position","absolute");e.css("top","0px");
e.css("right","0px");f.empty();f.append(c);f.append(a);f.append(e);g=i.parent();i.remove();g.append(f);c.val().length<1?(a.css("display","block"),e.css("display","none")):(a.css("display","none"),e.css("display","block"));a.bind("click",function(){d(this).css("color","#e1e1e1");b["css-placeholder-focused-class"]!=null&&(d(this).removeClass(b["css-placeholder-class"]),d(this).toggleClass(b["css-placeholder-focused-class"]));b["focused-color"]!=null&&a.css("color",b["focused-color"]);c.focus()});c.bind("blur",
function(){d(this).val().length<1?(a.css("display","block"),a.css("color","#cdd0d1"),b["css-placeholder-class"]!=null&&(a.removeClass(b["css-placeholder-focused-class"]),a.toggleClass(b["css-placeholder-class"])),b.color!=null&&a.css("color",b.color)):a.css("display","none")});c.bind("focus",function(){d(this).val().length<1?(a.css("display","block"),a.css("color","#e1e1e1"),b["css-placeholder-focused-class"]!=null&&(a.removeClass(b["css-placeholder-class"]),a.toggleClass(b["css-placeholder-focused-class"])),
b["focused-color"]!=null&&a.css("color",b["focused-color"])):a.css("display","none")});c.bind("keydown",function(){a.css("display","none")});var l=null,h=c.clone(!0);c.unbind("keyup").bind("keyup",function(){clearTimeout(l);var a=d(this);l=setTimeout(function(){h.val(a.val());h.trigger("keyup");var c={value:a.val()};d.isFunction(b.callback)&&b.callback.call(a,c);a.val().length<1?e.css("display","none"):e.css("display","block")},k)});e.bind("click",function(){h.val("");h.trigger("keyup");h.focus()})})}})(jQuery);

		$(document).ready(function() {
			$("#your-name").placeholder({
				//"callback": function (data) { alert('d: ' + data.value) }
			});
			$("#your-email").placeholder({
				//"callback": function (data) { alert('d: ' + data.value) }
			});
			$("#your-tel").placeholder({
				//"callback": function (data) { alert('d: ' + data.value) }
			});
			$("#your-company").placeholder({
				//"callback": function (data) { alert('d: ' + data.value) }
			});
			$("#your-message").placeholder({
				//"callback": function (data) { alert('d: ' + data.value) }
			});
		});
