﻿function urlencode(str) {str = escape(str);str = str.replace('+', '%2B');str = str.replace('%20', '+');str = str.replace('*', '%2A');str = str.replace('/', '%2F');str = str.replace('@', '%40');return str;}
function urldecode(str) {str = str.replace('+', ' ');str = unescape(str);return str;}
$(document).ready(
	function()
	{
		// Searchbar Functionality
		$("#search").keyup(function(event){if (event.keyCode == 13){window.location.href = "/search/?q=" + urlencode($("#search").attr("value"));}}).focus(function(){$(this).attr("value", "");});
		$("#go").click(function(){window.location.href = "/search/?q=" + $("#search").attr("value");});
		
		var href = window.location.href;
		if (href.indexOf('/translate_c?') != -1)
		{
			$("li > span").each(
				function()
				{
					if ($(this).attr("onmouseout") != 'undefined')
					{
						$(this).attr("style","margin:0px;padding:0px;");
					}
				}
			);
			$("span.google-src-text").attr("style","margin:0px;padding:0px;");
		}
	}
);