//soina.js

ddlevelsmenu.setup("Menucustom", "topbar") //ddlevelsmenu.setup("mainmenuid", "topbar|sidebar")
	
//Change Style
function changeStyle()
{
	/*
	alert(document.getElementById('menusub').innerHTML);
	*/
	var the_div = document.getElementById('menusub');
	var lis     = the_div.getElementsByTagName('li')
	var the_li  = lis[0];
	alert(the_li);
}


Event.observe(window,'load',function(){
    var my_glider = new Glider("item1", {duration:0.3});
    $("item1").getElementsBySelector('.glider.next').each(function(elm){
    	    elm.observe('click',function(evt){
    		Event.stop(evt);
    		return my_glider.next();
    	});
    });
    $("item1").getElementsBySelector('.glider.previous').each(function(elm){
    	    elm.observe('click',function(evt){
    		Event.stop(evt);
    		return my_glider.previous();
    	});
    });
});


function ThisMonthArchive(MonthOnly, YearOnly)
{
	/*
	var MonthArchive = new Date();
	var MonthOnly = MonthArchive.getUTCMonth();
	var YearOnly = MonthArchive.getFullYear();
	*/

	var strUrl = "./../services/default_archive.php";
	var args = "NewsMonth=" + MonthOnly;
		args += "&NewsYear=" + YearOnly;
	
	var strBodyProduct = "";
	strBodyProduct += "<img src=\"images/load.gif\" alt=\"loading\" />";	
	Element.update('archive01_result',strBodyProduct);
		
	new Ajax.Request(strUrl, {
		method:'post', 
		postBody:args, 
		onSuccess:function(objHttp){parseThisMonthArchive(objHttp);}, 
		onFailure:function(objHttp){alert(objHttp.responseText);}, 
		evalScripts:true, 
		asynchronous:true
	});
	
}

function parseThisMonthArchive(objHttp)
{
	tmp = objHttp.responseText;
	//alert(tmp);
	
	var tmp1 = eval('('+tmp+')');
	var num	 = tmp1["num"];
	var datax = tmp1["data"];	
	var resultx	= tmp1["result"];
	
	var strBodyProduct = "";
	
	
	if(parseInt(resultx) == 1)
	{
		strBodyProduct += "<h3 class=\"title_black\">"+ datax[0].ShortPostDate +"</h3>";
		strBodyProduct += "<ul>";
		for(n = 0; n < datax.length; n++)
		{
			//alert(datax[0].Title);
			strBodyProduct += "	<li class=\"li_with_list\"><a href=\"news.php?ID="+datax[n].NewsID+"\" style=\"cursor:pointer;\" ><b>"+ datax[n].PostDate +" : </b>"+ datax[n].Title +"</a></li>";
		}
		strBodyProduct += "</ul>";
		
	}
	else 
	{
		
		strBodyProduct += "<ul>";
		strBodyProduct += "	<li class=\"li_with_list\">No news posted on this month!</a></li>";
		strBodyProduct += "</ul>";

	}


	Element.update('archive01_result',strBodyProduct);
}


function getMonthlyArchive()
{
	//alert(document.getElementById('NewsMonth').value);
	//alert(document.getElementById('NewsYear').value);
	var NewsMonth = document.getElementById('NewsMonth').value;
	var NewsYear = document.getElementById('NewsYear').value;
	
	var strUrl = "./../services/view_archive.php";
	var args = "NewsMonth=" + NewsMonth;
		args += "&NewsYear=" + NewsYear;
	
	var strBodyProduct = "";
	strBodyProduct += "<img src=\"images/load.gif\" alt=\"loading\" />";	
	Element.update('archive01_result',strBodyProduct);
	
		new Ajax.Request(strUrl, {
		method:'post', 
		postBody:args, 
		onSuccess:function(objHttp){parseMonthlyArchive(objHttp);}, 
		onFailure:function(objHttp){alert(objHttp.responseText);}, 
		evalScripts:true, 
		asynchronous:true
	});
	
}

function parseMonthlyArchive(objHttp) {
	
	tmp = objHttp.responseText;
	//alert(tmp);
	
	var tmp1 = eval('('+tmp+')');
	var num	 = tmp1["num"];
	var datax = tmp1["data"];	
	var resultx	= tmp1["result"];
	
	var strBodyProduct = "";
	
	
	if(parseInt(resultx) == 1)
	{
		strBodyProduct += "<h3 class=\"title_black\">"+ datax[0].ShortPostDate +"</h3>";
		strBodyProduct += "<ul>";
		for(n = 0; n < datax.length; n++)
		{
			//alert(datax[0].Title);
			strBodyProduct += "	<li class=\"li_with_list\"><a href=\"news.php?ID="+datax[n].NewsID+"\" style=\"cursor:pointer;\" ><b>"+ datax[n].PostDate +" : </b>"+ datax[n].Title +"</a></li>";
		}
		strBodyProduct += "</ul>";
		
	}
	else 
	{
		strBodyProduct += "<ul>";
		strBodyProduct += "	<li class=\"li_with_list\">No news posted on this month!</a></li>";
		strBodyProduct += "</ul>";
	}


	Element.update('archive01_result',strBodyProduct);
	
	/*
	var strBodyProduct = "";

	
	strBodyProduct += "<h3 class=\"title_black\">Maret 2009</h3>";
	strBodyProduct += "<ul>";
	strBodyProduct += "	<li class=\"li_with_list\"><a href=\"#\"><b>01/03/2009 : </b>Pelatihan Young Athletes.</a></li>";
	strBodyProduct += "</ul>";

	*/
}


function ThisMonthEvent(MonthOnly, YearOnly)
{

	var strUrl = "./../services/default_event.php";
	var args = "EventMonth=" + MonthOnly;
		args += "&EventYear=" + YearOnly;
	
	var strBodyProduct = "";
	strBodyProduct += "<img src=\"images/load.gif\" alt=\"loading\" />";	
	Element.update('sub_event_result',strBodyProduct);
	
	new Ajax.Request(strUrl, {
		method:'post', 
		postBody:args, 
		onSuccess:function(objHttp){parseThisMonthEvent(objHttp);}, 
		onFailure:function(objHttp){alert(objHttp.responseText);}, 
		evalScripts:true, 
		asynchronous:true
	});
	
}

function parseThisMonthEvent(objHttp)
{
	tmp = objHttp.responseText;
	//alert(tmp);
	
	var tmp1 = eval('('+tmp+')');
	var num	 = tmp1["num"];
	var datax = tmp1["data"];	
	var resultx	= tmp1["result"];
	
	var strBodyProduct = "";
	
	if(parseInt(resultx) == 1)
	{
		
		strBodyProduct += "<h3 class=\"title_black\">"+ datax[0].month_name_from +" "+ datax[0].date_year_from +"</h3>";
		strBodyProduct += "<ul>";
		for(n = 0; n < datax.length; n++)
		{
			//alert(datax[0].Title);
			strBodyProduct += "	<li class=\"li_with_list\"><b>"+ datax[n].date_day_from +" "+ datax[n].month_name_from +" - "+datax[n].date_day_to +" "+ datax[n].month_name_to +" : </b>"+ datax[n].Title +"</li>";
		}
		strBodyProduct += "</ul>";
	}
	else 
	{
		strBodyProduct += "<ul>";
		strBodyProduct += "	<li class=\"li_with_list\">No event on this month!</a></li>";
		strBodyProduct += "</ul>";
	}

	Element.update('sub_event_result',strBodyProduct);
	
}


function getMonthlyEvent()
{
	//alert(document.getElementById('EventMonth').value);
	//alert(document.getElementById('EventYear').value);

	var EventMonth = document.getElementById('EventMonth').value;
	var EventYear = document.getElementById('EventYear').value;
	
	var strUrl = "./../services/view_event.php";
	var args = "EventMonth=" + EventMonth;
		args += "&EventYear=" + EventYear;
	
	var strBodyProduct = "";
	strBodyProduct += "<img src=\"images/load.gif\" alt=\"loading\" />";	
	Element.update('sub_event_result',strBodyProduct);	
		
		new Ajax.Request(strUrl, {
		method:'post', 
		postBody:args, 
		onSuccess:function(objHttp){parseMonthlyEvent(objHttp);}, 
		onFailure:function(objHttp){alert(objHttp.responseText);}, 
		evalScripts:true, 
		asynchronous:true
	});
}

function parseMonthlyEvent(objHttp) {
	
	tmp = objHttp.responseText;
	//alert(tmp);
	
	//exit();
	var tmp1 = eval('('+tmp+')');
	var num	 = tmp1["num"];
	var datax = tmp1["data"];	
	var resultx	= tmp1["result"];
	
	var strBodyProduct = "";
	
	if(parseInt(resultx) == 1)
	{
		
		strBodyProduct += "<h3 class=\"title_black\">"+ datax[0].month_name_from +" "+ datax[0].date_year_from +"</h3>";
		strBodyProduct += "<ul>";
		for(n = 0; n < datax.length; n++)
		{
			//alert(datax[0].Title);
			strBodyProduct += "	<li class=\"li_with_list\"><b>"+ datax[n].date_day_from +" "+ datax[n].month_name_from +" - "+datax[n].date_day_to +" "+ datax[n].month_name_to +" : </b>"+ datax[n].Title +"</li>";
		}
		strBodyProduct += "</ul>";
	}
	else 
	{
		
		strBodyProduct += "<ul>";
		strBodyProduct += "	<li class=\"li_with_list\">No event on this month!</a></li>";
		strBodyProduct += "</ul>";
	}

	Element.update('sub_event_result',strBodyProduct);
	
}

function RecentNews() {
//alert('recent news');
	
	var strUrl = "./../services/recent_news.php";
	var args = "limit=" + 1;
	
	var strBodyProduct = "";
	strBodyProduct += "<img src=\"images/load.gif\" alt=\"loading\" />";	
	Element.update('HeadLine',strBodyProduct);	
	
	new Ajax.Request(strUrl, {
		method:'post', 
		postBody:args, 
		onSuccess:function(objHttp){parseRecentNews(objHttp);}, 
		onFailure:function(objHttp){alert(objHttp.responseText);}, 
		evalScripts:true,
		asynchronous:true
	});	
	
}

function parseRecentNews(objHttp) {
	tmp = objHttp.responseText;
	//alert(tmp);	
	
	var tmp1 = eval('('+tmp+')');
	var datax = tmp1["data"];
	var resultx	= tmp1["result"];
	
	var strBodyProduct = "";
	
	if (parseInt(resultx) == 1)
	{
		strBodyProduct += "<h2 class=\"title_blue\"><a href=\"news.php?ID="+datax['NewsID']+"\" style=\"cursor:pointer;\" >"+ datax['Title'] +"</a></h2>";
		strBodyProduct += "<p class=\"meta\"><small>Diposting Oleh: " + datax['AuthorName'] + " Pada: "+ datax['Date'] +"</small></p>";
		if (datax['Images'] != ""){
			strBodyProduct += "<div id=\"headline_image\"><img src=\"images/uploaded/" + datax['Images'] + "\" alt=\"sample\" height=\"100\" /></div>";
			/*
			//tambahkan baris code ini jika image hasil query lebih dari satu	
			var singleimage=datax['Images'].split("~");
			if (1 < singleimage.length){
				strBodyProduct += "<div id=\"headline_image\">";
				for( var i=0; i < singleimage.length; i++ ){
					strBodyProduct += "<img src=\"images/" + singleimage[i] + "\" alt=\"sample\" height=\"100\" />";
				}
				strBodyProduct += "</div>";
				
			}
			else {
				strBodyProduct += "<div id=\"headline_image\"><img src=\"images/" + singleimage + "\" alt=\"sample\" height=\"100\" /></div>";
			}
			*/
		} else {
			strBodyProduct += "<div id=\"headline_image\"><img src=\"images/no_images.jpg\" alt=\"sample\" height=\"100\" /></div>";
		}
		strBodyProduct += "<div id=\"headline_desc\"><p>" + datax['Content'] + "</p><p>[ <a href=\"news.php?ID="+datax['NewsID']+"\" style=\"cursor:pointer;\" >baca selanjutnya...</a> ] </p>";
		strBodyProduct += "</div>";
	} else
	{
		strBodyProduct += "<h2 class=\"title_blue\">No News Posted</h2>";
	}
	Element.update('HeadLine',strBodyProduct);
	
	/*
	var tmp1 = eval('('+tmp+')');
	var datax = tmp1["data"];	
	var resultx	= tmp1["result"];
	
	var strBodyProduct = "";
	
	if(parseInt(resultx) == 1)
	{
		
		for(n = 0; n < datax.length; n++)
		{
		
		strBodyProduct += "<h2 class=\"title_blue\">"+ datax[n].Title +"</h2>";
		strBodyProduct += "<p class=\"meta\"><small>Diposting Oleh: " + datax[n].AuthorName + " Pada: "+ datax[n].Date +"</small></p>";
		if (datax[0].Images == "undefined")
			{
				strBodyProduct += "<div id=\"headline_image\"><img src=\"images/no_images.jpg\" alt=\"sample\" height=\"100\" /></div>";
			}
			else {
				strBodyProduct += "<div id=\"headline_image\"><img src=\"images/" + datax[n].Images + "\" alt=\"sample\" height=\"100\" /></div>";	
			}	
		strBodyProduct += "<div id=\"headline_desc\"><p>" + datax[n].Content + "</p><p>[ <a href=\"#\">baca selanjutnya...</a> ] </p>";
		strBodyProduct += "</div>";
		
		}
	}
	else 
	{
		strBodyProduct += "<h2 class=\"title_blue\">No News Posted</h2>";
	}

	Element.update('HeadLine',strBodyProduct);
*/
	
}

function OlderNews() {
//alert('test');
	
	var strUrl = "./../services/older_news.php";
	var args = "limit=" + 1;
		args += "&limit2=" + 2;
	

	var strBodyProduct = "";
	strBodyProduct += "<img src=\"images/load.gif\" alt=\"loading\" />";	
	Element.update('sub_news',strBodyProduct);	
	
	new Ajax.Request(strUrl, {
		method:'post', 
		postBody:args, 
		onSuccess:function(objHttp){parseOlderNews(objHttp);}, 
		onFailure:function(objHttp){alert(objHttp.responseText);}, 
		evalScripts:true,
		asynchronous:true
	});

}

function parseOlderNews(objHttp) {
	tmp = objHttp.responseText;
	//alert(tmp);
	
	var tmp1 = eval('('+tmp+')');
	var datax = tmp1["data"];	
	var resultx	= tmp1["result"];
	
	var strBodyProduct = "";
	
	if(parseInt(resultx) == 1)
	{
		for(n = 0; n < datax.length; n++)
		{
			strBodyProduct += "<div class=\"sub_news_part1\">";
			strBodyProduct += "<h2 class=\"title_blue\"><a href=\"news.php?ID="+datax[n].NewsID +"\" style=\"cursor:pointer;\" >"+ datax[n].Title +"</a></h2>";
			strBodyProduct += "<p class=\"meta\"><small>Diposting Oleh: " + datax[n].AuthorName + " Pada: "+ datax[n].Date +"</small></p>";
			strBodyProduct += "<p>" + datax[n].Content + "</p>";
			strBodyProduct += "<p>[ <a href=\"news.php?ID="+datax[n].NewsID +"\" style=\"cursor:pointer;\" >baca selanjutnya...</a> ] </p>"
			strBodyProduct += "<p>&nbsp;</p>";
			strBodyProduct += "</div>";
		}
	}
	else 
	{
		strBodyProduct += "<div class=\"sub_news_part1\">";
		strBodyProduct += "<h2 class=\"title_blue\">No News Posted</h2>";
		strBodyProduct += "</div>";
	}
	
	Element.update('sub_news',strBodyProduct);
	
}


/*
function DetailNews(NewsID) {

	var strUrl = "./../services/news.php";
	var args = "NewsID=" + NewsID;
	//alert(args);
	
	var strBodyProduct = "";
	strBodyProduct += "<img src=\"images/load.gif\" alt=\"loading\" />";	
	Element.update('HeadLine',strBodyProduct);
	
	document.getElementById("sub_news").style.display = "none";
	document.getElementById("sub_news2").style.display = "none";
	document.getElementById("MiscField").style.display = "none";
	
	new Ajax.Request(strUrl, {
		method:'post', 
		postBody:args, 
		onSuccess:function(objHttp){parseDetailNews(objHttp);}, 
		onFailure:function(objHttp){alert(objHttp.responseText);}, 
		evalScripts:true,
		asynchronous:true
	});
	
}

function parseDetailNews(objHttp) {
	tmp = objHttp.responseText;
	//alert(tmp);

	var tmp1 = eval('('+tmp+')');
	var datax = tmp1["data"];
	var resultx	= tmp1["result"];
	
	var strBodyProduct = "";
	
	if (parseInt(resultx) == 1)
	{
		strBodyProduct += "<h2 class=\"title_blue\">"+ datax['Title'] +"</h2>";
		strBodyProduct += "<p class=\"meta\"><small>Diposting Oleh: " + datax['AuthorName'] + " Pada: "+ datax['Date'] +"</small></p>";
		if (datax['Images'] != ""){
			
			//tambahkan baris code ini jika image hasil query lebih dari satu	
			var singleimage=datax['Images'].split("~");
			if (1 < singleimage.length){
				strBodyProduct += "<div id=\"detail_news_image\">";
				for( var i=0; i < singleimage.length; i++ ){
					strBodyProduct += "<a style=\"cursor:pointer;\" onClick=\"alert('large images');\"><img src=\"images/" + singleimage[i] + "\" alt=\"sample\" height=\"100\"  /></a>";
				}
				strBodyProduct += "<p>(click to enlarge image)</p></div>";
				
			}
			else {
				strBodyProduct += "<div id=\"detail_news_image\"><a style=\"cursor:pointer;\" onClick=\"alert('large images');\"><img src=\"images/" + singleimage + "\" alt=\"sample\" height=\"100\" /></a><p>(click to enlarge image)</p></div>";
			}
			
		} else {
			strBodyProduct += "<div id=\"detail_news_image\"><img src=\"images/no_images.jpg\" alt=\"sample\" height=\"100\" /></div>";
		}
		strBodyProduct += "<div id=\"detail_news_desc\"><p>" + datax['Content'] + "</p>";
		strBodyProduct += "</div>";
	} else	{
		strBodyProduct += "<h2 class=\"title_blue\">No News Posted</h2>";
	}
	Element.update('HeadLine',strBodyProduct);

	
	//document.getElementById("dummy_banner").style.display = "none";

}

*/

function PressRelease() {
//alert('test');
	
	
	var strUrl = "./../services/press_release.php";
	var args = "limit=" + 4;

	
	var strBodyProduct = "";
	strBodyProduct += "<img src=\"images/load.gif\" alt=\"loading\" />";	
	Element.update('press_release',strBodyProduct);	
	
	new Ajax.Request(strUrl, {
		method:'post', 
		postBody:args, 
		onSuccess:function(objHttp){parsePressRelease(objHttp);}, 
		onFailure:function(objHttp){alert(objHttp.responseText);}, 
		evalScripts:true,
		asynchronous:true
	});
	
}

function parsePressRelease(objHttp) {
	tmp = objHttp.responseText;
	//alert(tmp);
	
	var tmp1 = eval('('+tmp+')');
	var datax = tmp1["data"];	
	var resultx	= tmp1["result"];
	
	var strBodyProduct = "";
	
	if(parseInt(resultx) == 1)
	{
		strBodyProduct += "<div id=\"press_release\">";
		strBodyProduct += "<h2 class=\"title_red\">Press Release</h2>";
		strBodyProduct += "<ol>";
		for(n = 0; n < datax.length; n++)
		{
			strBodyProduct += "<li><a href=\"press.php?nID="+ datax[n].PressID +"\">"+ datax[n].Title +"</a></li>";
		}
		strBodyProduct += "</ol>";
		strBodyProduct += "<p>[ <a href=\"press.php\">baca semuanya...</a> ] </p>";
		strBodyProduct += "</div>";
	}
	else 
	{
		strBodyProduct += "<div id=\"press_release\">";
		strBodyProduct += "<h2 class=\"title_red\">No News Posted</h2>";
		strBodyProduct += "</div>";
	}
	
	Element.update('press_release',strBodyProduct);
	
	
}

function inHeadlineNews() {
	//alert('test');
	
	var strUrl = "./../services/headline_news.php";
	var args = "limit=" + 4;
	
	var strBodyProduct = "";
	strBodyProduct += "<img src=\"images/load.gif\" alt=\"loading\" />";	
	Element.update('headline_news',strBodyProduct);	
	
	new Ajax.Request(strUrl, {
		method:'post', 
		postBody:args, 
		onSuccess:function(objHttp){parseinHeadlineNews(objHttp);}, 
		onFailure:function(objHttp){alert(objHttp.responseText);}, 
		evalScripts:true,
		asynchronous:true
	});
	
	
}

function parseinHeadlineNews(objHttp) {
	tmp = objHttp.responseText;
	//alert(tmp);
	
	var tmp1 = eval('('+tmp+')');
	var datax = tmp1["data"];	
	var resultx	= tmp1["result"];
	
	var strBodyProduct = "";
	
	if(parseInt(resultx) == 1)
	{
		strBodyProduct += "<div id=\"headline_news\">";
		strBodyProduct += "<h2 class=\"title_red\">SOIna dalam berita</h2>";
		strBodyProduct += "<ol>";
		for(n = 0; n < datax.length; n++)
		{
			strBodyProduct += "<li><a href=\"" +datax[n].Link + "\" target=\"_blank\">"+ datax[n].Title +"</a></li>";
		}
		strBodyProduct += "</ol>";
		strBodyProduct += "<p>[ <a href=\"headline.php\">baca semuanya...</a> ] </p>";
		strBodyProduct += "</div>";
	}
	else 
	{
		strBodyProduct += "<div id=\"headline_news\">";
		strBodyProduct += "<h2 class=\"title_red\">No headline list Posted</h2>";
		strBodyProduct += "</div>";
	}
	Element.update('headline_news',strBodyProduct);
}


function RegionalOrganizer() {
//alert('regional');

var strUrl = "./../services/regional_organizer.php";
var args = "limit=" + 7;

new Ajax.Request(strUrl, {
		method:'post', 
		postBody:args, 
		onSuccess:function(objHttp){parseRegionalOrganizer(objHttp);}, 
		onFailure:function(objHttp){alert(objHttp.responseText);}, 
		evalScripts:true,
		asynchronous:true
	});	
	
}

function parseRegionalOrganizer(objHttp) {
var tmp = objHttp.responseText;
//alert(tmp);

var tmp1 = eval('('+tmp+')');
var datax = tmp1["data"];	
var resultx	= tmp1["result"];

var strBodyProduct = "";

if(parseInt(resultx) == 1)
{
	strBodyProduct += "<div id=\"Field1\">"; 
	strBodyProduct += "<h2 class=\"title_blue\">Pengurus Daerah</h2>"; 
	strBodyProduct += "<ul>";
	for(n = 0; n < datax.length; n++)
	{
		strBodyProduct += "<li><a href=\"korwil.php?id="+ datax[n].ArticleID +"\" >"+ datax[n].LinkName +"</a></li>";
	}
	strBodyProduct += "</ul>";
	strBodyProduct += "</div>";
}
else 
{
	strBodyProduct += "<div id=\"Field1\">";
	strBodyProduct += "<ul>";
	strBodyProduct += "<li>No regional Updated</li>";
	strBodyProduct += "</ul>";
	strBodyProduct += "</div>";
}
Element.update('Field1',strBodyProduct);

}


function SportField() {
//alert('Sport filed');

var strUrl = "./../services/sport_field.php";
var args = "limit=" + 6;

new Ajax.Request(strUrl, {
		method:'post', 
		postBody:args, 
		onSuccess:function(objHttp){parseSportField(objHttp);}, 
		onFailure:function(objHttp){alert(objHttp.responseText);}, 
		evalScripts:true,
		asynchronous:true
	});
	
}

function parseSportField(objHttp) {
tmp = objHttp.responseText;
//alert(tmp);

var tmp1 = eval('('+tmp+')');
var datax = tmp1["data"];	
var resultx	= tmp1["result"];

var strBodyProduct = "";

if(parseInt(resultx) == 1)
{
	strBodyProduct += "<div id=\"Field1\">"; 
	strBodyProduct += "<h2 class=\"title_blue\">Cabang Olah Raga</h2>"; 
	strBodyProduct += "<ul>";
	for(n = 0; n < datax.length; n++)
	{
		strBodyProduct += "<li><a href=\"cabang_olahraga.php?cb="+datax[n].id+"\">"+ datax[n].sport_ +"</a></li>";
	}
	strBodyProduct += "</ul>";
	strBodyProduct += "</div>";
}
else {
	strBodyProduct += "<div id=\"Field1\">";
	strBodyProduct += "<h2 class=\"title_blue\">Cabang Olah Raga</h2>"; 
	strBodyProduct += "<ul>";
	strBodyProduct += "<li>No sportfield updated</li>";
	strBodyProduct += "</ul>";
	strBodyProduct += "</div>";
}
Element.update('Field2',strBodyProduct);
}

function OtherProgram() {

var strUrl = "./../services/other_program.php";
var args = "limit=" + 6;

new Ajax.Request(strUrl, {
		method:'post',
		postBody:args, 
		onSuccess:function(objHttp){parseOtherProgram(objHttp);}, 
		onFailure:function(objHttp){alert(objHttp.responseText);}, 
		evalScripts:true,
		asynchronous:true
	});
}

function parseOtherProgram(objHttp) {
tmp = objHttp.responseText;
//alert(tmp);

var tmp1 = eval('('+tmp+')');
var datax = tmp1["data"];	
var resultx	= tmp1["result"];

var strBodyProduct = "";

if(parseInt(resultx) == 1)
{
	strBodyProduct += "<div id=\"Field3\">"; 
	strBodyProduct += "<h2 class=\"title_blue\">Program Lain</h2>"; 
	strBodyProduct += "<ul>";
	for(n = 0; n < datax.length; n++)
	{
		strBodyProduct += "<li><a href=\"#\" target=\"_blank\">"+ datax[n].misc +"</a></li>";
	}
	strBodyProduct += "<li><a href=\"#\">Lihat semuanya..</a></li>";
	strBodyProduct += "</ul>";
	strBodyProduct += "</div>";
}
else {
	strBodyProduct += "<div id=\"Field3\">";
	strBodyProduct += "<h2 class=\"title_blue\">Program Lain</h2>"; 
	strBodyProduct += "<ul>";
	strBodyProduct += "<li>No program updated</li>";
	strBodyProduct += "</ul>";
	strBodyProduct += "</div>";
}
Element.update('Field3',strBodyProduct);

}