/*
 * @since 2009-01-27
 * @author Ian Ferguson <ian.ferguson@ontario.ca>
 *
 * Looks for input[type="text"] within forms containing a class of "searchfield", looping through
 * these elments and:
 *
 * 1) If the browser is Safari, replaces the input with apple's proprietary "search" type.
 *
 * 2) Adds default placeholder text to the input value (all browsers /w language support)
 *
 * 2) Adds anonymous click and focus functions to these elements, resetting the placeholder
 *    string if focus is lost and the input value contains nothing but whitespace.
 */
$(function(){var d=25;var f="searchfield";var e="english";var b="Search";var c=window.location.href.toLowerCase();var a=window.location.hostname.toLowerCase();if(/\/french\//.test(window.location.href.toLowerCase())){e="french";b="Recherche";}if(jQuery.browser.safari){$('form input[type="text"][class*="'+f+'"]').each(function(){var n=$('<input type="search" />').attr({results:d,autosave:a,incremental:a,placeholder:b});for(var h,g,m=0,l=$(this)[0].attributes.length;m<l;m++){h=$(this)[0].attributes[m].nodeName;g=$(this)[0].attributes[m].nodeValue;if(h=="type"){continue;}n.attr(h,g);}if(/\/(english|french)\/(?:index\.shtml)?$/.test(c)){n.css({"margin-left":"7px",width:"127px"});}$(this).after(n).remove();});}else{$('form input[type="text"][class*="'+f+'"]').each(function(){$(this).attr("value",b).bind("click, focus",function(){if($(this).attr("value")==b){$(this).attr("value","");}}).bind("blur",function(){if(/^[ \t]*$/.test($(this).attr("value"))){$(this).attr("value",b);}});});}});
