// JavaScript Document
var xmlHttp
index = 0

function setIndex(newValue)
{
	index = newValue;
	showMessageBoard(newValue);
}



function showMessageBoard(i)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 } 
var url="getMessageBoard.php"
url=url+"?i="+i
url=url+"&sid="+Math.random()
//url=url+"?sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null) 
}

function stateChanged() 
{ 
 if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 	if (index == 1)
 	{
 		document.getElementById("messageBoard").innerHTML=xmlHttp.responseText 
// 		document.getElementById("messageBoard2").innerHTML=xmlHttp.responseText 
	}
	else if ((index == 2) || (index == 3) || (index == 4) || (index == 5) )
	{
	 	document.getElementById("messageBoard2").innerHTML=xmlHttp.responseText 
	}
 } 
}

function GetXmlHttpObject()
{
var xmlHttp=null;try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 // Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}