var khmerapp=[
{name:"Khmer Hip Hop",
download:"http://itunes.apple.com/us/app/khmer-hip-hop/id416689983?mt=8&ls=1",
icon:"http://mobile.khmer.org/support/hiphop/icon.png",
url:"http://mobile.khmer.org/support/hiphop/index.html"},

{name:"Sok Silalin",
download:"http://itunes.apple.com/us/app/sok-silalin/id416386347?mt=8&ls=1",
icon:"http://mobile.khmer.org/support/silalin/icon.png",
url:"http://mobile.khmer.org/support/silalin/index.html"},

{name:"Meas Sally",
download:"http://itunes.apple.com/us/app/meas-sally/id415138707?mt=8&ls=1",
icon:"http://mobile.khmer.org/support/meassally/icon.png",
url:"http://mobile.khmer.org/support/meassally/index.html"},

{name:"Dance party 90",
download:"http://itunes.apple.com/us/app/dance-party/id413418774?mt=8&ls=1",
icon:"http://mobile.khmer.org/support/party/icon.png",
url:"http://mobile.khmer.org/support/party/index.html"},

{name:"Ramvong",
download:"http://itunes.apple.com/us/app/ramvong/id413936611?mt=8&ls=1",
icon:"http://mobile.khmer.org/support/ramvong/icon.png",
url:"http://mobile.khmer.org/support/ramvong/index.html"},

{name:"Khom Bunnadeth",
download:"http://itunes.apple.com/us/app/khom-bunnadeth/id412782603?mt=8&ls=1",
icon:"http://mobile.khmer.org/support/bunnadeth/icon.png",
url:"http://mobile.khmer.org/support/bunnadeth/index.html"},

{name:"Soun Chantha",
download:"http://itunes.apple.com/us/app/soun-chantha/id412814292?mt=8&ls=1",
icon:"http://mobile.khmer.org/support/chantha/icon.png",
url:"http://mobile.khmer.org/support/chantha/index.html"},
 
{name:"New stars 6,390",
download:"itms://itunes.apple.com/us/app/new-stars/id390394570?mt=8",
icon:"http://mobile.khmer.org/support/newstars/icon.png",
 url:"http://mobile.khmer.org/support/newstars/index.html"},
 
{name:"Khmer.org 2,036",
download:"itms://itunes.apple.com/us/app/khmer-org/id364923400?mt=8",
icon:"http://mobile.khmer.org/support/kh/icon.png",
 url:"http://mobile.khmer.org/support/kh/index.html"},
 
{name:"Sophanita",
download:"itms://itunes.apple.com/us/app/sophanita/id408186770?mt=8",
icon:"http://mobile.khmer.org/support/sophanita/icon.png",
 url:"http://mobile.khmer.org/support/sophanita/index.html"},
 
{name:"Meng Keo Pichinda",
download:"itms://itunes.apple.com/us/app/pichinda/id406814551?mt=8",
icon:"http://mobile.khmer.org/support/pichinda/icon.png",
 url:"http://mobile.khmer.org/support/pichinda/index.html"},
 
{name:"Ith Sreypin",
download:"itms://itunes.apple.com/us/app/ith-sreypin/id401495266?mt=8",
icon:"http://mobile.khmer.org/support/isreypin/icon.png",
 url:"http://mobile.khmer.org/support/isreypin/index.html"},
 
{name:"Yuok TithRatha",
download:"itms://itunes.apple.com/us/app/yuok-tithratha/id391344640?mt=8",
icon:"http://mobile.khmer.org/support/ratha/icon.png",
 url:"http://mobile.khmer.org/support/ratha/index.html"},
 
{name:"Oeun Sreymom 42",
download:"itms://itunes.apple.com/us/app/oeun-sreymom/id389711442?mt=8",
icon:"http://mobile.khmer.org/support/sreymom/icon.png",
 url:"http://mobile.khmer.org/support/sreymom/index.html"},
 
{name:"Khmer Surin",
download:"itms://itunes.apple.com/us/app/khmer-surin/id389278525?mt=8",
icon:"http://mobile.khmer.org/support/khmersurin/icon.png",
 url:"http://mobile.khmer.org/support/khmersurin/index.html"},
 
{name:"Classical dance 41",
download:"itms://itunes.apple.com/us/app/classical-dance/id387641247?mt=8",
icon:"http://mobile.khmer.org/support/classicaldance/icon.png",
 url:"http://mobile.khmer.org/support/classicaldance/index.html"},
 
{name:"Khmer People onLine 146",
download:"itms://itunes.apple.com/us/app/khmer-people-online/id380878611?mt=8",
icon:"http://mobile.khmer.org/support/image/icon.png",
 url:"http://mobile.khmer.org/support/index.html"},
 
{name:"Khemerak Sereymon 60",
download:"itms://itunes.apple.com/us/app/khemerak-sereymon/id384304312?mt=8",
icon:"http://mobile.khmer.org/support/sereymon/icon.png",
url:"http://mobile.khmer.org/support/sereymon/index.html"},

{name:"Meas Sorphear 59",
download:"itms://itunes.apple.com/us/app/meas-sorphear/id381641369?mt=8",
icon:"http://mobile.khmer.org/support/meassorphear/icon.png",
url:"http://mobile.khmer.org/support/meassorphear/index.html"},

{name:"Sen Ranuth",
download:"itms://itunes.apple.com/us/app/sen-ranuth/id386240137?mt=8",
icon:"http://mobile.khmer.org/support/senranuth/icon.png",
url:"http://mobile.khmer.org/support/senranuth/index.html"},

{name:"Sin Sismouth 106",
download:"itms://itunes.apple.com/us/app/sin-sismouth/id385842385?mt=8",
icon:"http://mobile.khmer.org/support/sismouth/icon.png",
url:"http://mobile.khmer.org/support/sismouth/index.html"},

{name:"So Songvicha",
download:"itms://itunes.apple.com/us/app/so-songvicha/id383581154?mt=8",
icon:"http://mobile.khmer.org/support/songvicha/icon.png",
url:"http://mobile.khmer.org/support/songvicha/index.html"},

];

function app(page) {
	var str='';
	var str2='';
	var i=page * 10;
	var k=0;
	var total=parseInt(khmerapp.length / 10);
	if(total > 0) {
		var mypage=page+1;
		str2+='<table border="0" width="100%">';
		str2+='<tr><td><div id="prevpage">Prev</div></td>';
		str2+='<td>'+mypage+' of ' + total+'</td>';
		str2+='<td><div id="nextpage">Next</div></td></tr>';
		str2+='</table>';
	}
	str+='<fieldset><legend>Apps on iTune</legend>';
	while((k< 10)&&(i < khmerapp.length)) {
		str+='<div style="display:inline-block; margin:5px; padding:5px; width:100px; overflow:hidden">';
		str+='<a href="'+khmerapp[i].download+'">';
		str+='<img src="'+khmerapp[i].icon+'"><br>';
		str+=khmerapp[i].name+'</a>';
		str+='</div>'
		i++;
		k++;
	}
	str+='</fieldset>';
	str+=str2;
	$('#apps').html(str);
	$('#nextpage').click(function() {
		if(page < total) {	
			page++;
			app(page);
		}
							  
	});
	$('#prevpage').click(function() {
		if(page > 0) {	
			page--;
			app(page);
		}
							  
	});
}
