 /*
 * sdExample
 * Copyright (c) 2010 Sliced Design (http://www.sliceddesign.com)
 * Author: Jeremy Hamel
 * Version: 1.0 (OCT 13, 2010)
 * jQuery Version: 1.3.2 or later
 * Dual licensed under the MIT and GPL licenses.
 */
(function($){$.fn.sdExample=function(){$(this).each(function(){var a=$(this);var b=new Date().getTime();var c='';if(a.attr('id').length>0){c=a.attr('id')}else{c='id-'+b;a.attr('id')=c}if($("label[for='"+c+"']").length<1){$("label[for='"+c+"']").prepend('<label for="'+c+'"></label>')}$("label[for='"+c+"']").hide();a.val(setValue(c));if(a.attr('type')=='password'){var d=c+'-'+b;$('<input type="text" id="'+d+'" name="'+d+'" value="'+setValue(c)+'" />').insertBefore(a);a.hide().val('')}a.focus(function(){if($(this).val()===setValue(c)){$(this).val('')}});$('#'+d).focus(function(){$('#'+d).hide();a.show().focus()});a.blur(function(){setBlur(a,c,d)});$('#'+d).blur(function(){setBlur(a,c,d)})})};function setValue(a){var b='';if($("label[for='"+a+"']").text().length>0){b=$("label[for='"+a+"']").text()}else if($('#'+a).attr('title').length>0){b=$('#'+a).attr('title')}return b};function setBlur(a,b,c){if(a.val()===''){if(a.attr('type')=='password'){$('#'+c).val(setValue(b)).show();a.val('').hide()}else{a.val(setValue(b))}}}})(jQuery);
