$(document).ready(function() {
	var bolIsIE6 = false;
	if ($.browser.msie && $.browser.version.substr(0,1)<7) {
	   bolIsIE6 = true;
	}
	var bolIsIphone = false;
	if (navigator.userAgent.match(/iPhone/i)) {
		bolIsIphone = true;
	}
	var strLost = "";					   
	var bolareyoulost = false;
	var intWorkBottom = 0;
	var intScrollTop = 0;
	var bolSideAbs = false;
	var intSideTopTmp = 0;
	var bolHome = true;
	var iContactClose;
	var arrFilters = [];
	var bolFilterMedium = false;
	var bolFilterYear = false;
	var arrUncheckMedium = [];
	var arrUncheckYear = [];
	var bolAutoFilterClick = false;
	var arrIE6Age = ["a nine", "a ten", "an eleven", "a twelve", "a thirteen", "a fourteen", "a fifteen", "a sixteen"];

	
	function setWorkBottom() {
		
		//intWorkBottom = $("#footer").position().top - (66 + $("#sideright").height());
		intWorkBottom = $("#home").height() - $("#footer").height() - $("#sideright").height() - 191;
		
		intScrollTop = $(document).scrollTop();
		
		if (bolareyoulost) {
			$("#areyoulost").animate({top:($(document).scrollTop() + 80)},{duration:400, queue:false});
		}
		
		if (intScrollTop > intWorkBottom) {
			if (bolSideAbs == false) {
				$("#sideright").css({"position":"absolute", "top":"auto", "bottom":"479px"});
				bolSideAbs = true;
			}
		} else if (bolSideAbs == true) {
			$("#sideright").css({"position":"fixed", "bottom":"auto", "top":"0px"});
			bolSideAbs = false;
		}
		onScroll();
	}
	$(window).load(setWorkBottom);
	
	if ($("#home").length > 0 && bolIsIE6 == false) {
		var intScrollState = 0;
		var bolFirstChange = false;
		
		if (bolIsIphone == false) { 
			$(".work .drkoverlay").css("opacity", 0.9).show();
		}
		
		$(".work a").each(function () {
			$(this).attr("href", $(this).attr("href").replace("/?w=", "#/"));
		});
		
		$("#filter").show();
		var strTwotes;
		strTwotes = "<div id=\"twotes\">\n";
		strTwotes += "\t<h5><span>Twotes</span></h5>\n";
		strTwotes += "\t<p></p>\n";
		strTwotes += "</div>\n";
		$("#filter").after(strTwotes);
		
		var strWorkDetails;
		strWorkDetails = "<div id=\"workdetails\">\n";
		strWorkDetails += "\t<div id=\"workdetailsheader\"\n>";
		strWorkDetails += "\t\t<a href=\"#\" id=\"viewsite\"><span>View Site</span></a>\n";
		strWorkDetails += "\t\t<div class=\"clear\"></div>\n";
		strWorkDetails += "\t\t<a href=\"/\" id=\"gohome\"><span>Go Home</span></a>\n";
		strWorkDetails += "\t</div>\n";
		strWorkDetails += "</div>";
		$("#main").append(strWorkDetails);
		$("#workdetails").hide();
		var url = "http://twitter.com/status/user_timeline/15236023.json?count=1&callback=?"; 
		
		String.prototype.makelinks = function() 
		{
		  return this.replace(/[A-Za-z]+:\/\/[A-Za-z0-9-_]+\.[A-Za-z0-9-_:%&\?\/.=]+/g, function(m) 
		  {
			m = m.link(m);
			return m;
		  });
		};

		$.getJSON(url, 
		function(data){ 
			$.each(data, function(i, item) {
				if (bolIsIphone) {
					$("#twotes p").html(item.text).show();
				} else {
					$("#twotes p").html(item.text.makelinks()).slideDown(setWorkBottom);
				}
			}); 
		});
		
		$("#contactform textarea").css("resize","none");
		
		var d = new Date();
		var intCurYear = d.getYear() + 1900;
		$("#filter img").data("checked", true).click(function() {
			if ($(this).data("checked") == true) {
				if ($("img[src$='unchecked.gif']", $(this).parent().parent()).length < 3) {
					$(this).data("checked", false).attr("src", $(this).attr("src").replace("checked", "unchecked"));
					if ($(this).next().text() == ("< " + (intCurYear - 3))) {
						$(".work:not(." + intCurYear + ", ." + (intCurYear - 1) + ", ." + (intCurYear - 2) + "):not(:first)").slideUp();
						$(".work:not(." + intCurYear + ", ." + (intCurYear - 1) + ", ." + (intCurYear - 2) + "):first").slideUp(setWorkBottom);
					} else {
						if (bolIsIphone) {
							$(".work." + $(this).next().text().toLowerCase()).hide();
						} else {
							$(".work." + $(this).next().text().toLowerCase() + ":not(:first)").slideUp();
							$(".work." + $(this).next().text().toLowerCase() + ":first").slideUp(setWorkBottom);
						}
					}
					if (bolAutoFilterClick == false && $.address.value() != "" && $.address.value() != "/") {
						$.address.value("/");
					}
				}
			} else {
				$(this).data("checked", true).attr("src", $(this).attr("src").replace("unchecked", "checked"));
				var strQuery = "";
				if ($(this).parent().parent().attr("id") == "filteryear") {
					
					$("#filtermedium li img").each(function(i) {
						if ($(this).data("checked") == false) {
							if (strQuery != "") {
								strQuery += ", ";
							}
							strQuery += "." + $(this).next().text().toLowerCase();
						}
					});
					
					if ($(this).next().text() == ("< " + (intCurYear - 3))) {
						if (strQuery != "") {
							strQuery = ", " + strQuery;
						}
						strQuery = ":not(." + intCurYear + ", ." + (intCurYear - 1) + ", ." + (intCurYear - 2) + strQuery + ")";
					} else {
						if (strQuery != "") {
							strQuery = ":not(" + strQuery + ")";
						}
						strQuery = "." + $(this).next().text() + strQuery;
					}
					if (bolIsIphone) {
						$(".work" + strQuery).show();
					} else {
						$(".work" + strQuery + ":not(:first)").slideDown();
						$(".work" + strQuery + ":first").slideDown(setWorkBottom);
					}
					
				} else {
					if ($("#filteryear li:contains('<') img").data("checked") == false) {
						strMedium = ".work." + $(this).next().text().toLowerCase();
						$("#filteryear li img").each(function(i) {
							if ($(this).data("checked") == true) {
								if (strQuery != "") {
									strQuery += ", ";
								}
								strQuery += strMedium + "." + $(this).next().text();
								
							}
						});
						
						$(strQuery + ":not(:first)").slideDown();
						$(strQuery + ":first").slideDown(setWorkBottom);
					} else {
						$("#filteryear li img").each(function(i) {
							if ($(this).data("checked") == false) {
								if (strQuery != "") {
									strQuery += ", ";
								}
								strQuery += "." + $(this).next().text();
								
							}
						});
						if (strQuery != "") {
							strQuery = ":not(" + strQuery + ")";
						}
						if (bolIsIphone) {
							$(".work." + $(this).next().text().toLowerCase() + strQuery).show();
						} else {
							$(".work." + $(this).next().text().toLowerCase() + strQuery).slideDown(setWorkBottom);
						}
					}
				}
				if (bolAutoFilterClick == false && $.address.value() != "" && $.address.value() != "/") {
					$.address.value("/");
				}
			}
			bolAutoFilterClick = false;
		});
		$("#filter li span").click(function() {
			$("img", $(this).parent()).click();
		});
		
		$("#contactbg", $("#contact").css({height:"49px", "bottom":"-49px"})).css({"background-image":"url(/images/arrowup.gif)"});
		$("#contact #name, #contact #email, #contact #message, #contact #send").attr("tabindex", "-1");
		$("#contact h5").toggle(
		  function () {
			$("#contact #name").attr("tabindex", "1");
			$("#contact #email").attr("tabindex", "2");
			$("#contact #message").attr("tabindex", "3");
			$("#contact #send").attr("tabindex", "4");
			$("#contactbg", $("#contact").stop(true, false).animate({height:"315px"}, "def", 'easeOutSine')).css("background-image", "url(/images/arrowdown.gif)");
		  },
		  function () {
			clearInterval(iContactClose);
			$("#contact #name, #contact #email, #contact #message, #contact #send").attr("tabindex", "-1");
			$("#contactbg", $("#contact").stop(true, false).animate({height:"49px"}, "def", 'easeOutSine')).css("background-image", "url(/images/arrowup.gif)");
		  }
		);
		
		$("#contactform #name").val("NAME").focus(function() {
			if ($.trim($(this).val()) == "NAME" || $.trim($(this).val()) == "PLEASE ENTER NAME") {
				$(this).val("");
			}
		});
		$("#contactform #name").blur(function() {
			if ($.trim($(this).val()) == "") {
				if ($(this).data("error") == true) {
					$(this).val("PLEASE ENTER NAME");
				} else {
					$(this).val("NAME");
				}
			}
		});
		$("#contactform #email").val("EMAIL").focus(function() {
			if ($.trim($(this).val()) == "EMAIL" || $.trim($(this).val()) == "PLEASE ENTER EMAIL") {
				$(this).val("");
			}
		});
		$("#contactform #email").blur(function() {
			if ($.trim($(this).val()) == "") {
				if ($(this).data("error") == true) {
					$(this).val("PLEASE ENTER EMAIL");
				} else {
					$(this).val("EMAIL");
				}
			}
		});
		$("#contactform #message").val("MESSAGE").focus(function() {
			if ($.trim($(this).val()) == "MESSAGE" || $.trim($(this).val()) == "PLEASE ENTER MESSAGE") {
				$(this).val("");
			}
		});
		$("#contactform #message").blur(function() {
			if ($.trim($(this).val()) == "") {
				if ($(this).data("error") == true) {
					$(this).val("PLEASE ENTER MESSAGE");
				} else {
					$(this).val("MESSAGE");
				}
			}
		});
		$("#name, #email, #message").data("error", false).keypress(function (e) {
			if ($(this).data("error") == true) {
				$(this).data("error", false).stop(true, false).animate({ backgroundColor: "#262626" }, 460, 'easeOutSine');
			}
		});
		function fieldError(strID) {
			$("#" + strID).data("error", true).val("PLEASE ENTER " + strID.toUpperCase()).stop(true, false).animate({ backgroundColor: "#FF3D45" }, 280, 'easeOutSine');
		}
		$("#contactform").submit(function() {
			var bolErrors = false;
			var strName = $("#name", this).val();
			var strEmail = $("#email", this).val();
			var strMessage = $("#message", this).val();
			
			if (strName == "" || strName == "NAME" || strName == "PLEASE ENTER NAME") {
				bolErrors = true;
				fieldError("name");
			}
			if ($.isValidEmailAddress(strEmail) == false) {
				bolErrors = true;
				fieldError("email");
			}
			if (strMessage == "" || strMessage == "MESSAGE" || strMessage == "PLEASE ENTER MESSAGE") {
				bolErrors = true;
				fieldError("message");
			}
			
			
			if (bolErrors == false) {				
				$.post($(this).attr("action"), { name:strName, email:strEmail, message:strMessage }, function(data){
					if (data == "SUCCESSFUL") {
						$("#contactbg").append("<em>Thank you for contacting Jason Nelson.</em>");
						$("#contactform").fadeOut("fast");
						$("#contactbg em").fadeIn("fast");
						
						iContactClose = setTimeout(function() {
							clearInterval(iContactClose);
							$("#contact h5").click();
						}, 1200);
						
					} else {
						var arrResponse = data.replace("ERRORS: ", "").split(" ");
						for (var i = 0; i < arrResponse.length; i++) {
							fieldError(arrResponse[i]);
						}
					}
				});
				
			}
			
			return false;
		});
		$("#gohome").click(function() {
			$.address.value("/");
			return false;
		});
		function goHome() {
			// go to/stay at home
			
			/*
			//fade
			
			$("#workdetails").css({"position":"absolute", "top":"-" + ($(window).scrollTop() - 110) + "px", "height":"100%"}).fadeOut(700, function() {
				$(this).css({"position":"static", "height":"auto"});
			});
			$("#home").fadeIn(700);
			$.scrollTo(intScrollState, 700);
			
			*/
			
			if (parseInt($("#home").css("left")) < 0 || $("#home:hidden").length > 0) {
				$("#loading").show();
				
				var intScrollTmp = $(window).scrollTop();
				
				if (bolIsIphone) {
					$("#workdetails").hide();
					$("#home").show();
					$.scrollTo(intScrollState);
				} else {
				
					$("#main").css({"min-height":$("#workdetails").height()+"px", "padding-right":"0px", "padding-left":"0px"});
					$("#home").stop(true, false).show();
					if (bolSideAbs) {
						$("#sideright").css({"position":"absolute", "top":intSideTopTmp + "px", "bottom":"auto"});
					} else {
						$("#sideright").css({"position":"absolute", "top":(intScrollState - 17) + "px", "bottom":"auto"});
					}
					
					$("#workdetails").stop(true, false).css({"height": $("#workdetails").height()+"px", "position":"absolute", "top":"-" + $(window).scrollTop() + "px"});
					
					if ($("#home").css("left") == "0px") {
						$("#home").css({"left":"940px", "top":"-" + intScrollState + "px"});
					}

					setTimeout(function() {
						$("#workdetails #workdetailsheader h5, #workdetails #workdetailsheader h6").remove();
						
						$("#workdetails #workdetailsheader").css({"position":"absolute", "top":intScrollTmp+ "px"});
						$("#loading").hide();
										
						$("#workdetails").animate({left:"-940px"}, 1100, "easeInSine", function() {
							$(this).hide().css({"position":"static", "left":"0px", "height":"auto"});
							$("#main").css({"min-height":"0px"});
						});
						
						$("#home").animate({left:"0px"}, 1100, "easeInSine", function() {
							$("#main").css({"padding-right":"7px", "padding-left":"7px"});
							if (bolSideAbs) {
								$("#sideright").css({"position":"absolute", "top":"auto", "bottom":"479px"});
							} else {
								$("#sideright").css({"position":"fixed", "top":"0px", "bottom":"auto"});
							}
							bolHome = true;
							$(this).css({"top":"0px"});
							$.scrollTo(intScrollState);
	
							if ($("#home .work .description .sIFR-replaced").length == 0) {
								onScroll();
								sIFRActivate();
							}
						});
						
					}, 190);
					
				}
				
			} else if ($("#home .work .description .sIFR-replaced").length == 0) {
				if (bolIsIphone == false) {
					sIFRActivate();
				}
			}
		}
		
		var intTotalImgs = 0;
		var intCurrentLoaded = 0;
		function gotoWorkDetails() {
			intCurrentLoaded++;
			if (intCurrentLoaded >= intTotalImgs) {
				$("#loading").hide();
				
				intScrollState = $(window).scrollTop();
				/*
				//fade
				
				$("#workdetails").css({"position":"absolute", "top":intScrollState + "px", "height":"100%"}).fadeIn(1000, function() {
					$(this).css({"position":"static", "height":"auto"});
					$.scrollTo(0);
				});
				sIFRActivate();
				$("#home").fadeOut(1000);
				*/
				
				if (bolIsIphone) {
					$("#home").hide();
					$("#workdetails").show();
					$.scrollTo(0);
				} else {
					
					bolHome = false;
					if (bolSideAbs) {
						intSideTopTmp = $("#sideright").position().top;
						$("#sideright").css({"position":"absolute", "bottom":"auto", "top":intSideTopTmp + "px"});
					} else {
						$("#sideright").css({"position":"absolute", "top":($(window).scrollTop() - 17) + "px", "bottom":"auto"});
					}
					
					$("#workdetails #workdetailsheader").css({"position":"absolute", "top":"0px"});
					$("#main").css({"min-height":$("#workdetails").height()+"px"});
					
					$("#home").css({"top":"-" + intScrollState + "px"});
					$.scrollTo(0);
					
					$("#home").stop(true, false).animate({left:"-940px"}, 1000, function() {
						$(this).hide();
					});
					$("#workdetails").stop(true, false).css({"height": $("#workdetails").height()+"px", "position":"absolute", "left":"940px", "top":"0px"}).show().animate({left:"0px"}, 1000, function() {																																																	
						onScroll();
						$("#workdetails #workdetailsheader").css({"position":"fixed"});
						$(this).css({"position":"static", "height":"auto"});
						$("#main").css({"min-height":"0px"});	
						sIFRActivate();
						$("#home").css({"left":"940px", "top":"-" + intScrollState + "px"});
					});
					
				}
			}
		}
		function getWorkDetails(strDeeplink) {
			$("#loading").show();
			$.get("/workdetails/", {deeplink: strDeeplink, mainClass:$("#main").attr("class")}, function(data) {
				if (data.success == true) {
					$("#workdetails #workdetailsheader h5, #workdetails #workdetailsheader h6").remove();
					var strHeaders = "<h5>" + data.viewworktitle + "</h5>\n";
					strHeaders += "<h6>" + data.client + "</h6>\n";
					strHeaders += "<h6>" + data.role + "</h6>\n";
					$("#workdetails #workdetailsheader").prepend(strHeaders);
					
					if (data.siteurl != "") {
						$("#viewsite").attr("href", data.siteurl).show();
					} else {
						$("#viewsite").hide();
					}
					$("#workdetails .subimgholder").remove();
					
					intTotalImgs = data.images.length;
					intCurrentLoaded = 0;
					for (var j = 0; j < intTotalImgs; j++) {
						$("#workdetails").append("<div class=\"subimgholder\"><img src=\"" + data.images[j] + "\" alt=\"" + data.viewworktitle + "\" /><span class=\"drkoverlaysub\"></span></div>\n");
					}
					if (bolIsIphone == false) { 
						$("#workdetails .drkoverlaysub").css("opacity", 0.9).show();
					}
					
					$("#main").css({"padding-right":"0px", "padding-left":"0px"});
					if (bolFirstChange == false) {
						bolHome = false;
						$("#home").hide();
						$("#workdetails").show();
						onScroll();
						if (bolIsIphone == false) {
							sIFRActivate();
						}
						$("#loading").hide();
					} else {
						$('#workdetails img').load(function() {
							gotoWorkDetails();
						});
						/*
						intScrollState = $(window).scrollTop();
						
						$("#workdetails").css({"position":"absolute", "top":intScrollState + "px", "height":"100%"}).fadeIn(1200, function() {
							$(this).css({"position":"static", "height":"auto"});
							$.scrollTo(0);
							sIFRActivate();
						});
						
						$("#home").fadeOut(1200);
						*/
						
						
						/*
						$("#sideright").css({"position":"absolute", top:($(window).scrollTop() - 17) + "px"});
						$("#home").stop(true, false).animate({left:"-940px"}, "slow", 'easeInOutSine', function() {
							$(this).hide();
						});
						$("#workdetails").stop(true, false).css({"height": $("#workdetails").height()+"px", "position":"absolute", "left":"940px"}).show().animate({left:"0px"}, "slow", 'easeInOutSine', function() {
							$(this).css({"position":"static", "height":"auto"});	
							sIFRActivate();
						});
						$.scrollTo(0, 500);
						*/
					}
				} else {
					goHome();
				}
				bolFirstChange = true;
				
			}, "json");	
		}
		
		//deeplinking code
		$.address.change(function(event) {
			var strValue = event.value;
			if (bolareyoulost) {
				bolareyoulost = false;
				$("#greyoverlay, #areyoulost").remove();
				strLost = "";
				$(window).unbind('scroll', onScroll);
			}
			if (strValue != "/" && strValue != "") {
				if (strValue.charAt(0) == "/") {
					strValue = strValue.substr(1);
				}
				
				arrFilters = strValue.split("-");
				arrUncheckMedium = [];
				arrUncheckYear = [];
				bolFilterMedium = false;
				bolFilterYear = false;
				
				var bolTmpFind = false; 
				$("ul#filtermedium li:not(li#medium)").each(function() {
					bolTmpFind = false
					for (var g = 0; g < arrFilters.length; g++) {
						if (arrFilters[g].toLowerCase() == $("span", this).text().toLowerCase()) {
							bolFilterMedium = true;
							bolTmpFind = true;
						}
					}
					if (bolTmpFind == false) {
						arrUncheckMedium.push($("img", this));	
					}
				});
				$("ul#filteryear li:not(li#year)").each(function() {
					bolTmpFind = false
					for (var h = 0; h < arrFilters.length; h++) {
						if (arrFilters[h].toLowerCase() == $("span", this).text().replace("< ", "").toLowerCase()) {
							bolFilterYear = true;
							bolTmpFind = true;
						}
					}
					if (bolTmpFind == false) {
						arrUncheckYear.push($("img", this));
					}
				});
				
				if (bolFilterMedium == true || bolFilterYear == true) {
					if (bolFilterMedium) {
						for (var e = 0; e < arrUncheckMedium.length; e++) {
							bolAutoFilterClick = true;
							arrUncheckMedium[e].data("checked", true).click();
							
							bolFirstChange = true;
							goHome();
						}
					}
					if (bolFilterYear) {
						for (var f = 0; f < arrUncheckYear.length; f++) {
							bolAutoFilterClick = true;
							arrUncheckYear[f].data("checked", true).click();
							
							bolFirstChange = true;
							goHome();
						}
					}
				} else if (strValue == "areyoulost") {
					areyoulost();
					bolFirstChange = true;
					goHome();
					/*
					if (bolIsIphone == false) {
						sIFRActivate();
					}
					*/
				} else {
					getWorkDetails(strValue);
				}
			} else {
				
				bolFirstChange = true;
				goHome();
			}
		});
		
	} else {
		sIFRActivate();
	} 
	if (bolIsIE6) {
		areyoulost();
	}
	
	var intScrollWindow = 0;
	var intScrollWindowSub = 0;
	function onScroll(event) {

		if (bolareyoulost) {
			$("#areyoulost").animate({top:($(document).scrollTop() + 80)},{duration:400, queue:false});
		}
		
		if (bolHome) {
			
			intScrollTop = $(document).scrollTop();
			
			intScrollWindow = intScrollTop + $(window).height() - 120;
			
			if (bolIsIphone == false) {
				$(".drkoverlay:visible:not(:animated)").each(function(index) {
					if ($(this).offset().top < intScrollWindow) {
						$(this).fadeOut(1420);
					}
				});
			}
				
			
			if (intScrollTop > intWorkBottom) {
				if (bolSideAbs == false) {
					$("#sideright").css({"position":"absolute", "top":"auto", "bottom":"479px"});
					bolSideAbs = true;
				}
			} else if (bolSideAbs == true) {
				$("#sideright").css({"position":"fixed", "bottom":"auto", "top":"0px"});
				bolSideAbs = false;
			}
			
		} else {
			//work details scrolling
			if (bolIsIphone == false) {
				
				intScrollWindowSub = $(document).scrollTop() + $(window).height() - 140;
				
				$(".drkoverlaysub:visible:not(:animated)").each(function(index) {
					if ($(this).offset().top < intScrollWindowSub) {
						$(this).fadeOut(1440);
					}
				});
				
			}
		}
	}
	
	if (bolIsIphone == false) {
		$(window).bind('scroll', onScroll);
		/*
		if ($(document).scrollTop() < 150) {
			$(".work:first img").load(function() {
				onScroll();
			});
		} else {
			*/
			setTimeout(function() {
				onScroll();
			}, 320);
		//}
	}
	
	function areyoulost() {
		if (strLost == "") {
			var strAge = "a severely";
			var now = new Date();
			var intYearIndex = now.getFullYear() - 2010;
			if (intYearIndex > -1 && intYearIndex < arrIE6Age.length) {
				strAge = arrIE6Age[intYearIndex] + " year";
			}
			
			bolareyoulost = true;
			strLost += "<div id=\"greyoverlay\"></div>\n";
			strLost += "<div id=\"areyoulost\">\n";
			strLost += "\t<p>Hello,</p>\n";
			strLost += "\t<p>Unfortunately, IE 6 does not support many of the features of this site.</p>\n";
			strLost += "\t<p>It has many issues with web standards and the security of your information.</p>\n";
			strLost += "\t<p>Companies such as Google, You Tube, and Digg are phasing out support for IE 6 as well.</p>\n";
			strLost += "\t<p>Please upgrade to the latest version of IE or try Firefox, Chrome, Safari, or Opera.</p>\n";
			strLost += "</div>";
			$("body").append(strLost);
			$("#greyoverlay").css({"opacity":0.6, "height":$("#main").height() + "px"});
			
			if (bolIsIphone == false) {
				$("#areyoulost").animate({top:($(document).scrollTop() + 80)},{duration:400, queue:false});
			}
		}
	}
	
	if ( window.addEventListener ) {
		var hitkeys = [];
		var konami = "38,38,40,40,37,39,37,39,66,65,";
		function keyHit(e) {
			if (konami.indexOf((e.keyCode.toString() + ",")) >= 0) {
				hitkeys.push(e.keyCode);
				if ((hitkeys.toString() + ",").indexOf(konami) >= 0 ) {
					window.removeEventListener("keydown", keyHit, true);
				
					//pageTracker._trackPageview('/konamicode');
					
					alert("Sorry, no Konami Code easter egg implemented yet. Check back soon!");
				}
			} else {
				hitkeys = [];
			}
		}
		window.addEventListener("keydown", keyHit, true);
	}
	setWorkBottom();
});
$.isValidEmailAddress = function(emailAddress) {
	var pattern = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);
	return pattern.test(emailAddress);
}