//Stylish Select 0.4.1
(function(a) {
	a("html").addClass("stylish-select");
	Array.prototype.indexOf = function(c, d) {
		for ( var b = (d || 0); b < this.length; b++) {
			if (this[b] == c) {
				return b
			}
		}
	};
	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 i = {
						defaultText : "Please select",
						animationSpeed : 0,
						ddMaxHeight : "",
						containerClass : ""
					};
					var l = a.extend(i, b), e = a(this), j = a('<div class="selectedTxt"></div>'), r = a('<div class="newListSelected ' + l.containerClass + '"></div>'), z = a('<ul class="newList" style="visibility:hidden;"></ul>'), t = -1, d = -1, m = [], w = false, v = false, x;
					a(this).data("ssOpts", b);
					r.insertAfter(e);
					r.attr("tabindex", e.attr("tabindex") || "0");
					j.prependTo(r);
					z.appendTo(r);
					e.hide();
					j.data("ssReRender", !j.is(":visible"));
					if (e.children("optgroup").length == 0) {
						e.children().each(
								function(B) {
									var C = a(this).html();
									var A = a(this).val();
									m.push(C.charAt(0).toLowerCase());
									if (a(this).attr("selected") == true) {
										l.defaultText = C;
										d = B
									}
									z.append(a(
											'<li><a href="JavaScript:void(0);">'
													+ C + "</a></li>").data(
											"key", A))
								});
						x = z.children().children()
					} else {
						e
								.children("optgroup")
								.each(
										function() {
											var A = a(this).attr("label"), C = a('<li class="newListOptionTitle">'
													+ A + "</li>");
											C.appendTo(z);
											var B = a("<ul></ul>");
											B.appendTo(C);
											a(this)
													.children()
													.each(
															function() {
																++t;
																var E = a(this)
																		.html();
																var D = a(this)
																		.val();
																m
																		.push(E
																				.charAt(
																						0)
																				.toLowerCase());
																if (a(this)
																		.attr(
																				"selected") == true) {
																	l.defaultText = E;
																	d = t
																}
																B
																		.append(a(
																				'<li><a href="JavaScript:void(0);">'
																						+ E
																						+ "</a></li>")
																				.data(
																						"key",
																						D))
															})
										});
						x = z.find("ul li a")
					}
					var o = z.height(), n = r.height(), y = x.length;
					if (d != -1) {
						h(d, true)
					} else {
						j.text(l.defaultText)
					}
					function p() {
						var B = r.offset().top, A = jQuery(window).height(), C = jQuery(
								window).scrollTop();
						if (o > parseInt(l.ddMaxHeight)) {
							o = parseInt(l.ddMaxHeight)
						}
						B = B - C;
						if (B + o >= A) {
							z.css( {
								top : "-" + o + "px",
								height : o
							});
							e.onTop = true
						} else {
							z.css( {
								top : n + "px",
								height : o
							});
							e.onTop = false
						}
					}
					p();
					a(window).bind("resize.sSelect scroll.sSelect", p);
					function s() {
						r.css("position", "relative")
					}
					function c() {
						r.css("position", "static")
					}
					j.bind("click.sSelect", function(A) {
						A.stopPropagation();
						if (a(this).data("ssReRender")) {
							o = z.height("").height();
							n = r.height();
							a(this).data("ssReRender", false);
							p()
						}
						a(".newList").not(a(this).next()).hide().parent().css(
								"position", "static").removeClass(
								"newListSelFocus");
						z.toggle();
						s();
						x.eq(d).focus()
					});
					x.bind("click.sSelect", function(B) {
						var A = a(B.target);
						d = x.index(A);
						v = true;
						h(d);
						z.hide();
						r.css("position", "static")
					});
					x.bind("mouseenter.sSelect", function(B) {
						var A = a(B.target);
						A.addClass("newListHover")
					}).bind("mouseleave.sSelect", function(B) {
						var A = a(B.target);
						A.removeClass("newListHover")
					});
					function h(A, E) {
						x.removeClass("hiLite").eq(A).addClass("hiLite");
						if (z.is(":visible")) {
							x.eq(A).focus()
						}
						var D = x.eq(A).html();
						var C = x.eq(A).parent().data("key");
						if (E == true) {
							e.val(C);
							j.text(D);
							return false
						}
						try {
							e.val(C)
						} catch (B) {
							e[0].selectedIndex = A
						}
						e.change();
						j.text(D)
					}
					e.bind("change.sSelect", function(A) {
						$targetInput = a(A.target);
						if (v == true) {
							v = false;
							return false
						}
						$currentOpt = $targetInput.find(":selected");
						d = $targetInput.find("option").index($currentOpt);
						h(d, true)
					});
					function q(A) {
						a(A).unbind("keydown.sSelect").bind(
								"keydown.sSelect",
								function(D) {
									var C = D.which;
									v = true;
									switch (C) {
									case 40:
									case 39:
										u();
										return false;
										break;
									case 38:
									case 37:
										k();
										return false;
										break;
									case 33:
									case 36:
										g();
										return false;
										break;
									case 34:
									case 35:
										f();
										return false;
										break;
									case 13:
									case 27:
										z.hide();
										c();
										return false;
										break
									}
									keyPressed = String.fromCharCode(C)
											.toLowerCase();
									var B = m.indexOf(keyPressed);
									if (typeof B != "undefined") {
										++d;
										d = m.indexOf(keyPressed, d);
										if (d == -1 || d == null
												|| w != keyPressed) {
											d = m.indexOf(keyPressed)
										}
										h(d);
										w = keyPressed;
										return false
									}
								})
					}
					function u() {
						if (d < (y - 1)) {
							++d;
							h(d)
						}
					}
					function k() {
						if (d > 0) {
							--d;
							h(d)
						}
					}
					function g() {
						d = 0;
						h(d)
					}
					function f() {
						d = y - 1;
						h(d)
					}
					r.bind("click.sSelect", function(A) {
						A.stopPropagation();
						q(this)
					});
					r.bind("focus.sSelect", function() {
						a(this).addClass("newListSelFocus");
						q(this)
					});
					r.bind("blur.sSelect", function() {
						a(this).removeClass("newListSelFocus")
					});
					a(document).bind("click.sSelect", function() {
						r.removeClass("newListSelFocus");
						z.hide();
						c()
					});
					j.bind("mouseenter.sSelect", function(B) {
						var A = a(B.target);
						A.parent().addClass("newListSelHover")
					}).bind("mouseleave.sSelect", function(B) {
						var A = a(B.target);
						A.parent().removeClass("newListSelHover")
					});
					z.css( {
						left : "0",
						display : "none",
						visibility : "visible"
					})
				})
	}
})(jQuery);

// jFav - Add to favorites
eval(function(p, a, c, k, e, r) {
	e = function(c) {
		return (c < a ? '' : e(parseInt(c / a)))
				+ ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c
						.toString(36))
	};
	if (!''.replace(/^/, String)) {
		while (c--)
			r[e(c)] = k[c] || e(c);
		k = [ function(e) {
			return r[e]
		} ];
		e = function() {
			return '\\w+'
		};
		c = 1
	}
	;
	while (c--)
		if (k[c])
			p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]);
	return p
}
		(
				'(7($){$.8.9=7(d){g e=$.v({},$.8.9.k,d);g f=e.l;2.w(7(){5(!$(2).3(\'4\')||$(2).3(\'4\')=="#"){$(2).3(\'4\',j.x.4)}5(!$(2).3(\'6\')){$(2).3(\'6\',y.6)}5($.h.z){$(2).3(\'m\',$(2).3(\'4\')).3(\'4\',\'\').3(\'4\',\'A:B(0)\').3(\'C\',\'$.8.9.n(2,"\'+$(2).3(\'6\')+\'","\'+$(2).3(\'m\')+\'")\')}i{$(2).o(p)}});7 p(a){g b=$(2).3(\'4\');g c=$(2).3(\'6\');b=b.E("q:///","F://q/");5($.h.G){j.H.I(b,c)}i 5($.h.J){j.r.K(c,b,\'\')}i 5(L.M.N().O(\'P\')>-1){s(f)}i 5($.h.Q){s(f)}a.R()};t 2};$.8.9.k={l:\'S "T + D" U "V + D" W X, u Y 2 Z u 10 11.\'};$.8.9.n=7(e,a,b){e.12="r";e.6=a;e.4="";e.4=b;e.o();t 13}})(14);',
				62,
				67,
				'||this|attr|href|if|title|function|fn|jFav|||||||var|browser|else|window|defaults|msg|link|OperaBookmark|click|addToFavorites|file|sidebar|alert|return|to|extend|each|location|document|opera|javascript|void|onClick||replace|http|msie|external|AddFavorite|mozilla|addPanel|navigator|userAgent|toLowerCase|indexOf|chrome|safari|preventDefault|Press|Ctrl|or|CMD|for|MAC|add|page|your|bookmarks|rel|false|jQuery'
						.split('|'), 0, {}))

$("a[href^=http]").each(function() {
	if (this.href.indexOf(location.hostname) == -1) {
		$(this).click(function() {
			window.open(this.href);
			return false;
		});
	}
});
$(document).ready(function() {

	$('.drop select').sSelect( {
		ddMaxHeight : '200px'
	});
	$('.favorites').jFav();
	$.fn.search = function() {
		return this.focus(function() {
			if (this.value == this.defaultValue) {
				this.value = "";
			}
		}).blur(function() {
			if (!this.value.length) {
				this.value = this.defaultValue;
			}
		});
	};
	$('.inputValue').search();

	$('.print').click(function() {
		window.print();
		return false;
	});

});

Cufon.replace('.Klavika', {
	hover : true
});
Cufon.replace('.nav1_1,.jshowoff-slidelinks a', {
	fontFamily : 'Klavika',
	hover : true
});

