// JavaScript Document
var xmlHttp = createXMLHttpRequestObject();

function createXMLHttpRequestObject(){
	var xmlHttp;
	try
	{
		xmlHttp = new XMLHttpRequest();
	}
	catch(e)
	{
		xmlHttp = new ActiveXObject("Microsoft.XMLHttp");
	}
	if(!xmlHttp)
		alert("error");
	else
	return xmlHttp;
}

var xmlHttp2 = createXMLHttpRequestObject2();

function createXMLHttpRequestObject2(){
	var xmlHttp;
	try
	{
		xmlHttp = new XMLHttpRequest();
	}
	catch(e)
	{
		xmlHttp = new ActiveXObject("Microsoft.XMLHttp");
	}
	if(!xmlHttp)
		alert("error");
	else
	return xmlHttp;
}


function settings(check){
	if(xmlHttp)
	{
		try
		{
			var width = screen.width;
			var param = "check=" + check + "&width=" + width ;
			xmlHttp.open("GET","class/settings.php?" + param ,true);
			xmlHttp.onreadystatechange = handleRequestStateChange;
			xmlHttp.send(null);
		}
		catch(e)
		{

		}
	}
}
function handleRequestStateChange(){
	if(xmlHttp.readyState == 4)
	{
		if(xmlHttp.status == 200)
		{
			try
			{
				handleServerResponse();
			}
			catch(e)
			{

			}
		}
		else
		{ 

		}
	}
}

function handleServerResponse(){

	var response = xmlHttp.responseText;
	var myDiv = document.getElementById("settings");
	myDiv.innerHTML = response;
}

function box_1(which){
	if(xmlHttp2)
	{
		try
		{
			var param = "box=" + which;
			xmlHttp.open("GET","class/change_box1.php?" + param ,true);
			xmlHttp.onreadystatechange = handleRequestStateChange_box1;
			xmlHttp.send(null);
		}
		catch(e)
		{

		}
	}
}
function handleRequestStateChange_box1(){
	if(xmlHttp.readyState == 4)
	{
		if(xmlHttp.status == 200)
		{
			try
			{
				handleServerResponse_box1();
			}
			catch(e)
			{

			}
		}
		else
		{ 

		}
	}
}

function handleServerResponse_box1(){

	var response = xmlHttp.responseText;
	var myDiv = document.getElementById("box1_title");
	myDiv.innerHTML = response;
}

function box_2(which){
	if(xmlHttp2)
	{
		try
		{
			var param = "box=" + which;
			xmlHttp.open("GET","class/change_box2.php?" + param ,true);
			xmlHttp.onreadystatechange = handleRequestStateChange_box2;
			xmlHttp.send(null);
		}
		catch(e)
		{

		}
	}
}
function handleRequestStateChange_box2(){
	if(xmlHttp.readyState == 4)
	{
		if(xmlHttp.status == 200)
		{
			try
			{
				handleServerResponse_box2();
			}
			catch(e)
			{

			}
		}
		else
		{ 

		}
	}
}

function handleServerResponse_box2(){

	var response = xmlHttp.responseText;
	var myDiv = document.getElementById("box2_title");
	myDiv.innerHTML = response;
}