	function halamanQuran(id_surah)
	{
		//alert('oi');
		xmlHttpHQ=GetXmlHttpObject()
		if (xmlHttpHQ==null)
		{
	 		alert ("Browser tidak support HTTP Request")
	 		return
	 	}
		//alert('here');
		var url="halamanquran.php";
		var params = "id_surah="+id_surah;
		
		xmlHttpHQ.onreadystatechange=function()
		{
			if (xmlHttpHQ.readyState==4 || xmlHttpHQ.readyState=="complete")
			{
				document.getElementById("halamanquran").innerHTML=xmlHttpHQ.responseText;
			}		
			else
			{
				//alert('UNDONE');
			}		
		}
		xmlHttpHQ.open("POST",url,true)
		
		xmlHttpHQ.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttpHQ.setRequestHeader("Content-length", params.length);
		xmlHttpHQ.setRequestHeader("Connection", "close");
		
		xmlHttpHQ.send(params)
		xmlHttpHQ.send(url)
	}
	
	function updateCatatan(id_blog,tar)
	{
		//alert('oi');
		xmlHttpUC=GetXmlHttpObjectUC()
		if (xmlHttpUC==null)
		{
	 		alert ("Browser tidak support HTTP Request")
	 		return
	 	}
		
		var url="update.php";
		var params = "id_blog="+id_blog+"&tar="+tar;
		
		if(id_blog=='kirim')
		{
			isis=document.getElementById("isicatatan").value;
			var params = params+"&isi="+isis;
		}
		
		xmlHttpUC.onreadystatechange=function()
		{
			if (xmlHttpUC.readyState==4 || xmlHttpUC.readyState=="complete")
			{
				if(id_blog=='kirim')
				{
					updateCatatan(xmlHttpUC.responseText);
				}
				else
				{
					document.getElementById("catatan").innerHTML=xmlHttpUC.responseText;
				}
			}		
			else
			{
			}		
		}
		xmlHttpUC.open("POST",url,true)
		
		xmlHttpUC.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttpUC.setRequestHeader("Content-length", params.length);
		xmlHttpUC.setRequestHeader("Connection", "close");
		
		xmlHttpUC.send(params)
		xmlHttpUC.send(url)
	}
	
	function masuk(id,sub,sub2)
	{
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
	 		alert ("Browser tidak support HTTP Request")
	 		return
	 	}
		
		var url="isi.php";
		var params = "id_blog="+id+"&sub="+sub+"&sub2="+sub2;
				
		xmlHttp.onreadystatechange=function()
		{
			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
			{
				if(id==undefined || id=='kosong')
				{
					document.getElementById("kotakdalam").innerHTML=xmlHttp.responseText;
					blur('kotakdalam');
					if(sub!=undefined)
					{
						masuk(sub);
					}
				}
				else if(id=='quran')
				{
					//alert(sub);
					document.getElementById("tulisan").innerHTML=xmlHttp.responseText;
					if(sub==undefined)
					{
						updateCatatan('quran');
					}
					else
					{
						namadiv='idquran'+sub;
						for (fia=1;fia<=114;fia++)
						{
							divloop='idquran'+fia;
							//alert(divloop);
							document.getElementById(divloop).style.border='';
						}
						document.getElementById(namadiv).style.border='2px solid #ffffff';
						halamanQuran(sub);
					}
				}				
				else
				{
					document.getElementById("tulisan").innerHTML=xmlHttp.responseText;
					updateCatatan(id);
				}
				
				document.title='Webkoe Enhanced';
			}		
			else
			{
				if(id==undefined || id=='kosong')
				{
					document.getElementById("kotakdalam").innerHTML='<table style=\"width:200px;height:300px\"><tr><td valign=middle align=center><font style=\"font-family:tahoma;font-size:12px;color:gray\">Loading...</font><br><img src=loading.gif title=\"diambil dari http://www.carxp.be/images/loading.gif\"></td></tr></table>';
				}
				else
				{
					if(id=='quran')
					{}
					else
					{
					document.getElementById("tulisan").innerHTML='<table style=\"width:200px;height:300px\"><tr><td valign=middle align=center><font style=\"font-family:tahoma;font-size:12px;color:gray\">Loading...</font><br><img src=loading.gif title=\"diambil dari http://www.carxp.be/images/loading.gif\"></td></tr></table>';
					}
				}
			}		
		}
		xmlHttp.open("POST",url,true)
		
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.setRequestHeader("Content-length", params.length);
		xmlHttp.setRequestHeader("Connection", "close");
		
		xmlHttp.send(params)
		xmlHttp.send(url)
	}

	function buatOk()
	{
		//alert('LOOP');
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
	 		alert ("Browser tidak support HTTP Request")
	 		return
	 	}
		var url="content.php";
		var params = "human=yes";
		xmlHttp.onreadystatechange=iniOk
		xmlHttp.open("POST",url,true)
		
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.setRequestHeader("Content-length", params.length);
		xmlHttp.setRequestHeader("Connection", "close");
		
		xmlHttp.send(params)
		xmlHttp.send(url)
	}

	function iniOk()
	{
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	 	{
			document.getElementById("masuk").innerHTML=xmlHttp.responseText;
		}		
		else
		{
			//document.getElementById("masuk").value='Loading...';
		}
	}
	
	function pertamaxGan()
	{
		//alert('LOOP');
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
	 		alert ("Browser tidak support HTTP Request")
	 		return
	 	}
		var url="content.php";
		var params = "exe=ok";
		xmlHttp.onreadystatechange=stateChanged
		xmlHttp.open("POST",url,true)
		
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.setRequestHeader("Content-length", params.length);
		xmlHttp.setRequestHeader("Connection", "close");
		
		xmlHttp.send(params)
		xmlHttp.send(url)
	}

	function stateChanged()
	{
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	 	{
			document.getElementById("induk").style.visibility='';
			blur();
			document.getElementById("induk").innerHTML=xmlHttp.responseText;
		}		
		else
		{
			document.getElementById("induk").value='....sedang proses....';
		}
	}


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;
	}

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

	
Hmove=0;
function blur(stat,s) 
{
	if(stat=='unblur')
	{
		alert('unblur');
		Hmove=document.getElementById("kotakdalam").style.opacity
		Hmove=parseFloat(Hmove);
		Hmove-=0.01;
		//alert(Hmove);
		document.getElementById("kotakdalam").style.opacity=Hmove
		if(Hmove>0)
		{
			window.setTimeout("blur('unblur');", 0);
		}
		else
		{
			masuk();
			//document.getElementById("masuk").innerHTML='OK';
		}
	}
	else if(stat=='kotakdalam')
	{
		//alert('kotakdalam');
		//Hmove=document.getElementById("kotakdalam").style.opacity
		if(s!='yes')
		{
			Hmove=0;
		}
		//alert(Hmove);
		Hmove=parseFloat(Hmove);
		Hmove+=0.05;
		//alert(Hmove);
		document.getElementById("kotakdalam").style.opacity=Hmove
		if(Hmove<1)
		{
			window.setTimeout("blur('kotakdalam','yes');", 0);
		}
		else
		{
			//masuk();
			//document.getElementById("masuk").innerHTML='OK';
		}
	}
	else
	{
		//alert('kosong');
		document.getElementById("induk").style.opacity=Hmove;
		Hmove+=0.05;
		if(Hmove<1)
		{
			window.setTimeout("blur();", 0);
		}
		else
		{
			buatOk();
			//document.getElementById("masuk").innerHTML='OK';
		}
	}
}

function melebar() 
{
	//alert(Hmove);
   	lebar=document.getElementById("kotakdalam").style.width
	//alert(lebar);
	lebar=lebar.replace("px","");
	lebar=parseInt(lebar);
	//alert(lebar);
   	lebar+=50;
	//alert(lebar);
	if(lebar<1000)
	{
		document.getElementById("kotakdalam").style.width=lebar+"px";
   	  	window.setTimeout("melebar();", 1);
		//alert(lebar);
	}
	else
	{
		document.getElementById("kotak").style.background="white";
		masuk();
	}
}

function gO()
{
	melebar();
}

function judulOver(t)
{
	sel=document.getElementById("sel").value
	idt=t.id
	if(idt!=sel)
	{
		t.style.background='#faeea0';
	}
}

function judulOut(t,s)
{
	//alert('out');
	sel=document.getElementById("sel").value
	idt=t.id
	if(idt!=sel)
	{
		t.style.background='white';
	}
	
}

function tulisbaru(p)
{
	//alert('masuk tulisbaru'+p);
	document.getElementById("tulisan").innerHTML='<iframe width=700 height=700 frameborder=0 framestyle=\"border:1px solid red;width:680px;height:400px;margin-left:0px;margin-right:0px\" src=tulisbaru.php?id_blog='+p+'></iframe>';
	document.getElementById("catatan").innerHTML="";
}

function pilih(p)
{
	terpilih=document.getElementById("judultulisan").value
	//alert(terpilih);
	induk=document.getElementById("judultulisan");
	//alert(induk);
	induk.options[p].selected=true;
	terpilih=document.getElementById("judultulisan").value
	//alert(terpilih);
}

function tulisanEdit(p,tutup)
{
	//alert(p);
	if(p=='tuliscatatan')
	{
		if(tutup==undefined)
		{
		idblog_kirim=document.getElementById("id_blog_e").value;
		document.getElementById("tuliscatatan").innerHTML='<textarea cols=50 rows=5 id=isicatatan style=\"padding:2px;font-family:tahoma;font-size:10px;color:gray;border:1px solid silver\" value=\"\"></textarea><br><input type=button value=\"Kirim\" onclick=\"updateCatatan(\'kirim\',\''+idblog_kirim+'\');\" style=\"background:#8f8d8d;font-family:tahoma;font-size:10px;color:white;border:1px solid gray\">&nbsp&nbsp<a href=# style=\"font-family:arial;font-size:10px;color:silver;text-decoration:none\" onclick=\"tulisanEdit(\'tuliscatatan\',\'yes\');return false\"> [x]</a>';
		}
		else
		{
		document.getElementById("tuliscatatan").innerHTML='';
		}
	}
	else if(p!='ok')
	{
	//alert('first');
		if(tutup==undefined)
		{
		//alert('open');
		//alert(tutup);
	document.getElementById("tulisanedit").innerHTML='<input type=password id=passwordedit style=\"padding:2px;font-family:tahoma;font-size:10px;color:gray;border:1px solid #b6d45c\" value=\"\">&nbsp<input type=button value=\"Edit\" onclick=\"tulisanEdit(\'ok\');\" style=\"background:#b6d45c;font-family:tahoma;font-size:10px;color:white;border:1px solid #b6d45c\">&nbsp&nbsp<a href=# style=\"font-family:arial;font-size:10px;color:silver;text-decoration:none\" onclick=\"tulisanEdit(\'\',\'yes\');return false;\"> [x]</a>';
		}
		else
		{
		//alert('tutup');
	document.getElementById("tulisanedit").innerHTML='<table bgcolor=#b6d45c cellspacing=0 cellpadding=2 style=\"width:50px;height:100%\"><tr><td align=center><a href=# onclick=\"tulisanEdit(\'notok\');return false\" style=\"text-decoration:none;font-family:tahoma;font-size:10px;color:white\">Edit</a></td></tr></table>';
		}
	}
	else
	{
		//alert('oksend');
		password_kirim=document.getElementById("passwordedit").value;
		idblog_kirim=document.getElementById("id_blog_e").value;
		//alert(password_kirim);
		tulisbaru(password_kirim+'-'+idblog_kirim);
	}
}
