// Removed from header to make indexing problem go away		
function ShowQuickForm() {
			if ($('.profile_container').is(':hidden')) {
				$('#quickform_spacer').slideDown("slow");

				var pos = $('#nav_profile').css('backgroundPosition');
				var pos_arr = pos.split(" ");
				$('#nav_profile').addClass('quickform_active');
				$('#nav_profile').css({backgroundPosition: pos_arr[0] + " -87px"});
				
				$('.profile_container').slideDown("slow", function() {
					$('.profile_form').fadeIn("slow", function() {
						$('#profile_form_input').focus();
						var elementHeight = $('.profile_container').height(); 
						$('.profile_container').css('height', elementHeight + 'px'); 
					});
				});
			}
			else {
				$('#profile_form_input').blur();
				var pos = $('#nav_profile').css('backgroundPosition');
				var pos_arr = pos.split(" ");
				$('#nav_profile').removeClass('quickform_active');
				if ($('#nav_profile').hasClass('nav_active')) {
					$('#nav_profile').css({backgroundPosition: pos_arr[0] + " -58px"});
				}
				else {
					$('#nav_profile').css({backgroundPosition: pos_arr[0] + " 0"});
				}
				$('.profile_form').fadeOut("slow", function () {
					$('#quickform_spacer').slideUp("fast", function() {
						$('.profile_container').slideUp("fast");
					});
				});
			}
		}
		function qfGo() {
			if ($('#profile_form_input').val() != '') $.cookie('user_last', $('#profile_form_input').val(), { path: '/', expires: 7 });
			location.href='/user/' + $('#profile_form_input').val();
		}
		var nextcomment = '';
		var ajaxcommentinprocess = false;
		function MoreComments(urlid,commentid) {
			if (nextcomment != '') commentid = nextcomment;
			if ((commentid != '0') && (ajaxcommentinprocess == false)) {
				ajaxcommentinprocess = true;
				$(".loading_comments").fadeIn('slow');
				$.get("/ajax/more_comments.php", { urlid: urlid, commentid: commentid },
				function(data){
					data_arr = data.split("\n",2);
					nextcomment = data_arr[0];
					comment_count = data_arr[1];
					meta = nextcomment + "\n" + comment_count;
					$(".morecommentshere").append('<div class="comment_' + commentid + '" style="display:none">' + data.substring(meta.length) + '</div>');
					$(".loading_comments").fadeOut('slow', function () {
						$('.comment_' + commentid).slideToggle("slow");
					});
					$("#comment_show_count").text(parseInt(comment_count)+parseInt($("#comment_show_count").text()));
					if (nextcomment == '0') {
						$(".ajax_comment_more_link").fadeOut('slow', function() {
							$(".ajax_comment_more_link").text('Showing all ' + $("#comment_show_count").text() + ' Tweets for this URL.');
							$(".ajax_comment_more_link").fadeIn('slow')
						});
					}
					ajaxcommentinprocess = false;
				});
			}
		}
		$(document).ready(function(){
			(function($) {
				jQuery.fn.backgroundPosition = function() {
					var p = $(this).css('background-position');
					if(typeof(p) == 'undefined') return $(this).css('background-position-x') + ' ' + $(this).css('background-position-y');
					else return p;
				};
			})(jQuery);

			if ($(".searchbox_input").val() != '') {
				$(".searchbox").css({backgroundPosition: "0 -22px"});
			}
			if ($.cookie('hidecomments') == 'hide') {
				$(".comments_section_top").slideToggle("slow");
				$(".comments_section").toggle();
				$("#HideShowComments").html("Show Comments");
			}
			if ($.cookie('user_last') != '') {
				$('#profile_form_input').val($.cookie('user_last'));
			}
			$(".searchbox_input")
				.focus(function(){
					$(".searchbox").css({backgroundPosition: "0 -22px"});
				})
				.blur(function(){
					if ($(".searchbox_input").val() == '') {
						$(".searchbox").css({backgroundPosition: "0 0"});
					}
				})
				.end();
			$("#search_form").submit(function(){
				var pos = $('.searchbox').offset();
				var leftpos = pos.left-25;
				$('.searchtip').css({opacity:0.95});
			    $('#searchtimeinfo').fadeIn('fast').css({top: 8, left: leftpos});
			});
			$('.tweetcount')
				.hover(
					function () {
						$(this).css({backgroundPosition: "0 -53px"});
					}, 
					function () {
						$(this).css({backgroundPosition: "0 0"});
					}
				)
				.end();
			$('.tweetcount').html("");
			$(".nav ul li")
				.hover(
					function () {
						if ((!jQuery(this).hasClass('nav_active')) && (!jQuery(this).hasClass('quickform_active'))) {
							var pos = $(this).backgroundPosition();
							var pos_arr = pos.split(" ");
							$(this).css({backgroundPosition: pos_arr[0] + " -29px"});
						}
					}, 
					function () {
						if ((!jQuery(this).hasClass('nav_active')) && (!jQuery(this).hasClass('quickform_active'))) {
							var pos = $(this).backgroundPosition();
							var pos_arr = pos.split(" ");
							$(this).css({backgroundPosition: pos_arr[0] + " 0"});
						}
					}
				)
				.end();
			var pos = $(".nav_active").backgroundPosition();
			var pos_arr = pos.split(" ");
			$(".nav_active").css({backgroundPosition: pos_arr[0] + " -58px"});
			$(".usertip")
				.hover(
					function () {
						$this_id = $(this).attr("id") + '_content';

						var pos = $(this).offset();
						var toploc = pos.top-$("#" + $this_id).height();
						var leftloc = pos.left-25;
						$("#" + $this_id).css({opacity:0.95});
						$("#" + $this_id).fadeIn('fast').css({top: toploc, left: leftloc});
					},
					function () {
						$this_id = $(this).attr("id") + '_content';
						$("#" + $this_id).fadeOut('fast');
					}
				)
				.end();
			$(".lang_menu")
				.hover(
					function () {
						var pos = $('.lang_menu').offset();
						var posTop = pos.top+18;
						var posLeft = pos.left+10;
						$('.lang_menu_items').css({opacity:0.9, display:"block", top: posTop, left: posLeft});
					}, 
					function () {
						$('.lang_menu_items').css('display', 'none');
					}
				)
				.end();
			$(".lang_menu_items UL LI")
				.hover(
					function () {
						$(this).css({backgroundColor:'#F4FAFD'});
					}, 
					function () {
						$(this).css({backgroundColor:'#fff'});
					}
				)
				.click(function(){
					window.location = $(this).children("a").attr("href");
				})
				.end();
			$("div")
				.filter(".tweet_it")
					.hover(
						function () {
							$(this).css({backgroundPosition: "0 -22px"});
						}, 
						function () {
							$(this).css({backgroundPosition: "0 0"});
						}
					)
					.click(function(){
						$ti = $(this).attr("id");
						$ti_arr = $ti.split("_");
						tb_show('','/ajax/tweetit.php?urlid=' + $ti_arr[2] + '&amp;a=form&amp;placeValuesBeforeTB_=savedValues&amp;TB_iframe=true&amp;height=350&amp;width=450&amp;modal=true');
					})
				.end()
				.filter(".paginate")
					.hover(
						function () {
							$(this).css({backgroundColor: "#ddd"});
						}, 
						function () {
							$(this).css({backgroundColor: "#fff"});
						}
					)
				.end();
			$("span")
				.filter("#HideShowComments")
					.hover(
						function () {
							$(this).css({"text-decoration": "underline"});
						}, 
						function () {
							$(this).css({"text-decoration": "none"});
						}
					)
					.click(
						function(){
							$(".comments_section_top").slideToggle("slow");
							$(".comments_section").toggle();
							if ($('.comments_section').is(':hidden')) {
								$.cookie('hidecomments', 'hide', { path: '/', expires: 7 });
								$("#HideShowComments").html("Show Comments");
							}
							else {
								$.cookie('hidecomments', null, { path: '/', expires: 7 });
								$("#HideShowComments").html("Hide Comments");
							}
						})
				.end()
				.filter("#page_prev")
					.click(function(){
						{PAGE_PREV_URL}
					})
				.end()
				.filter("#page_next")
					.click(function(){
						{PAGE_NEXT_URL}
					})
				.end()
				.filter(".paginate_yes_prev")
					.hover(
						function () {
							$(this).css({backgroundColor: "#ddd"});
						}, 
						function () {
							$(this).css({backgroundColor: "#fff"});
						}
					)
				.end()
				.filter(".paginate_yes_next")
					.hover(
						function () {
							$(this).css({backgroundColor: "#ddd"});
						}, 
						function () {
							$(this).css({backgroundColor: "#fff"});
						}
					)
				.end();
		});
