// JavaScript Document

//  common function for all 
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;
}


//  end common function for all 


//   function for right 
function randomP () {
	var randomnumber=Math.floor(1+Math.random()*3);
	show_right(randomnumber);
} 

function show_right(id)
{

xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
  
document.getElementById("a1").className=' ';
document.getElementById("a2").className=' ';
document.getElementById("a3").className=' ';
document.getElementById("b1").className=' ';
document.getElementById("b2").className=' ';
document.getElementById("b3").className=' ';

document.getElementById("a"+id).className='selected';
document.getElementById("b"+id).className='selected';
var url="ajax/show_right.php";
url=url+"?q="+id;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}


function stateChanged() 
{ 
if (xmlHttp.readyState==4)
{ 
//document.getElementById("description2").style.display='';
document.getElementById("description5").style.display='';
document.getElementById("description5").innerHTML=xmlHttp.responseText;
}
}

//   function for right end


