/*================================ 
 Duck Brand
 
 Last Updated By: Ryan Perry
 Last Updated: 11/14/2011
================================*/

/*================================================
 jQuery Text Shadow
================================================*/
/* Created by Martin Hintzmann 2008 martin [a] hintzmann.dk
 * MIT (http://www.opensource.org/licenses/mit-license.php) licensed.
 * Version: 0.2
 * Requires: jQuery 1.2+
 * http://plugins.jquery.com/project/textshadow
 *
 */
(function($){$.fn.textShadow=function(option){if(!$.browser.msie)return;var IE6=$.browser.version<7;return this.each(function(){var el=$(this);var shadow=el.textShadowParse(this.currentStyle["text-shadow"]);shadow=$.extend(shadow,option);el.textShadowRemove();if(shadow.x==0&&shadow.y==0&&shadow.radius==0)return;if(el.css("position")=="static"){el.css({position:"relative"});}
el.css({zIndex:"0"});if(IE6){el.css({zoom:"1"});}
var span=document.createElement("span");$(span).addClass("jQueryTextShadow");$(span).html(el.html());$(span).css({padding:this.currentStyle["padding"],width:el.width(),position:"absolute",zIndex:"-1",color:shadow.color!=null?shadow.color:el.css("color"),left:(-parseInt(shadow.radius)+parseInt(shadow.x))+"px",top:(-parseInt(shadow.radius)+parseInt(shadow.y))+"px"});if(shadow.radius!=0){if(shadow.opacity!=null){$(span).css("filter","progid:DXImageTransform.Microsoft.Blur(pixelradius="+parseInt(shadow.radius)+", enabled='true', makeShadow='true', ShadowOpacity="+shadow.opacity+")");}else{$(span).css("filter","progid:DXImageTransform.Microsoft.Blur(pixelradius="+parseInt(shadow.radius)+", enabled='true')");}}
el.append(span);});};$.fn.textShadowParse=function(value)
{value=String(value).replace(/^\s+|\s+$/gi,'').replace(/\s*!\s*important/i,'').replace(/\(\s*([^,\)]+)\s*,\s*([^,\)]+)\s*,\s*([^,\)]+)\s*,\s*([^\)]+)\s*\)/g,'($1/$2/$3/$4)').replace(/\(\s*([^,\)]+)\s*,\s*([^,\)]+)\s*,\s*([^\)]+)\s*\)/g,'($1/$2/$3)')
var shadow={x:0,y:0,radius:0,color:null};if(value.length>1||value[0].toLowerCase()!='none'){value=value.replace(/\//g,',');var color;if(value.match(/(\#[0-9a-f]{6}|\#[0-9a-f]{3}|(rgb|hsb)a?\([^\)]*\)|\b[a-z]+\b)/i)&&(color=RegExp.$1)){shadow.color=color.replace(/^\s+/,'');value=value.replace(shadow.color,'');}
value=value.replace(/^\s+|\s+$/g,'').split(/\s+/).map(function(item){return(item||'').replace(/^0[a-z]*$/,'')?item:0;});switch(value.length)
{case 1:shadow.x=shadow.y=value[0];break;case 2:shadow.x=value[0];shadow.y=value[1];break;case 3:shadow.x=value[0];shadow.y=value[1];shadow.radius=value[2];break;}
if((!shadow.x&&!shadow.y&&!shadow.radius)||shadow.color=='transparent'){shadow.x=shadow.y=shadow.radius=0;shadow.color=null;}}
return shadow;};$.fn.textShadowRemove=function(){if(!$.browser.msie)return;return this.each(function(){$(this).children("span.jQueryTextShadow").remove();});};})(jQuery);if(typeof Array.prototype.map=='undefined'){Array.prototype.map=function(fnc){var a=new Array(this.length);for(var i=0;i<this.length;i++){a[i]=fnc(this[i]);}
return a;}}


/*================================================
 Stylish Select Plugin
================================================*/
/**
* Stylish Select 0.4.5 - jQuery plugin to replace a select drop down box with a stylable unordered list
* http://github.com/sko77sun/Stylish-Select
* Requires: jQuery 1.3 or newer
* Contributions from Justin Beasley: http://www.harvest.org/ Anatoly Ressin: http://www.artazor.lv/ Wilfred Hughes: https://github.com/Wilfred
* Dual licensed under the MIT and GPL licenses.
*/
//(function(a){a("html").addClass("stylish-select");if(!Array.prototype.indexOf){Array.prototype.indexOf=function(d){if(this===void 0||this===null){throw new TypeError()}var e=Object(this);var b=e.length>>>0;if(b===0){return -1}var f=0;if(arguments.length>0){f=Number(arguments[1]);if(f!==f){f=0}else{if(f!==0&&f!==(1/0)&&f!==-(1/0)){f=(f>0||-1)*Math.floor(Math.abs(f))}}}if(f>=b){return -1}var c=f>=0?f:Math.max(b-Math.abs(f),0);for(;c<b;c++){if(c in e&&e[c]===d){return c}}return -1}}a.fn.extend({getSetSSValue:function(b){if(b){a(this).val(b).change();return this}else{return a(this).find(":selected").val()}},resetSS:function(){var b=a(this).data("ssOpts");$this=a(this);$this.next().remove();$this.unbind(".sSelect").sSelect(b)}});a.fn.sSelect=function(b){return this.each(function(){var l={defaultText:"Please select",animationSpeed:0,ddMaxHeight:"",containerClass:""};var o=a.extend(l,b),f=a(this),m=a('<div class="selectedTxt"></div>'),u=a('<div class="newListSelected '+o.containerClass+'"></div>'),k=a('<div class="SSContainerDivWrapper" style="visibility:hidden;"></div>'),C=a('<ul class="newList"></ul>'),w=-1,e=-1,j=-1,p=[],z=false,y=false,A;a(this).data("ssOpts",b);u.insertAfter(f);u.attr("tabindex",f.attr("tabindex")||"0");m.prependTo(u);C.appendTo(u);C.wrap(k);k=C.parent();f.hide();m.data("ssReRender",!m.is(":visible"));if(f.children("optgroup").length==0){f.children().each(function(E){var F=a(this).html();var D=a(this).val();p.push(F.charAt(0).toLowerCase());if(a(this).attr("selected")=="selected"||a(this).attr("selected")==true){o.defaultText=F;e=j=E}C.append(a('<li><a href="JavaScript:void(0);">'+F+"</a></li>").data("key",D))});A=C.children().children()}else{f.children("optgroup").each(function(){var D=a(this).attr("label"),F=a('<li class="newListOptionTitle">'+D+"</li>"),E=a("<ul></ul>");F.appendTo(C);E.appendTo(F);a(this).children().each(function(){++w;var H=a(this).html();var G=a(this).val();p.push(H.charAt(0).toLowerCase());if(a(this).attr("selected")=="selected"||a(this).attr("selected")==true){o.defaultText=H;e=j=w}E.append(a('<li><a href="JavaScript:void(0);">'+H+"</a></li>").data("key",G))})});A=C.find("ul li a")}var r=C.height(),q=u.height(),B=A.length;if(e!=-1){i(e)}else{m.text(o.defaultText)}function s(){var E=u.offset().top,D=a(window).height(),F=a(window).scrollTop();if(r>parseInt(o.ddMaxHeight)){r=parseInt(o.ddMaxHeight)}E=E-F;if(E+r>=D){C.css({height:r});k.css({top:"-"+r+"px",height:r});f.onTop=true}else{C.css({height:r});k.css({top:q+"px",height:r});f.onTop=false}}s();a(window).bind("resize.sSelect scroll.sSelect",s);function v(){u.css("position","relative")}function d(){u.css({position:"static"})}m.bind("click.sSelect",function(D){D.stopPropagation();if(a(this).data("ssReRender")){r=C.height("").height();k.height("");q=u.height();a(this).data("ssReRender",false);s()}a(".SSContainerDivWrapper").not(a(this).next()).hide().parent().css("position","static").removeClass("newListSelFocus");k.toggle();v();if(e==-1){e=0}A.eq(e).focus()});function c(E,D){if(E==true){j=e;f.change()}if(D==true){e=j;i(e)}k.hide();d()}A.bind("click.sSelect",function(E){var D=a(E.target);e=A.index(D);y=true;i(e,true);c()});A.bind("mouseenter.sSelect",function(E){var D=a(E.target);D.addClass("newListHover")}).bind("mouseleave.sSelect",function(E){var D=a(E.target);D.removeClass("newListHover")});function i(D,H){if(D==-1){m.text(o.defaultText);A.removeClass("hiLite")}else{A.removeClass("hiLite").eq(D).addClass("hiLite");var G=A.eq(D).text(),F=A.eq(D).parent().data("key");try{f.val(F)}catch(E){f[0].selectedIndex=D}m.text(G);if(H==true){j=D;f.change()}if(k.is(":visible")){A.eq(D).focus()}}}f.bind("change.sSelect",function(E){var D=a(E.target);if(y==true){y=false;return false}var F=D.find(":selected");e=D.find("option").index(F);i(e)});function t(D){a(D).unbind("keydown.sSelect").bind("keydown.sSelect",function(G){var F=G.which;y=true;switch(F){case 40:case 39:x();return false;break;case 38:case 37:n();return false;break;case 33:case 36:h();return false;break;case 34:case 35:g();return false;break;case 13:case 27:c(true);return false;break}keyPressed=String.fromCharCode(F).toLowerCase();var E=p.indexOf(keyPressed);if(typeof E!="undefined"){++e;e=p.indexOf(keyPressed,e);if(e==-1||e==null||z!=keyPressed){e=p.indexOf(keyPressed)}i(e);z=keyPressed;return false}})}function x(){if(e<(B-1)){++e;i(e)}}function n(){if(e>0){--e;i(e)}}function h(){e=0;i(e)}function g(){e=B-1;i(e)}u.bind("click.sSelect",function(D){D.stopPropagation();t(this)});u.bind("focus.sSelect",function(){a(this).addClass("newListSelFocus");t(this)});u.bind("blur.sSelect",function(){a(this).removeClass("newListSelFocus")});a(document).bind("click.sSelect",function(){u.removeClass("newListSelFocus");if(k.is(":visible")){c(false,true)}else{c(false)}});m.bind("mouseenter.sSelect",function(E){var D=a(E.target);D.parent().addClass("newListSelHover")}).bind("mouseleave.sSelect",function(E){var D=a(E.target);D.parent().removeClass("newListSelHover")});k.css({left:"0",display:"none",visibility:"visible"})})}})(jQuery);



