(function(a){a.fn.placeholder=function(b){var c=a.extend({placeholderClass:"placeholder",placeholderAttribute:"title"},b);return this.each(function(){var d=a(this).attr(c.placeholderAttribute);var e=a.trim(a(this).val());if(!e||e==""||e==d){a(this).addClass(c.placeholderClass).val(d)}a(this).focus(function(){var f=a.trim(a(this).val());if(f==d){a(this).removeClass(c.placeholderClass).val("")}}).blur(function(){var f=a.trim(a(this).val());if(!f||f==""||f==d){a(this).val(d).addClass(c.placeholderClass)}})})},a.fn.targetBlank=function(b){var c=a.extend({append:"External link, opens in a new window"},b);var d=a(this).attr("title");if(d){a(this).attr("title",d+" - "+c.append)}else{a(this).attr("title",c.append)}return this.bind("click enter",function(){window.open(a(this).attr("href"));return false})},a.readCookie=function(f){var g=f+"=";var d=document.cookie.split(";");for(var e=0;e<d.length;e++){var b=d[e];while(b.charAt(0)==" "){b=b.substring(1,b.length)}if(b.indexOf(g)==0){return b.substring(g.length,b.length)}}return null},a.writeCookie=function(d){var e=a.extend({name:"cookieName",value:"cookieValue",ttl:7},d);if(e.ttl){var b=new Date();b.setTime(b.getTime()+(e.ttl*24*60*60*1000));var c="; expires="+b.toGMTString()}document.cookie=e.name+"="+e.value+c+"; path=/"},a.fn.toggleList=function(b){var c=a.extend({items:5,more:"show more",moreClass:"more",less:"hide",lessClass:"less"},b);return this.each(function(){var e=a(this);a(this).children("li").not(":lt("+(c.items-1)+")").hide();var d=a("<a></a>").attr({"class":c.moreClass,href:"#"}).html(c.more).toggle(function(){a(this).html(c.less).attr("class",c.lessClass);a(e).children("li").not(":lt("+(c.items-1)+")").show()},function(){a(this).html(c.more).attr("class",c.moreClass);a(e).children("li").not(":lt("+(c.items-1)+")").hide()});a(this).append(d)})},a.fn.smoothScroll=function(b){var c=a.extend({duration:5000,easing:"linear"},b);var d=a(this).attr("href");a("html,body").animate({scrollTop:a(d).offset().top},c.duration,c.easing,function(){location.hash=d});return false},a.fn.tooltip=function(b){var c=a.extend({offsetX:-10,offsetY:10,tooltipId:"tooltip"},b);return this.each(function(){var e=a(this).attr("title");var d=a(this).children(".tooltip-content").html();if(e!=""){a(this).data({tooltip:e,title:e})}else{if(d!=""){a(this).data({tooltip:d})}}a(this).bind("mouseover",function(){a(this).attr("title","");a(this).addClass("tooltip-js");a("body").append("<span id="+c.tooltipId+">"+a(this).data("tooltip")+"</span>")}),a(this).bind("mousemove",function(f){var h=a(this).offset();var g=a("#"+c.tooltipId);a(g).css({zIndex:"99999",top:f.pageY+c.offsetY,left:(f.pageX+c.offsetX)-(a(g).outerWidth()/2)})}),a(this).hover(function(){},function(){a("#"+c.tooltipId).remove();a(this).removeClass("tooltip-js");var f=a(this).data("title");if(f){a(this).attr("title",f)}})})},a.fn.getUrlParameters=function(){var e=[],b;var c=window.location.href.slice(window.location.href.indexOf("?")+1).split("&");for(var d=0;d<c.length;d++){b=c[d].split("=");e.push(b[0]);e[b[0]]=b[1]}return e},a.fn.emptyFunction=function(b){var c=a.extend({attribute:"value",attribute2:"value2"},b);return this.each(function(){})}})(jQuery);
