function showWeather(element)
{
		var xmlhttp;
		
		try
		{
			// Opera 8.0+, Firefox, Safari
			xmlhttp = new XMLHttpRequest();
			
			if(xmlhttp.overrideMimeType)
			{               
			
				xmlhttp.overrideMimeType('text/html; utf-8');
			
			 }
		}
		catch (e)
		{
			// Internet Explorer Browsers
			try
			{
				xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
			} 
			catch (e)
			{
				try
				{
					xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
				} 
				catch (e)
				{
					alert("Din webbläsare kraschade.");
					return false;
				}
			}
		}

		var url = "weather.php?place=" + escape(element.value + "&p=" + Math.random());
		xmlhttp.open("GET", url, true);
		
		xmlhttp.onreadystatechange=function()
		{
			if(xmlhttp.readyState==4 && xmlhttp.status == 200)
			{
				if(xmlhttp.responseText.length != null)
				{
					document.getElementById('weather').innerHTML = xmlhttp.responseText;
				}
			}
		}
		
		xmlhttp.send(null);		
}

function selectedMenuItem(page)
{
	var urls = {"index.php": "start", "debate.php": "debate", "discussion.php": "debate", "passwordremind.php": "debate",
			"thread.php": "debate", "posting.php": "debate", "help.php": "help", "about.php": "about",
			"showuser.php": "show", "editimage.php": "show", "profile.php": "show", "register.php": "debate",
			"editbookmark.php": "show", "usersettings.php": "show", "search.php": "debate", "editcomment.php": "debate",
			"games.php": "games"};
	
	$(document).ready(function() {
		
		var id = "#top_menu" + " #" + urls[page];
		$(id).addClass("redbg");
		
		if(page == "show")
		{
			$("#content").addClass("border_none");
		}
	});
}

function selSubMenuItem(page)
{
	var urls = {"showuser.php": "subshow", "profile.php": "subprofile", "editimage.php": "subimage", "usersettings.php": "subsettings"};
	
	$(document).ready(function() {
		
		var id = "#submenu" + " #" + urls[page];
		$(id).addClass("greycol");
	});
}

function addHTML(element, html)
{
	$(document).ready(function() {
		
		var id = "#" + element;
		$(id).append(html);
	});
}

function createLink(url, label)
{
	var link = "<a href='" + url + "'>" + label + "</a>";
	return link;
}

