﻿
(function(jQuery){jQuery.fn.extend({defaultValue:function(o,callback){var options=o||{};var settings=jQuery.extend({value:options.value||null},options);return this.each(function(index,element){var $input=$(this);var defaultValue=settings.value||$input.attr('placeholder');var callbackArguments={'input':$input};var $clone=createClone();callbackArguments.clone=$clone;$clone.insertAfter($input);var setState=function(){if($input.val().length<=0){$clone.show();$input.hide();}else{$clone.hide();$input.show();}};$input.bind('blur',setState);function createClone(){var $el;if($input.context.nodeName.toLowerCase()=='input'){$el=jQuery("<input />").attr({'type':$input.context.attributes["type"].value});}else if($input.context.nodeName.toLowerCase()=='textarea'){$el=jQuery("<textarea />");}
$el.attr({'value':defaultValue,'class':$input.attr('class')+' empty','size':$input.attr('size'),'style':$input.attr('style'),'tabindex':$input.attr('tabindex'),'id':'defaultvalue-clone-'+(((1+Math.random())*0x10000)|0).toString(16).substring(1)});$el.focus(function(){$el.hide();$input.show();setTimeout(function(){$input.focus();},1);});return $el;}
setState();if(callback){callback(callbackArguments);}});}});})(jQuery);
;;;
jQuery.fn.selectbox=function(options){var settings={className:'jquery-selectbox',animationSpeed:"normal",listboxMaxSize:10,replaceInvisible:false};var commonClass='jquery-custom-selectboxes-replaced';var listOpen=false;var showList=function(listObj){var selectbox=listObj.parents('.'+settings.className+'');listObj.slideDown(settings.animationSpeed,function(){listOpen=true;});selectbox.addClass('selecthover');jQuery(document).bind('click',onBlurList);return listObj;};var hideList=function(listObj){var selectbox=listObj.parents('.'+settings.className+'');listObj.slideUp(settings.animationSpeed,function(){listOpen=false;jQuery(this).parents('.'+settings.className+'').removeClass('selecthover');});jQuery(document).unbind('click',onBlurList);return listObj;};var onBlurList=function(e){var trgt=e.target;var currentListElements=jQuery('.'+settings.className+'-list:visible').parent().find('*').andSelf();if(jQuery.inArray(trgt,currentListElements)<0&&listOpen){hideList(jQuery('.'+commonClass+'-list'));}
return false;};settings=jQuery.extend(settings,options||{});return this.each(function(){var _this=jQuery(this);if(_this.filter(':visible').length==0&&!settings.replaceInvisible)
return;var replacement=jQuery('<div class="'+settings.className+' '+commonClass+'">'+'<div class="'+settings.className+'-moreButton" />'+'<div class="'+settings.className+'-list '+commonClass+'-list" />'+'<span class="'+settings.className+'-currentItem" />'+'</div>');jQuery('option',_this).each(function(k,v){var v=jQuery(v);var listElement=jQuery('<span class="'+settings.className+'-item value-'+v.val()+' item-'+k+'">'+v.text()+'</span>');listElement.click(function(){var thisListElement=jQuery(this);var thisReplacment=thisListElement.parents('.'+settings.className);var thisIndex=thisListElement[0].className.split(' ');for(k1 in thisIndex){if(/^item-[0-9]+$/.test(thisIndex[k1])){thisIndex=parseInt(thisIndex[k1].replace('item-',''),10);break;}};var thisValue=thisListElement[0].className.split(' ');for(k1 in thisValue){if(/^value-.+$/.test(thisValue[k1])){thisValue=thisValue[k1].replace('value-','');break;}};thisReplacment.find('.'+settings.className+'-currentItem').text(thisListElement.text());thisReplacment.find('select').val(thisValue).triggerHandler('change');var thisSublist=thisReplacment.find('.'+settings.className+'-list');if(thisSublist.filter(":visible").length>0){hideList(thisSublist);}else{showList(thisSublist);}}).bind('mouseenter',function(){jQuery(this).addClass('listelementhover');}).bind('mouseleave',function(){jQuery(this).removeClass('listelementhover');});jQuery('.'+settings.className+'-list',replacement).append(listElement);if(v.filter(':selected').length>0){jQuery('.'+settings.className+'-currentItem',replacement).text(v.text());}});replacement.find('.'+settings.className+'-moreButton').click(function(){var thisMoreButton=jQuery(this);var otherLists=jQuery('.'+settings.className+'-list').not(thisMoreButton.siblings('.'+settings.className+'-list'));hideList(otherLists);var thisList=thisMoreButton.siblings('.'+settings.className+'-list');if(thisList.filter(":visible").length>0){hideList(thisList);}else{showList(thisList);}}).bind('mouseenter',function(){jQuery(this).addClass('morebuttonhover');}).bind('mouseleave',function(){jQuery(this).removeClass('morebuttonhover');});_this.hide().replaceWith(replacement).appendTo(replacement);var thisListBox=replacement.find('.'+settings.className+'-list');var thisListBoxSize=thisListBox.find('.'+settings.className+'-item').length;if(thisListBoxSize>settings.listboxMaxSize)
thisListBoxSize=settings.listboxMaxSize;if(thisListBoxSize==0)
thisListBoxSize=1;var thisListBoxWidth=Math.round(_this.width()+5);if(jQuery.browser.safari)
thisListBoxWidth=thisListBoxWidth*0.94;replacement.css('width',thisListBoxWidth+'px');thisListBox.css({width:Math.round(thisListBoxWidth-5)+'px',height:thisListBoxSize*21+'px'});});};jQuery.fn.unselectbox=function(){var commonClass='jquery-custom-selectboxes-replaced';return this.each(function(){var selectToRemove=jQuery(this).filter('.'+commonClass);selectToRemove.replaceWith(selectToRemove.find('select').show());});};
;;;
$(document).ready(function(){$("div.tweetmemeRetweet").each(function(){var tweetmeme_url=$(this).attr("tweetmeme_url");var tweetmeme_source=$(this).attr("tweetmeme_source");var tweetmeme_style=$(this).attr("tweetmeme_style");var _url=window.location.href;var _url=_url.replace(/((?:\?|&)?fbc_receiver=.+)?(?:#.*)?$/,"");var url=escape(typeof tweetmeme_url=="string"?tweetmeme_url:typeof TWEETMEME_URL=="string"?TWEETMEME_URL:_url).replace(/\+/g,"%2b");var source=typeof tweetmeme_source=="string"?escape(tweetmeme_source):typeof TWEETMEME_SOURCE=="string"?escape(TWEETMEME_SOURCE):false;var style=typeof tweetmeme_style=="string"?escape(tweetmeme_style):typeof TWEETMEME_STYLE=="string"?escape(TWEETMEME_STYLE):"normal";var service=typeof tweetmeme_service=="string"?escape(tweetmeme_service):typeof TWEETMEME_SERVICE=="string"?escape(TWEETMEME_SERVICE):false;var service_api=typeof tweetmeme_service_api=="string"?escape(tweetmeme_service_api):typeof TWEETMEME_SERVICE_API=="string"?escape(TWEETMEME_SERVICE_API):false;var alias=typeof tweetmeme_alias=="string"?escape(tweetmeme_alias):typeof TWEETMEME_ALIAS=="string"?escape(TWEETMEME_ALIAS):false;var src="http://api.tweetmeme.com/button.js";switch(style){case"compact":var h=20;var w=90;break;case"rednose":var h=61;var w=50;break;default:var h=61;var w=50;break;}
src+="?url="+url;src+="&style="+style;if(source!=false){src+="&source="+source;}
if(service){src+="&service="+service;}
if(service_api){src+="&service_api="+service_api;}
if(alias){src+="&alias="+alias;}
$(this).html('<iframe src="'+src+'" height="'+h+'" width="'+w+'" frameborder="0" scrolling="no"></iframe>');$(".twitter").css("background-image","none");});$("span.tweetmemeFollow").each(function(){var tweetmeme_screen_name=$(this).attr("tweetmeme_screen_name");var screen_name=escape((typeof tweetmeme_screen_name=="string")?tweetmeme_screen_name:((typeof TWEETMEME_SCREEN_NAME=="string")?TWEETMEME_SCREEN_NAME:false));var style=(typeof tweetmeme_style=="string")?escape(tweetmeme_style):((typeof TWEETMEME_STYLE=="string")?escape(TWEETMEME_STYLE):"normal");var size=(typeof tweetmeme_size=="string")?escape(tweetmeme_size):((typeof TWEETMEME_SIZE=="string")?escape(TWEETMEME_SIZE):false);if(screen_name){var src="http://api.tweetmeme.com/v2/follow.js";switch(style){case"compact":var h=16;var w=85;break;case"square":var h=size;var w=size;break;default:var h=30;var w=85;break;}
src+="?screen_name="+screen_name;src+="&style="+style;$(this).html('<iframe src="'+src+'" height="'+h+'" width="'+w+'" frameborder="0" scrolling="no"></iframe>')}});});
;;;
$(document).ready(function(){$("#email").defaultValue();$("#Email").defaultValue();$("#q").defaultValue();$("#search").submit(function(e){if($("#q").val()==""){e.preventDefault();$("<div title='Please enter a search'></div>").append("You did not enter a search value in. Please enter one to continue").dialog({modal:true});return false;}
else{e.preventDefault();window.location="/search/"+escape(escape($("#q").val().replace(/ /g,"+").replace(/&/g,"").replace(/"/g,"").replace(/>/g,"").replace(/</g,"")));return false;}});$(".submitbutton").click(function(){$.ajax
window.location="?etEmail="+escape($("#email").val().replace(/ /g,"+").replace(/&/g,"").replace(/"/g,"").replace(/>/g,"").replace(/</g,""));});});
;;;;;;