
function ajaxFunction()
  {
  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 urlDecode(str){
    str=str.replace(new RegExp('\\+','g'),' ');
    return unescape(str);
}

xmlHttp = ajaxFunction();
function loadberita(strid, iddetil)
{
   xmlHttp.onreadystatechange=function()
      {
      if(xmlHttp.readyState==4)
        {
//        	document.getElementById(iddetil).innerHTML= xmlHttp.responseText;
        	var xmlDoc = xmlHttp.responseXML;

		var berita = xmlDoc.getElementsByTagName('berita');

		var penulis = berita.item(0).getElementsByTagName('isi');
		document.getElementById(iddetil).innerHTML = urlDecode(penulis.item(0).firstChild.nodeValue);
        }
      else if(xmlHttp.readyState==2)
        {
        	document.getElementById(iddetil).innerHTML= "Akses. Silakan tunggu.....";
        }
      }
    xmlHttp.open("GET","http://bukitasam.localhost/?halaman=Xml.ambil&id=" + strid,true);
    xmlHttp.send(null);
}

function triggerview(objpanggil, strid)
{
	var obj = document.getElementById(strid);
	if(obj.style.display=='none')
	{
		obj.style.display='block';
		objpanggil.style.textDecoration='none';
	}
	else
	{
		obj.style.display='none';
		objpanggil.style.textDecoration='underline';
	}
}

function showoneview(strid,varrid)
{
	for(vindeks=0;vindeks<varrid.length;vindeks++) {
// 		alert('isi : ' + varrid[vindeks] + ' , indeks : ' + vindeks);
		var obj1= document.getElementById(varrid[vindeks]);
		obj1.style.display='none';
	}
	var obj1 = document.getElementById(strid);
	obj1.style.display='block';
}

function selectoneview(strid,varrid)
{
	for(vindeks=0;vindeks<varrid.length;vindeks++) {
		var obj1= document.getElementById(varrid[vindeks]);
		obj1.style.fontWeight='normal';
		obj1.style.color='#5e5e5e';
	}
	var obj1 = document.getElementById(strid);
	obj1.style.fontWeight='bold';
	obj1.style.color='#A22130';
}