function createAjaxObj()
{
	var xmlHttp;
	try
	{
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{	
		// Internet Explorer
		try
		{
			
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
	    {
			try
			{
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e)
			{
				alert("Your browser does not support AJAX!");
				return false;
			}
		}
		
	}
	return xmlHttp;
}


function ajaxWindow(winid, winfile)
{
	var xmlHttp = createAjaxObj();
	
	xmlHttp.onreadystatechange=function()
    {
		if(xmlHttp.readyState == 4)
		{
			var x = document.getElementById('cover');
			x.className = 'show_cover';
			
			var y = document.getElementById(winid);
			y.className = 'show_window';
			y.innerHTML = xmlHttp.responseText;
			document.getElementById('body').style.overflow='hidden';
		}
    }
	xmlHttp.open("GET",winfile,true);
	xmlHttp.send("");
}

function closeWindow(winid)
{
	var x = document.getElementById('cover');
	x.className = 'dont_show';

	var y = document.getElementById(winid);
	y.className = 'dont_show';
	y.innerHTML = '';
	document.getElementById('body').style.overflow = 'auto';
	
	window.location.reload();
}

function closeWindowWithoutReload(winid)
{
	var x = document.getElementById('cover');
	x.className = 'dont_show';

	var y = document.getElementById(winid);
	y.className = 'dont_show';
	y.innerHTML = '';
	document.getElementById('body').style.overflow = 'auto';
}