var host = "http://www.ablenet.org";
var domain = "ablenet.org";

function confirmBox(msg, link)
	{
	var agree = confirm(msg);
	if(agree)
		{
		window.location=link;
		return true;
		}
	else
		{
		return false;
		}
	}

function confirm_submit_delete(msg)
	{
	var agree = confirm(msg);
	if(agree)
		{
		return true;
		}
	else
		{
		return false;
		}
	}

function get_url(url)
	{
	window.location.href = url;
	}

function CheckPopUp()
	{
	var box = document.chat.popup;
	var nick = document.chat.nick.value;
	var channel = document.chat.channel.value;

	if(nick == "")
		{
		document.getElementById("msg").innerHTML = "<p style=\"margin: 5px 0 5px 0;\">You didn't enter the nick name</p>";
		return false;
		}
	else if(box.checked == true)
		{
		Link = host + "/popup_chat/" + channel + "/" + nick;

		w = screen.availWidth;
		h = screen.availHeight;

		var popW = 800, popH = 600;
		var leftPos = (w-popW)/2, topPos = (h-popH)/2;

		window.open(Link, 'ablechat','width=' + popW + ',height=' + popH + ',top=' + topPos + ',left=' + leftPos +', resizable=0');

		return false;
		}
	}

function getHTTPObject()
	{
	var xmlhttp;
	/*@cc_on
	@if(@_jscript_version >= 5)
		try
			{
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
			}
		catch (e)
			{
			try
				{
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
				}
			catch (E)
				{
				xmlhttp = false;
			}
		}
	@else
	xmlhttp = false;
	@end @*/
	if(!xmlhttp && typeof XMLHttpRequest != 'undefined')
		{
		try
			{
			xmlhttp = new XMLHttpRequest();
			}
		catch (e)
			{
			xmlhttp = false;
			}
		}
	return xmlhttp;
	}

function open_map(User)
	{
	Link = host + "/ablemap/" + User;

	w = screen.availWidth;
	h = screen.availHeight;

	var popW = 800, popH = 600;
	var leftPos = (w-popW)/2, topPos = (h-popH)/2;

	window.open(Link, 'ablemap','width=' + popW + ',height=' + popH + ',top=' + topPos + ',left=' + leftPos +', resizable=0');
	}