var xmlB = false;
try {
	xmlB = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
	try {
		xmlB = new ActiveXObject("Microsoft.XMLHTTP");
	} catch (e2) {
		try { xmlB = new XMLHttpRequest(); }
        catch (e3) { xmlB = false; }
	}
}

var pre = "";
function bOnLoad(x)
{
	pre = x;
	document.getElementById('tAra').focus();
}

function send_menu(r) {
	xmlB.open("POST", 'http://' + pre + 'beycan.net/edit.php?menu=' + r, true);
	xmlB.onreadystatechange = function() {}
	xmlB.send(null);
}

var a = 0;

function degistir(e)
{
	if(a == 0) { if(e == 'E') a = 2; else a = 1; }

	var obj1 = document.getElementById('menu' + e);
	var obj2 = document.getElementById('small' + e);
	var obj3 = document.getElementById('correct' + e);
	
	if(a == 1)
	{
		obj1.style.top = 0 + 'px';
		obj2.style.bottom = -50 + 'px';
		obj3.style.height = 49 + 'px';
		a = 2;
		send_menu('E');
	}
	else
	{
		obj1.style.top = -50 + 'px';
		obj2.style.bottom = 1 + 'px';
		obj3.style.height = 10 + 'px';
		a = 1;
		send_menu('D');
	}
}

function guncelle(id) {
	var content = document.getElementById('content_content');
	content.innerHTML = "Geliyor...";
	xmlB.open("POST", 'http://' + pre + 'beycan.net/edit.php?id=' + id, true);
	xmlB.onreadystatechange = function() {
		if(xmlB.readyState  == 4)
        {
			if(xmlB.status  == 200) 
			{
				content.innerHTML = xmlB.responseText;
				_gaq.push(['_trackPageview', '/edit.php?id=' + id]);
			}
        }
	}
	xmlB.send(null);
}

function guncelle2(gid, nm) {
	var content = document.getElementById('g' + nm);
	var detay = document.getElementById('n' + nm);
	detay.innerHTML = "[ ... ]";
	xmlB.open("POST", 'http://' + pre + 'beycan.net/edit.php?gid=' + gid, true);
	xmlB.onreadystatechange = function() {
		if(xmlB.readyState  == 4)
        {
			if(xmlB.status  == 200)
			{
				content.innerHTML = xmlB.responseText; 
				_gaq.push(['_trackPageview', '/edit.php?gid=' + gid]);
			}
        }
	}
	xmlB.send(null);
}
