function showActions(menu, type) {
	
	if (type=="show") {
		$("action-menu-"+menu).style.display="block";
	} else if (type=="hide") {
		$("action-menu-"+menu).style.display="none";
	} else if (type=="minishow") {
		$('mini-article-actions').style.display="inline";
	} else if (type=="minihide") {
		$('mini-article-actions').style.display="none";
	}
	
}

function moreHistory(type) {
	new Effect.toggle('history-more', 'blind', {duration:.33, fps:32});
	
	if (type=="less") {
		$('history-more-link').innerHTML = '<a href="javascript:moreHistory(\'more\')">'+gettext("More")+'</a>';
	} else {
		var ob='<option>';
		var oe='</option>';
		$('history-more-link').innerHTML =
		'<a href="javascript:moreHistory(\'less\')">' +gettext('Less') +'</a> '
		+gettext('Type')
		+' <select>'
		+ob+gettext('Edit')+oe
		+ob+gettext('Annotation')+oe
		+ob+gettext('Highlight')+oe
		+ob+gettext('Rate')+oe
		+ob+gettext('Comment')+oe
		+ob+gettext('Delete')+oe
		+'</select> '
		+gettext('User')
		+' <select>'
		+'</select>';
	}
	
}

function showComments(result) {
	new Effect.toggle('comment-more-'+result, 'blind', {duration:.33, fps:32});
}

function showRevision(revision, type) {
	new Effect.toggle('revision-text-'+revision, 'blind', {duration:.33, fps:32});
	
	if (type=='show') {
		$('revision-show-'+revision).innerHTML='<a href="javascript:showRevision('+revision+', \'hide\')">('+gettext("hide")+')</a>';
	} else {
		$('revision-show-'+revision).innerHTML='<a href="javascript:showRevision('+revision+', \'show\')">('+gettext("show")+')</a>';
	}
}

var show_dropdown_timer = 0;
var show_dropdown_last = false;
function showDropDown(el, type, parent) {
	
	if (type=="show") {
		if(show_dropdown_last) {
			show_dropdown_last.hide();
			show_dropdown_last = false;
		}
		
		show_dropdown_last = $(el);
		$(el).show();
	} else {
		$(el).hide();
		show_dropdown_last = false;
	}
	
	
}

function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}

function hideProfileDropDown(el) {
	showDropDown(el, 'hide');
}

function set_header_loggedin() {

	if (un && tok) {
		var login_href = "javascript:do_json_logout();";
		var login_str = gettext("Logout");
		var login_text =  gettext('Hello')+' <a href=\"profile.html\">' + unescape(un) + "</a>";
		document.getElementById("profile-button").style.display='inline';
	}
	else {
		var login_href = search_server_to_use+"login.html?return=" + escape(location.href);
		var login_str = gettext("Sign Up / Login");
		var login_text = '';
		document.getElementById("profile-button").style.display='none';
	}
	document.getElementById("search-login-text").innerHTML = login_text;
	document.getElementById("search-login").innerHTML = login_str;
	document.getElementById("search-login").href = login_href;
	if (getCookie("wikicitiesBlocked")=="true") document.getElementById("search-login-text").style.color = "#ff0000";
	else document.getElementById("search-login-text").style.color = "#000000";
	
}

function check_new_notifications() {
	var url = "index.php?action=ajax";
	var pars = 'rs=wfCheckNewNotificationsJSON';
	var sUrl = server_to_use + "/" + url + "&" + pars;
	var i = document.getElementById("checkNotifs"); 
	var head = document.getElementsByTagName('head')[0];
	if (i) head.removeChild(i);
	i = document.createElement('script');
	i.setAttribute("id","checkNotifs");
	i.src = sUrl;
	head.appendChild(i);	
}

setInterval("check_new_notifications()", 30000);

function check_notifications() {
	var url = "index.php?action=ajax";
	var pars = 'rs=wfgetNotificationsJSON';
	var sUrl = server_to_use + "/" + url + "&" + pars;
	var i = document.getElementById("checkNotifs"); 
	var head = document.getElementsByTagName('head')[0];
	if (i) head.removeChild(i);
	i = document.createElement('script');
	i.setAttribute("id","checkNotifs");
	i.src = sUrl;
	head.appendChild(i);
}

var has_new_messages = false;
function display_notifications(notifications) {
	if (notifications && notifications.notification_count) {
		var x=1;
		var output_str = "<a href=\""+search_server_to_use+"notifications.html\">" + ((notifications.notification_count > 1) ? " " : "");
		var output_str_long = "";
		var title_str = "";
		for (var key in notifications.types) {
			if (eval("notifications."+key) && eval("notifications."+key+".length")) {
				
				
				var the_array = eval("notifications."+key);
				if(key == "pokes") {
					for (var i=0; i<the_array.length; i++) {
						var the_poke = the_array[i];
						if (!i) title_str += gettext("Poke", {update:false})+": ";
						else title_str += ", ";
						title_str += the_poke.from;
						output_str_long +=
							"<div class='indiv-notification'>"
							+"<a href=\""+search_server_to_use+"notifications.html\">"
							+"<img src=\""+the_poke.avatar_img_s+"\" border=\"0\"/>"
							+ the_poke.user_name_display + " "+gettext("nudged you")
							+"</a></div>";
					}
					title_str += " ";
				}
				else if(key=="relrequests") {
					for (var i=0; i<the_array.length; i++) {
						if (!i) title_str += gettext("Friend Requests", {update:false})+": ";
						else title_str += ", ";
						title_str += the_array[i].user_name_from;
						output_str_long += "<div class='indiv-notification'><a href=\""+search_server_to_use+"notifications.html\"><img src=\""+the_array[i].avatar_img_s+"\" border=\"0\"/>" + the_array[i].user_name_display + " "+gettext("wants to be friends with you")+"</a></div>";
					}
					title_str += " ";
				}
				else if(key=="messages") {
					has_new_messages = true;
					var posted_array = new Array();
					var real_name_array = new Array();
					var avatar_array = new Array();
					for (var i=0; i<the_array.length; i++) {
						if (posted_array[the_array[i].user_name]) posted_array[the_array[i].user_name]++;
						else {
							posted_array[the_array[i].user_name] = 1;
							real_name_array[the_array[i].user_name] = the_array[i].user_name_display;
							avatar_array[the_array[i].user_name] = the_array[i].avatar_img_s;
						}
					}
					var count = 0;
					
					for (var theName in posted_array) {
						if (typeof posted_array[theName] == 'number') {
							if (!count) title_str += gettext("Wall Posts", {update:false})+": ";
							else title_str += ", ";
							title_str += real_name_array[theName] + (posted_array[theName]>1 ? "(" + posted_array[theName] + ")" : "");
							output_str_long += "<div class='indiv-notification'><a href=\""+search_server_to_use+"notifications.html\"><img src=\""+avatar_array[theName]+"\" border=\"0\"/>"
							+ real_name_array[theName] + " "+gettext("sent you")+" " + (posted_array[theName]>1 ? posted_array[theName] + " "+gettext("messages") : gettext("a message"))  + "</a></div>";
						}
					}
					title_str += " ";
				}
				
				if (x>1) {
					output_str += ", ";
				}
				//output_str += eval("notifications."+key+".length") + " " + eval("notifications.types."+key) + ((eval("notifications."+key+".length")>1) ? "s" : "");
				output_str += eval("notifications."+key+".length") + " " + gettext(eval("notifications.types."+key)) + ((eval("notifications."+key+".length")>1) ? "s" : "");
				
				x++;
			}
		}
		
		output_str += "</a>";
		
		output_str = "<div id='ws_notifications_small' title='" + title_str + "' style='display:none;' class=\"notifications-small\">" + output_str + "<a href='javascript:void(0)' class='notifications-close' onclick='swap_notif(0);return false;' onmouseover='window.status=\"\";'> + </a></div>";
		output_str_long = "<div id='ws_notifications_big' style=\"height: 100%;\"><div class=\"notifications-title\">"+gettext("Notifications") + ((notifications.notification_count > 1) ? "<a href='javascript:void(0)' class='notifications-close' onclick='swap_notif(1);'> &ndash; </a>" : "") + "</div>" + output_str_long + "</div>";
		document.getElementById("search-notifications").innerHTML = output_str_long + output_str;
		
		//set height of lightbox for IE
		try {
			
			var browser=navigator.appName;
			var b_version=navigator.appVersion;
			//var version=parseFloat(b_version);
			if ((browser=="Microsoft Internet Explorer")) {
				b_version_short = b_version.substring(b_version.indexOf("MSIE ")+4);
				b_version_short = b_version_short.substring(0,b_version_short.indexOf(";"));
				var version=parseFloat(b_version_short);
				if (version<7) {
					if ($("search-notifications").style.setExpression ) { // IE
						var temp_text = $("search-notifications").innerHTML;
						$("search-notifications").innerHTML = "<table id='notif-temp'><tr><td>" + temp_text + "</td></tr></table>";
						var temp_width = $("notif-temp").offsetWidth;
						$("search-notifications").innerHTML = temp_text;
						$("search-notifications").style.width = temp_width + 'px';
						$("search-notifications").style.position = 'absolute';
						$("search-notifications").style.setExpression("top", "(document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + (document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight) - this.offsetHeight  + 'px'");
						document.body.style.backgroundImage = "url('" + search_server_to_use + "js/s.gif')";
						document.body.style.backgroundAttachment = 'fixed';
						
					}
						
				}
			}
			
		}
		catch(ex) {}
		
		
		if(notifications.notification_count > 1) setTimeout('setAndSwap(1)', 5000);
		
	}
}

function setAndSwap(collapse) {
	if ($('ws_notifications_big')) $('ws_notifications_big').style.height = $('ws_notifications_big').offsetHeight + "px";
	swap_notif(collapse);
}

function swap_notif(collapse) {
	if (collapse ) {
		if ($('ws_notifications_big').style.display!='none') {
			new Effect.BlindUp('ws_notifications_big', {duration:0.5});
			setTimeout("new Effect.BlindDown('ws_notifications_small', {duration:0.5, fps:32});", 400);
		}
	}
	else {
		new Effect.BlindUp('ws_notifications_small', {duration:0.5});
		setTimeout("new Effect.BlindDown('ws_notifications_big', {duration:0.5, fps:32});", 400);
	}
}

function search_from_bar( ){
	show_ads = true;
	window.location=search_server_to_use+'search.html#'+document.forms[0].q.value
		
}

var header_string = "";

			
			//header_string += '<div id="top-bar" onclick="setBG()">';
			header_string += '<div id="search-login-container"><div id="search-login-text"></div><a id="search-login"></a></div>';
			header_string += '<div id="top-bar" onclick="try{show_bgselector();}catch(ex){}">';
				header_string += '<div id="logo">';
				    header_string += '<a href="'+search_server_to_use+'index.html"><img src="'+image_server_to_use+'kt_files/front-logo.png" alt="Search Wikia" border="0"></a>';
				header_string += '</div>';
				header_string += '<form id="search-bar" method="get" action="http://alpha.search.wikia.com/search/search.html" onsubmit="search_from_bar();return false;">';
					header_string += '<input name="q" class="search-input" id="q" value="" type="text"/> ';        
				    header_string += '<input name="s" value="0" type="hidden"/>';
				    header_string += '<input name="n" value="10" type="hidden"/>';
				    header_string += '<input id="search_btn" value="'+gettext("Search", {id:'search_btn',param:'value'})+'" type="submit"/>'
					header_string += '<span id="count" style="display:inline;"><span id="query-count"></span> <span id="query-count-contribs"></span></span>';
				header_string += '</form>';
			header_string += '</div>';  
			header_string += '<div id="global-links">';
				header_string += '<div class="global-link">'
					header_string += ((un && tok)?'<span id="profile-button" style="display:inline;">':'<span id="profile-button" style="display:none;">');
						header_string += '<a href="'+search_server_to_use+'profile.html" onmouseover="clearTimeout(show_dropdown_timer);showDropDown(\'profile-more\', \'show\', this);" onmouseout="show_dropdown_timer = setTimeout(function(){hideProfileDropDown(\'profile-more\')}, 500);">'+gettext("Profile")+'</a> |';
					header_string += '</span>';
					header_string += '<div id="profile-more" class="profile-more" style="display:none;" onmouseover="clearTimeout(show_dropdown_timer);" onmouseout="show_dropdown_timer = setTimeout(function(){hideProfileDropDown(\'profile-more\')}, 500);">';
						header_string += '<a href="'+search_server_to_use+'editprofile.html">'+gettext("Edit Profile")+'</a>';
						header_string += '<a href="'+search_server_to_use+'editpicture.html">'+gettext("Edit Photo")+'</a>';
						header_string += '<a href="'+search_server_to_use+'editprofile.html?section=privacy">'+gettext("Privacy Setting")+'</a>';
						header_string += '<a href="'+search_server_to_use+'editprofile.html?section=preferences" class="bottom-profile-more">'+gettext("Change Preferences")+'</a>';
					header_string += '</div>';
				header_string += '</div>';
				header_string += '<div class="global-link">';
					header_string += ((un && tok)?'<a href="'+search_server_to_use+'rel.html" onmouseover="clearTimeout(show_dropdown_timer);showDropDown(\'friends-more\', \'show\', this);" onmouseout="show_dropdown_timer = setTimeout(function(){hideProfileDropDown(\'friends-more\')}, 500);">'+gettext("Friends")+'</a>|':'');
					header_string += '<div id="friends-more" class="profile-more" style="display:none;" onmouseover="clearTimeout(show_dropdown_timer);" onmouseout="show_dropdown_timer = setTimeout(function(){hideProfileDropDown(\'friends-more\')}, 500);">';
						header_string += '<a href="'+search_server_to_use+'rel.html">'+gettext("View Friends")+'</a>';
						header_string += '<a href="'+search_server_to_use+'mayknow.html">'+gettext("People You May Know")+'</a>';
						header_string += '<a href="'+search_server_to_use+'find.html">'+gettext("Find Friends")+'</a>';
						header_string += '<a href="'+search_server_to_use+'invite.html">'+gettext("Invite Friends")+'</a>';
					header_string += '</div>';
				header_string += '</div>';
				header_string += '<div class="global-link">';
					header_string += '<a href="'+search_server_to_use+'recent.html" onmouseover="clearTimeout(show_dropdown_timer);showDropDown(\'recent-more\', \'show\', this);" onmouseout="show_dropdown_timer = setTimeout(function(){hideProfileDropDown(\'recent-more\')}, 500);">'+gettext("Recent Changes")+'</a>|';
					header_string += '<div id="recent-more" class="profile-more" style="display:none;" onmouseover="clearTimeout(show_dropdown_timer);" onmouseout="show_dropdown_timer = setTimeout(function(){hideProfileDropDown(\'recent-more\')}, 500);">';
						header_string += '<a href="'+search_server_to_use+'recent.html">'+gettext("Recent Changes")+'</a>';
						header_string += '<a href="'+search_server_to_use+'fun/live_changes.html">'+gettext("Live Changes")+'</a>';
						header_string += '<a href="'+search_server_to_use+'fun/mapped_changes.html">'+gettext("Mapped Changes")+'</a>';
					header_string += '</div>';
				header_string += '</div>';
				header_string += '<div class="global-link"><a href="'+search_server_to_use+'fun/fun.html">'+gettext("Fun")+'</a>|</div>';
				header_string += '<div class="global-link">'
					header_string += '<a href="'+search_server_to_use+'about/about.html" onmouseover="clearTimeout(show_dropdown_timer);showDropDown(\'community-more\', \'show\', this);" onmouseout="show_dropdown_timer = setTimeout(function(){hideProfileDropDown(\'community-more\')}, 500);">'+gettext("Community")+'</a>|';
					header_string += '<div id="community-more" class="profile-more" style="display:none;" onmouseover="clearTimeout(show_dropdown_timer);" onmouseout="show_dropdown_timer = setTimeout(function(){hideProfileDropDown(\'community-more\')}, 500);">';
						header_string += '<a href="'+search_server_to_use+'about/about.html" >'+gettext("Our Principles")+'</a>';
						//header_string += '<a href="'+search_server_to_use+'friend_search.html">'+gettext("People Search")+'</a>';
						header_string += '<a href="'+search_server_to_use+'metrics/queries.html">'+gettext("Site Statistics")+'</a>';
						header_string += '<a href="'+server_to_use+'/wiki/">'+gettext("Wiki")+'</a>';
						header_string += '<a href="'+server_to_use+'/blog">'+gettext("Blog")+'</a>';
						header_string += '<a href="'+search_server_to_use+'about/get_involved.html">'+gettext("Get Involved")+'</a>';
						header_string += '<a href="'+search_server_to_use+'about/crawl.html">'+gettext("Crawl The Web")+'</a>';
						header_string += '<a href="'+search_server_to_use+'about/contact.html">'+gettext("Contact Us")+'</a>';
					header_string += '</div>';
				header_string += '</div>';
				header_string += '<div class="global-link">'
					header_string += '<a href="'+search_server_to_use+'tools/mostqueried.html" onmouseover="clearTimeout(show_dropdown_timer);showDropDown(\'tools-more\', \'show\', this);" onmouseout="show_dropdown_timer = setTimeout(function(){hideProfileDropDown(\'tools-more\')}, 500);">'+gettext("Tools")+'</a>|';
					header_string += '<div id="tools-more" class="profile-more" style="display:none;" onmouseover="clearTimeout(show_dropdown_timer);" onmouseout="show_dropdown_timer = setTimeout(function(){hideProfileDropDown(\'tools-more\')}, 500);">';
						header_string += '<a href="'+search_server_to_use+'tools/mostqueried.html" >'+gettext("Most Queried")+'</a>';
						header_string += '<a href="'+search_server_to_use+'tools/mostcontributions.html">'+gettext("Most Contributions")+'</a>';
						header_string += '<a href="'+search_server_to_use+'tools/recentqueries.html">'+gettext("Recent Top Queries")+'</a>';
						header_string += '<a href="'+search_server_to_use+'tools/recentcontributions.html">'+gettext("Recent Top Contributions")+'</a>';
						header_string += '<a href="'+search_server_to_use+'tools/wantedresults.html">'+gettext("Wanted Results")+'</a>';
						header_string += '<a href="'+search_server_to_use+'tools/trends.html">'+gettext("Trends")+'</a>';
					header_string += '</div>';
				header_string += '</div>';
				header_string += '<div class="global-link"><a href="'+search_server_to_use+'help/help.html">'+gettext("Help")+'</a>|</div>';
				header_string += '<div class="global-link"><a href="'+search_server_to_use+'legal/privacy.html">'+gettext("Privacy")+'</a>|</div>';
				header_string += '<div class="global-link"><a href="'+search_server_to_use+'legal/legal.html">'+gettext("Legal")+'</a></div>';
				header_string += '<div id="site-language"></div>';
			header_string += '</div>';
			header_string += '<div id="search-notifications"></div>';
			
document.write(header_string);

set_header_loggedin();
check_notifications();
try{if(typeof show_lang_header == "function") {show_lang_header()};}catch(sl_ex){}

var BrowserDetect = {
	init: function () {
		this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
		this.version = this.searchVersion(navigator.userAgent)
			|| this.searchVersion(navigator.appVersion)
			|| "an unknown version";
		this.OS = this.searchString(this.dataOS) || "an unknown OS";
	},
	searchString: function (data) {
		for (var i=0;i<data.length;i++)	{
			var dataString = data[i].string;
			var dataProp = data[i].prop;
			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if (dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].identity;
			}
			else if (dataProp)
				return data[i].identity;
		}
	},
	searchVersion: function (dataString) {
		var index = dataString.indexOf(this.versionSearchString);
		if (index == -1) return;
		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
	},
	dataBrowser: [
		{
			string: navigator.vendor,
			subString: "Apple",
			identity: "Safari"
		},
		{
			prop: window.opera,
			identity: "Opera"
		},
		{
			string: navigator.vendor,
			subString: "KDE",
			identity: "Konqueror"
		},
		{
			string: navigator.userAgent,
			subString: "Firefox",
			identity: "Firefox"
		},
		{
			string: navigator.userAgent,
			subString: "MSIE",
			identity: "Explorer",
			versionSearch: "MSIE"
		}
	],
	dataOS : [
		{
			string: navigator.platform,
			subString: "Win",
			identity: "Windows"
		},
		{
			string: navigator.platform,
			subString: "Mac",
			identity: "Mac"
		},
		{
			string: navigator.platform,
			subString: "Linux",
			identity: "Linux"
		}
	]

};
BrowserDetect.init();

function closeBrowserMessage() {
	
	//set cookie
	var myDate = new Date();
	myDate.setDate(myDate.getDate()+365);
	setCookie("wikiaSearchMessage", true, myDate, '/');
	
	//hide message container 
	$('browser-search-message').style.display="none";
	
}
 
function writeBrowserMessage() {
	
	var message = "";
	var tnl = "";
	var mc = "";
	
	if( getCookie("wikiaSearchMessage") == false ) {
	
		//create message container 
		mc = document.createElement("a");
		mc.setAttribute ("id", "browser-search-message");

		//create text and link
		tnl = document.createElement("span");
		tnl.setAttribute ("id", "message-tnl");
		tnl.innerHTML =
		gettext("Change search! Click to make us your default browser search.")
		+" <a href=\"javascript:closeBrowserMessage();\" alt=\""+gettext("Dismiss")+"\">X</a>";

		//create image for each browser
		message = document.createElement("img");
		message.setAttribute("onclick","window.external.AddSearchProvider('http://re.search.wikia.com/wikiasearch.xml');");

		if (BrowserDetect.browser=="Firefox") {

			if (BrowserDetect.version==2) {
				if (BrowserDetect.OS=="Mac") {
					message.setAttribute("src","kt_files/browser_search_ff2_mac.png");
				} else if (BrowserDetect.OS=="Windows") {
					message.setAttribute("src","kt_files/browser_search_ff2_win.png");
				}

			} else if (BrowserDetect.version==3){
				if (BrowserDetect.OS=="Mac") {
					message.setAttribute("src","kt_files/browser_search_ff3_mac.png");
				} else if (BrowserDetect.OS=="Windows") {
					message.setAttribute("src","kt_files/browser_search_ff3_win.png");
				}
			}

		} else if (BrowserDetect.browser=="Explorer") {
			if (BrowserDetect.version==7) {
				message.setAttribute("src","kt_files/browser_search_ie7.png");
			}
		}

		//append image to div
		mc.appendChild(message);
		mc.appendChild(tnl);

		//append message to container
		if ((BrowserDetect.browser=="Explorer" && BrowserDetect.version==7) || (BrowserDetect.browser=="Firefox" && (BrowserDetect.version==3 || BrowserDetect.version==2))) {
			$("container").appendChild(mc);
		}
		
	}
	
}

// the query counter code
var COUNTER_UPDATE_INTERVAL = 1;

function loadQueryCounter(){
	var sUrl = server_to_use + '/index.php?title=index.php&action=ajax&rs=wfQueryCounter&rsargs[]=updateGlobalQueryCount&r=' + Math.random();
	getDataFromServer("queryCounter", sUrl);
}

function updateGlobalQueryCount(data){

    var lastQueryCount = new Object();
    lastQueryCount = data;
    lastQueryCount.TYPE_QUERIES = 1;
    lastQueryCount.TYPE_CONTRIBUTIONS = 2;
        
    if( Math.ceil(Math.random() * 100) % 2 == 0 ){
		lastQueryCount.type = lastQueryCount.TYPE_QUERIES;
    } else {
		lastQueryCount.type = lastQueryCount.TYPE_CONTRIBUTIONS;
    }
    
    updateCounter(lastQueryCount);
}

function updateCounter(lastQueryCount){
    
    lastQueryCount.queries = lastQueryCount.queries + (lastQueryCount.queryRate * COUNTER_UPDATE_INTERVAL);
    lastQueryCount.contributions = lastQueryCount.contributions + (lastQueryCount.contributionRate * COUNTER_UPDATE_INTERVAL);
    
    $('count').innerHTML = '<span id="query-count">' + addCommas(Math.round(lastQueryCount.queries)) + " queries</span>" +
			   '<span id="query-count-contrib">' + addCommas(Math.round(lastQueryCount.contributions)) + " contributions</span>";
    
    if (lastQueryCount.type == lastQueryCount.TYPE_QUERIES) {
	$('query-count-contrib').hide();
    }else{
	$('query-count').hide();
	}
     
     /* if($('query-count'))
	$('query-count').innerHTML = addCommas(Math.round(lastQueryCount.queries)) + " queries";
     if($('query-count-contrib'))
	$('query-count-contrib').innerHTML = addCommas(Math.round(lastQueryCount.contributions)) + " contributions";
     */
     
     window.setTimeout('updateCounter(' + Object.toJSON(lastQueryCount) + ')', COUNTER_UPDATE_INTERVAL * 1000);

}

loadQueryCounter();