function setCookie(c_name,value,expiredays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    {
    c_start=c_start + c_name.length+1;
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    }
  }
return "";
}
function $_GET(q,s) {
    s = (s) ? s : window.location.search;
    var re = new RegExp('&amp;'+q+'=([^&amp;]*)','i');
    return (s=s.replace(/^\?/,'&amp;').match(re)) ?s=s[1] :s='';
}
///////////////////////////






$(document).ready(function(){
cook_id=getCookie('cook_id');
cook_rec=getCookie('cook_rec');
cook_con=getCookie('cook_con');
////////if get////////////
/*
cook_id = $_GET('id');
cook_rec = $_GET('rec');
cook_con = $_GET('con');
cook_tab = $_GET('tab');
var $tabs = $('#tabvanilla > ul').tabs();
if(cook_tab=="t") {$tabs.tabs('select', 1);}
*/
/////// End if get ///////
if (cook_rec!=null && cook_rec!="" )
{
$("select#rec option[selected]").removeAttr("selected");
$("select#rec option[value="+cook_rec+"]").attr("selected", "selected");
}
if (cook_con!=null && cook_con!="" )
{
$("select#continous option[selected]").removeAttr("selected");
$("select#continous option[value="+cook_con+"]").attr("selected", "selected");
}
if (cook_id!=null && cook_id!="" )
{
			
			
			//////////
			$('#quran').html('<p><div align="center"><img src="map_loading.gif"  /></div></p>');
			$("#quran").load("ajax_a.php?ShowByid=1&quranid="+cook_id);
			$("#ma3any").load("ajax_ma3any.php?ShowByid=1&quranid="+cook_id);
			
			
			$.getJSON(
			"ajax3.php?ShowByid=1&quranid="+cook_id, function(j){
			var options = '';
			for (var i = 0; i < j.length; i++) 
			{
			options += '<option value="' + j[i].optionValue + '" ' + j[i].selected + '="' + j[i].selected + '">' + j[i].optionDisplay + '</option>';
			}
			$("select#QuranVerseNo").html(options);
			///////// Load audio
			player.sendEvent('LOAD', {file:'playlist.php?con='+$("#continous option:selected").val()+'&rec='+$("#rec option:selected").val()+'&quranid='+cook_id});
			////////// End Load audio 
			});
			///////// Change Sura name
			$.ajax({
			type: "POST",
			url: "ajax2.php",
			data: "quranid_s="+cook_id,
			success: function(s_no){
			$("select#QuranSuraNo option[selected]").removeAttr("selected");
			$("select#QuranSuraNo option[value="+s_no+"]").attr("selected", "selected");
								}
			});
			///////// End Change Sura name
			///////// Change Page no
			$.ajax({
   									type: "POST",
   									url: "ajax2.php",
   									data: "quranid="+cook_id,
   									success: function(p_no){
    															$("select#QuranPartNo option[selected]").removeAttr("selected");
																$("select#QuranPartNo option[value="+p_no+"]").attr("selected", "selected");
																$("#pageno").html(p_no);
																		
   															}
 			});
			///////// End Change Page no
			
			//////////
			$.getJSON(
						"get_mof.php?charcter=1", function(j){
						var options = '';
						for (var i = 0; i < j.length; i++) {
													options += '<option value="' + j[i].optionValue + '">' + j[i].optionDisplay + '</option>';
															}
								$("select#mofrdat").html(options);
								
					});
			//////////			
}
else
{
////// Page load //////
$('#quran').html('<p><div align="center"><img src="map_loading.gif"  /></div></p>'); 
$("#quran").load("ajax_a.php?ShowByid=1&quranid=1");
$("#ma3any").load("ajax_ma3any.php?ShowByPartNo=1&PartNo=1");


//////////
$.getJSON(
			"get_mof.php?charcter=1", function(j){
      		var options = '';
      		for (var i = 0; i < j.length; i++) {
        								options += '<option value="' + j[i].optionValue + '">' + j[i].optionDisplay + '</option>';
      											}
      				$("select#mofrdat").html(options);
					player.sendEvent('LOAD', {file:'playlist.php?con=yes&rec=hussary2&page=1'});
    	});
//////////


///////
$.getJSON("ajax3.php?ShowBySuraNo=1&SuraNo=1", function(j){
      		var options = '';
      		for (var i = 0; i < j.length; i++) {
        								options += '<option value="' + j[i].optionValue + '">' + j[i].optionDisplay + '</option>';
      											}
      				$("select#QuranVerseNo").html(options);
					
					
    });

////////////// end page load ///////// 
}
 
 
////// on page change//////	///////////									
$("#QuranPartNo").change(function () {

			///////// Load audio
			player.sendEvent('LOAD', {file:'dummy.flv'});
			player.sendEvent('LOAD', {file:'playlist.php?con='+$("#continous option:selected").val()+'&rec='+$("#rec option:selected").val()+'&page='+$("#QuranPartNo option:selected").val()});
			////////// End Load audio 
			
			
			///////// Change Sura name
			$.ajax({
								type: "POST",
								url: "ajax2.php",
								data: "PartNo="+$("#QuranPartNo option:selected").val(),
								success: function(s_no){
															$("select#QuranSuraNo option[selected]").removeAttr("selected");
															$("select#QuranSuraNo option[value="+s_no+"]").attr("selected", "selected");
													   }
				});
			///////// End Change Sura name
			
			
			//////// Change sura verses
			$.getJSON(
			"ajax3.php?ShowByPartNo=1&page="+$("#QuranPartNo option:selected").val(), function(j){
      		var options = '';
      		for (var i = 0; i < j.length; i++) {
        	options += '<option value="' + j[i].optionValue + '" ' + j[i].selected + '="' + j[i].selected + '">' + j[i].optionDisplay + '</option>';
      											}
      				$("select#QuranVerseNo").html(options);
    		});
			//////// End Change sura verses
			///////// Get Quran ID
			$.ajax({
								type: "POST",
								url: "get_id.php",
								data: "ShowByPartNo=1&PartNo="+$("#QuranPartNo option:selected").val(),
								success: function(s_no){
															setCookie('cook_id',s_no,365);
													   }
				});
			///////// End Get Quran ID
			
			//////// Quran Tab /////////
			if ($("#q").hasClass('current')) 
			{
			$('#quran').html('<p><div align="center"><img src="map_loading.gif"  /></div></p>');
			$("#quran").load("ajax_a.php?ShowByPartNo=1&PartNo="+$("#QuranPartNo option:selected").val());
			$("#ma3any").load("ajax_ma3any.php?ShowByPartNo=1&PartNo="+$("#QuranPartNo option:selected").val());
			$("#pageno").html($("#QuranPartNo option:selected").val());
			}
			////////////////////////////
			
			//////// Tafseer Tab ////////
			if ($("#t").hasClass('current')) 
			{
			$("#tafseer").load("tafser_details_a.php?PageNo="+$("#QuranPartNo option:selected").val()+"&go="+$("#go option:selected").val()+"&ShowNo=1");
			}
			////////////////////////////
			
			////// Tagweed Tab /////////
			if ($("#d").hasClass('current')) 
			{
			$("#t_quran").load("ajax_tagweed_a.php?ShowByPartNo=1&PartNo="+$("#QuranPartNo option:selected").val());
			$("#pageno_t").html($("#QuranPartNo option:selected").val());
			}
			////////////////////////////
			
			//////// E3rab Tab /////////
			if ($("#e").hasClass('current')) 
			{
			$("#e3rab").load("e3rab_details_a.php?PageNo="+$("#QuranPartNo option:selected").val()+"&e3r="+$("#e3r option:selected").val()+"&ShowNo=1");
			}
			////////////////////////////
			

			
			
			//////// Keraat Tab /////////
			if ($("#k").hasClass('current')) 
			{
			$("#k_quran").load("quran_keraat_a.php?ShowByPartNo=1&PartNo="+$("#QuranPartNo option:selected").val()); 
			$("#ker").load("ajax_keraat.php?ShowByPartNo=1&PartNo="+$("#QuranPartNo option:selected").val());
			$("#pageno_k").html($("#QuranPartNo option:selected").val());
			}
			////////////////////////////
			
			//////// Motshabehat Tab /////////
			if ($("#m").hasClass('current')) 
			{
			$("#m_quran").load("quran_mot_a.php?ShowByPartNo=1&PartNo="+$("#QuranPartNo option:selected").val());
			$("#mot").load("ajax_motashabeh.php?ShowByPartNo=1&PartNo="+$("#QuranPartNo option:selected").val());
			$("#pageno_m").html($("#QuranPartNo option:selected").val());
			}
			////////////////////////////
});
//////////  end page change //////



////// on Sura change//////	///////////									
$("#QuranSuraNo").change(function () {

			///////// Load audio
			player.sendEvent('LOAD', {file:'dummy.flv'});
			player.sendEvent('LOAD', {file:'playlist.php?con='+$("#continous option:selected").val()+'&rec='+$("#rec option:selected").val()+'&verse=1&sura='+$("#QuranSuraNo option:selected").val()});
			////////// End Load audio 
			
			
			///////// Change Page no
			$.ajax({
   									type: "POST",
   									url: "ajax2.php",
   									data: "SuraNo="+$("#QuranSuraNo option:selected").val(),
   									success: function(p_no){
    															$("select#QuranPartNo option[selected]").removeAttr("selected");
																$("select#QuranPartNo option[value="+p_no+"]").attr("selected", "selected");
																$("#pageno").html(p_no);
																$("#pageno_k").html(p_no);
																$("#pageno_m").html(p_no);
																$("#pageno_t").html(p_no);
			
   															}
 			});
			///////// End Change Page no
			
			
			//////// Change sura verses
			$.getJSON("ajax3.php?ShowBySuraNo=1&SuraNo="+$("#QuranSuraNo option:selected").val(), function(j){
			var options = '';
			for (var i = 0; i < j.length; i++) {
			options += '<option value="' + j[i].optionValue + '">' + j[i].optionDisplay + '</option>';
			}
			$("select#QuranVerseNo").html(options);
			});
			//////// End Change sura verses
			
			///////// Get Quran ID
			$.ajax({
								type: "POST",
								url: "get_id.php",
								data: "ShowBySuraNo=1&SuraNo="+$("#QuranSuraNo option:selected").val(),
								success: function(s_no){
															setCookie('cook_id',s_no,365);
													   }
				});
			///////// End Get Quran ID
			//////// Quran Tab /////////
			if ($("#q").hasClass('current')) 
			{
			$('#quran').html('<p><div align="center"><img src="map_loading.gif"  /></div></p>');
			$("#quran").load("ajax_a.php?ShowBySuraNo=1&SuraNo="+$("#QuranSuraNo option:selected").val());
			$("#ma3any").load("ajax_ma3any.php?ShowBySuraNo=1&SuraNo="+$("#QuranSuraNo option:selected").val());
			}
			////////////////////////////
			
			//////// Tafseer Tab ////////
			if ($("#t").hasClass('current')) 
			{
			$('#tafseer').html('<p><div align="center"><img src="map_loading.gif"  /></div></p>'); 
			$("#tafseer").load("tafser_details_a.php?QuranSuraNo="+$("#QuranSuraNo option:selected").val()+"&QuranVerseNo=1&go="+$("#go option:selected").val()+"&ShowNo=1");
			}
			////////////////////////////
			
			////// Tagweed Tab /////////
			if ($("#d").hasClass('current')) 
			{
			$('#t_quran').html('<p><div align="center"><img src="map_loading.gif"  /></div></p>'); 
			$("#t_quran").load("ajax_tagweed_a.php?ShowBySuraNo=1&SuraNo="+$("#QuranSuraNo option:selected").val());
			}
			////////////////////////////
			
			//////// E3rab Tab /////////
			if ($("#e").hasClass('current')) 
			{
			$('#e3rab').html('<p><div align="center"><img src="map_loading.gif"  /></div></p>');
			$("#e3rab").load("e3rab_details_a.php?QuranSuraNo="+$("#QuranSuraNo option:selected").val()+"&QuranVerseNo=1&e3r="+$("#e3r option:selected").val()+"&ShowNo=1");
			}
			////////////////////////////
			
			//////// Keraat Tab /////////
			if ($("#k").hasClass('current')) 
			{
			$('#k_quran').html('<p><div align="center"><img src="map_loading.gif"  /></div></p>');
			$("#k_quran").load("quran_keraat_a.php?ShowBySuraNo=1&SuraNo="+$("#QuranSuraNo option:selected").val()); 
			$('#ker').html('<p><div align="center"><img src="map_loading.gif"  /></div></p>');
			$("#ker").load("ajax_keraat.php?ShowBySuraNo=1&SuraNo="+$("#QuranSuraNo option:selected").val());
			}
			////////////////////////////
			
			//////// Motshabehat Tab /////////
			if ($("#m").hasClass('current')) 
			{
			$('#m_quran').html('<p><div align="center"><img src="map_loading.gif"  /></div></p>');
			$("#m_quran").load("quran_mot_a.php?ShowBySuraNo=1&SuraNo="+$("#QuranSuraNo option:selected").val());
			$('#mot').html('<p><div align="center"><img src="map_loading.gif"  /></div></p>');
			$("#mot").load("ajax_motashabeh.php?ShowBySuraNo=1&SuraNo="+$("#QuranSuraNo option:selected").val());
			}
			////////////////////////////
});
//////////  end Sura change //////





////// on verse change//////	///////////									
$("#QuranVerseNo").change(function () {

			///////// Load audio
			player.sendEvent('LOAD', {file:'dummy.flv'});
			player.sendEvent('LOAD', {file:'playlist.php?con='+$("#continous option:selected").val()+'&rec='+$("#rec option:selected").val()+'&sura='+$("#QuranSuraNo option:selected").val()+'&verse='+$("#QuranVerseNo option:selected").val()});
			////////// End Load audio 
			
			
			///////// Change Page no
			$.ajax({
   					type: "POST",
   					url: "ajax2.php",
   					data: "VerseNo="+$("#QuranVerseNo option:selected").val()+"&Sura="+$("#QuranSuraNo option:selected").val(),
   					success: function(p_no){
    										$("select#QuranPartNo option[selected]").removeAttr("selected");
											$("select#QuranPartNo option[value="+p_no+"]").attr("selected", "selected");
											$("#pageno").html(p_no);
											$("#pageno_k").html(p_no);
											$("#pageno_m").html(p_no);
											$("#pageno_t").html(p_no);
											}
 			});
			///////// End Change Page no
			
			///////// Get Quran ID
			$.ajax({
								type: "POST",
								url: "get_id.php",
								data: "ShowByVerseNo=1&VerseNo="+$("#QuranVerseNo option:selected").val()+"&SuraNo="+$("#QuranSuraNo option:selected").val(),
								success: function(s_no){
															setCookie('cook_id',s_no,365);
													   }
				});
			///////// End Get Quran ID
			//////// Quran Tab /////////
			if ($("#q").hasClass('current')) 
			{
			$('#quran').html('<p><div align="center"><img src="map_loading.gif"  /></div></p>');
			$("#quran").load("ajax_a.php?ShowByVerseNo=1&VerseNo="+$("#QuranVerseNo option:selected").val()+"&SuraNo="+$("#QuranSuraNo option:selected").val());
			$("#ma3any").load("ajax_ma3any.php?ShowByVerseNo=1&VerseNo="+$("#QuranVerseNo option:selected").val()+"&SuraNo="+$("#QuranSuraNo option:selected").val());
			}
			////////////////////////////
			
			//////// Tafseer Tab ////////
			if ($("#t").hasClass('current')) 
			{
			$('#tafseer').html('<p><div align="center"><img src="map_loading.gif"  /></div></p>'); 
			$("#tafseer").load("tafser_details_a.php?QuranSuraNo="+$("#QuranSuraNo option:selected").val()+"&QuranVerseNo="+$("#QuranVerseNo option:selected").val()+"&go="+$("#go option:selected").val()+"&ShowNo=1");
			}
			////////////////////////////
			
			////// Tagweed Tab /////////
			if ($("#d").hasClass('current')) 
			{
			$('#t_quran').html('<p><div align="center"><img src="map_loading.gif"  /></div></p>'); 
			$("#t_quran").load("ajax_tagweed_a.php?ShowByVerseNo=1&VerseNo="+$("#QuranVerseNo option:selected").val()+"&SuraNo="+$("#QuranSuraNo option:selected").val());
			}
			////////////////////////////
			
			//////// E3rab Tab /////////
			if ($("#e").hasClass('current')) 
			{
			$('#e3rab').html('<p><div align="center"><img src="map_loading.gif"  /></div></p>');
			$("#e3rab").load("e3rab_details_a.php?QuranSuraNo="+$("#QuranSuraNo option:selected").val()+"&QuranVerseNo="+$("#QuranVerseNo option:selected").val()+"&e3r="+$("#e3r option:selected").val()+"&ShowNo=1");
			}
			////////////////////////////
			
			//////// Keraat Tab /////////
			if ($("#k").hasClass('current')) 
			{
			$('#k_quran').html('<p><div align="center"><img src="map_loading.gif"  /></div></p>');
			$("#k_quran").load("quran_keraat_a.php?ShowByVerseNo=1&VerseNo="+$("#QuranVerseNo option:selected").val()+"&SuraNo="+$("#QuranSuraNo option:selected").val()); 
			$('#ker').html('<p><div align="center"><img src="map_loading.gif"  /></div></p>');
			$("#ker").load("ajax_keraat.php?ShowByVerseNo=1&VerseNo="+$("#QuranVerseNo option:selected").val()+"&SuraNo="+$("#QuranSuraNo option:selected").val());
			}
			////////////////////////////
			
			//////// Motshabehat Tab /////////
			if ($("#m").hasClass('current')) 
			{
			$('#m_quran').html('<p><div align="center"><img src="map_loading.gif"  /></div></p>');
			$("#m_quran").load("quran_mot_a.php?ShowByVerseNo=1&VerseNo="+$("#QuranVerseNo option:selected").val()+"&SuraNo="+$("#QuranSuraNo option:selected").val());
			$('#mot').html('<p><div align="center"><img src="map_loading.gif"  /></div></p>');
			$("#mot").load("ajax_motashabeh.php?ShowByVerseNo=1&VerseNo="+$("#QuranVerseNo option:selected").val()+"&SuraNo="+$("#QuranSuraNo option:selected").val());
			}
			////////////////////////////
});
//////////  end verse change //////



//////////////on tafseer change///
$("#go").change(function () {
							$('#tafseer').html('<p><div align="center"><img src="map_loading.gif"  /></div></p>'); 
							$("#tafseer").load("tafser_details_a.php?QuranSuraNo="+$("#QuranSuraNo option:selected").val()+"&QuranVerseNo="+$("#QuranVerseNo option:selected").val()+"&go="+$("#go option:selected").val()+"&ShowNo=1");		
							});
///////////////////////////////////////
/////////////////////// on e3rab change
$("#e3r").change(function () {
									
									$('#e3rab').html('<p><div align="center"><img src="map_loading.gif"  /></div></p>');
									$("#e3rab").load("e3rab_details_a.php?QuranSuraNo="+$("#QuranSuraNo option:selected").val()+"&QuranVerseNo="+$("#QuranVerseNo option:selected").val()+"&e3r="+$("#e3r option:selected").val()+"&ShowNo=1");		
									}); 
/////////////////////////////////
/////////////////////// on translate change///////////////////////////////////////
$("#hany").change(function () {
									
									$.ajax({
  													type: "GET",
   													url: "ajax_a.php",
   													data: "ShowByVerseNo=1&VerseNo="+$("#QuranVerseNo option:selected").val()+"&SuraNo="+$("#QuranSuraNo option:selected").val(),
   													success: function(data){
     																		$("#quran").html(data);
																			$("#k_quran").html(data);
																			$("#m_quran").html(data);
																			$("#trgma_quran").html(data);
	 																		}
											 });

//////////////
 				 										$.ajax({
  													type: "GET",
   													url: "ajax_trgma.php",
   													data: "ShowByVerseNo=1&Action="+$("#hany option:selected").val()+"&VerseNo="+$("#QuranVerseNo option:selected").val()+"&SuraNo="+$("#QuranSuraNo option:selected").val(),
   													success: function(data){
     																		$("#trgma_d").html(data);
	 																		}
											 });	
									}); 
/////////////////////////////////

$("#rec").change(function () {
/////////

////////
		 $.ajax({
   					type: "POST",
  					 url: "ajax_a.php",
   					data: "ShowByVerseNo=1&VerseNo="+$("#QuranVerseNo option:selected").val()+"&SuraNo="+$("#QuranSuraNo option:selected").val(),
   					success: function(data){
     
player.sendEvent('STOP');
player.sendEvent('LOAD', {file:'dummy.flv'});
player.sendEvent('LOAD', {file:'playlist.php?con='+$("#continous option:selected").val()+'&rec='+$("#rec option:selected").val()+'&sura='+$("#QuranSuraNo option:selected").val()+'&verse='+$("#QuranVerseNo option:selected").val()});
setCookie('cook_rec',$("#rec option:selected").val(),365);												
	 
   											}
 				});
		 });
////////////////////
$("#continous").change(function () {
/////////

////////
		 $.ajax({
   					type: "POST",
  					 url: "ajax_a.php",
   					data: "ShowByVerseNo=1&VerseNo="+$("#QuranVerseNo option:selected").val()+"&SuraNo="+$("#QuranSuraNo option:selected").val(),
   					success: function(data){
     
player.sendEvent('STOP');
player.sendEvent('LOAD', {file:'dummy.flv'});							
player.sendEvent('LOAD', {file:'playlist.php?con='+$("#continous option:selected").val()+'&rec='+$("#rec option:selected").val()+'&sura='+$("#QuranSuraNo option:selected").val()+'&verse='+$("#QuranVerseNo option:selected").val()});
setCookie('cook_con',$("#continous option:selected").val(),365);							 
   											}
 				});
		 });
////////////////////
	  

////////////////////
$("#search").click(function () {
 								$.ajax({
   													type: "POST",
   													url: "search_quran_a.php",
   													data: "keyword="+$("input#keyword").val()+"&lk="+$("input[name='lk']:checked").val()+"&sura="+$("#sura1 option:selected").val(),
   													success: function(s_result){
    															$('#search_result').html('<p><div align="center"><img src="map_loading.gif"  /></div></p>');
																$("#search_result").html(s_result);
																			   }
 											});
								
							});	 
////////////////////
$("#search_side").click(function () {
 								$.ajax({
   													type: "POST",
   													url: "search_quran_a.php",
   													data: "keyword="+$("input#keyword2").val()+"&lk="+$("input[name='lk2']:checked").val()+"&sura="+$("#sura2 option:selected").val(),
   													success: function(s_result){
																$('#search_result').html('<p><div align="center"><img src="map_loading.gif"  /></div></p>');
    															$("#search_result").html(s_result);
																 $("#qur").fadeOut("speed");
																 $("#tafseer").fadeOut("speed");
																 $("#e3rab").fadeOut("speed");
																 $("#trgma").fadeOut("speed");
																 $("#karaat").fadeOut("speed");
																 $("#se").fadeIn("speed");
																 ///////////
																 if (!$("#s").hasClass('current')) {      
  
     
$('#q').removeClass('current');  
$('#e').removeClass('current');
$('#t').removeClass('current');
$('#g').removeClass('current');
$('#k').removeClass('current');
$("#s").addClass('current');    
} 
																 
																			   }
 											});
								
							});	 
//////////  show mofrdat  ///////////

$("#mofrdat").change(function () {
 								$.ajax({
   													type: "POST",
   													url: "view.php",
   													data: "id="+$("#mofrdat option:selected").val(),
   													success: function(s_result){
																$('#search_result').html('<p><div align="center"><img src="map_loading.gif"  /></div></p>');
    															$("#search_result").html(s_result);
																 $("#qur").fadeOut("speed");
																 $("#tafseer").fadeOut("speed");
																 $("#e3rab").fadeOut("speed");
																 $("#trgma").fadeOut("speed");
																 $("#karaat").fadeOut("speed");
																 $("#se").fadeIn("speed");
																 ///////////
																 if (!$("#s").hasClass('current')) {      
  
     
$('#q').removeClass('current');  
$('#e').removeClass('current');
$('#t').removeClass('current');
$('#g').removeClass('current');
$('#k').removeClass('current');
$('#d').removeClass('current');

$("#s").addClass('current');    

} 
																 
																			   }
 											});
								
							});

////// go to next page /////////////////									
$("#Right_ar").click(function () {

pg=$("#QuranPartNo option:selected").val();
pg=parseInt(pg);
if (pg!=604)
{
pg=pg+1;
}
$("#pageno").html(pg);
////////
		 $.ajax({
   					type: "POST",
  					 url: "ajax_a.php",
   					data: "ShowByPartNo=1&PartNo="+pg,
   					success: function(data){
     
												$("#quran").html(data);
												$("#k_quran").html(data);
												
player.sendEvent('LOAD', {file:'dummy.flv'});
												player.sendEvent('LOAD', {file:'playlist.php?con='+$("#continous option:selected").val()+'&rec='+$("#rec option:selected").val()+'&page='+pg});
	$("select#QuranPartNo option[selected]").removeAttr("selected");
$("select#QuranPartNo option[value="+pg+"]").attr("selected", "selected");																							
												
	 
   											}
 				});
//////////////
		 $.ajax({
   					type: "POST",
  					 url: "ajax_ma3any.php",
   					data: "ShowByPartNo=1&PartNo="+pg,
   					success: function(m){
     
												$("#ma3any").html(m);
												
	 
   											}
 				});

		$.ajax({
   					type: "POST",
   					url: "ajax2.php",
   					data: "PartNo="+pg,
   					success: function(s_no){
    											$("select#QuranSuraNo option[selected]").removeAttr("selected");
												$("select#QuranSuraNo option[value="+s_no+"]").attr("selected", "selected");
											///////////
						        
 											}
 			});
///////	
		$.getJSON(
			"ajax3.php?ShowByPartNo=1&page="+pg, function(j){
      		var options = '';
      		for (var i = 0; i < j.length; i++) {
        	options += '<option value="' + j[i].optionValue + '" ' + j[i].selected + '="' + j[i].selected + '">' + j[i].optionDisplay + '</option>';
      											}
      				$("select#QuranVerseNo").html(options);
    });
////////

})
 
 ////// go to Pervious page //////	///////////									
$("#Left_ar").click(function () {

pg=$("#QuranPartNo option:selected").val();
pg=parseInt(pg);
if (pg!=1)
{
pg=pg-1;
}
$("#pageno").html(pg);

////////
		 $.ajax({
   					type: "POST",
  					 url: "ajax_a.php",
   					data: "ShowByPartNo=1&PartNo="+pg,
   					success: function(data){
     
												$("#quran").html(data);
												$("#k_quran").html(data);
												
player.sendEvent('LOAD', {file:'dummy.flv'});
												player.sendEvent('LOAD', {file:'playlist.php?con='+$("#continous option:selected").val()+'&rec='+$("#rec option:selected").val()+'&page='+pg});
																								
$("select#QuranPartNo option[selected]").removeAttr("selected");
$("select#QuranPartNo option[value="+pg+"]").attr("selected", "selected");												
	 
   											}
 				});
//////////////
		 $.ajax({
   					type: "POST",
  					 url: "ajax_ma3any.php",
   					data: "ShowByPartNo=1&PartNo="+pg,
   					success: function(m){
     
												$("#ma3any").html(m);
												
	 
   											}
 				});
////////////// 	
		
		$.ajax({
   					type: "POST",
   					url: "ajax2.php",
   					data: "PartNo="+pg,
   					success: function(s_no){
    											$("select#QuranSuraNo option[selected]").removeAttr("selected");
												$("select#QuranSuraNo option[value="+s_no+"]").attr("selected", "selected");
											///////////
						        
 											}
 			});
///////	
		$.getJSON(
			"ajax3.php?ShowByPartNo=1&page="+pg, function(j){
      		var options = '';
      		for (var i = 0; i < j.length; i++) {
        	options += '<option value="' + j[i].optionValue + '" ' + j[i].selected + '="' + j[i].selected + '">' + j[i].optionDisplay + '</option>';
      											}
      				$("select#QuranVerseNo").html(options);
    });
////////

})
//////////Keraat/////////////////
////// go to next page //////	///////////									
$("#Right_ar_k").click(function () {

pg=$("#QuranPartNo option:selected").val();
pg=parseInt(pg);
if (pg!=604)
{
pg=pg+1;
}
$("#pageno_k").html(pg);

////////
		 $.ajax({
   					type: "POST",
  					 url: "quran_keraat_a.php",
   					data: "ShowByPartNo=1&PartNo="+pg,
   					success: function(data){
     
												
												$("#k_quran").html(data);
												
												
player.sendEvent('LOAD', {file:'dummy.flv'});
												player.sendEvent('LOAD', {file:'playlist.php?con='+$("#continous option:selected").val()+'&rec='+$("#rec option:selected").val()+'&page='+pg});
	$("select#QuranPartNo option[selected]").removeAttr("selected");
$("select#QuranPartNo option[value="+pg+"]").attr("selected", "selected");																							
												
	 
   											}
 				});
//////////////
		
////////////// 	
			 $.ajax({
   					type: "POST",
  					 url: "ajax_keraat.php",
   					data: "ShowByPartNo=1&PartNo="+pg,
   					success: function(m){
     
												$("#ker").html(m);
												
	 
   											}
 				});
/////////////
		$.ajax({
   					type: "POST",
   					url: "ajax2.php",
   					data: "PartNo="+pg,
   					success: function(s_no){
    											$("select#QuranSuraNo option[selected]").removeAttr("selected");
												$("select#QuranSuraNo option[value="+s_no+"]").attr("selected", "selected");
											///////////
						        
 											}
 			});
///////	
		$.getJSON(
			"ajax3.php?ShowByPartNo=1&page="+pg, function(j){
      		var options = '';
      		for (var i = 0; i < j.length; i++) {
        	options += '<option value="' + j[i].optionValue + '" ' + j[i].selected + '="' + j[i].selected + '">' + j[i].optionDisplay + '</option>';
      											}
      				$("select#QuranVerseNo").html(options);
    });
////////

})
 
 ////// go to Pervious page //////	///////////									
$("#Left_ar_k").click(function () {

pg=$("#QuranPartNo option:selected").val();
pg=parseInt(pg);
if (pg!=1)
{
pg=pg-1;
}
$("#pageno_k").html(pg);
////////
		 $.ajax({
   					type: "POST",
  					 url: "quran_keraat_a.php",
   					data: "ShowByPartNo=1&PartNo="+pg,
   					success: function(data){
     									$("#k_quran").html(data);
												
player.sendEvent('LOAD', {file:'dummy.flv'});
												player.sendEvent('LOAD', {file:'playlist.php?con='+$("#continous option:selected").val()+'&rec='+$("#rec option:selected").val()+'&page='+pg});
																								
$("select#QuranPartNo option[selected]").removeAttr("selected");
$("select#QuranPartNo option[value="+pg+"]").attr("selected", "selected");												
	 
   											}
 				});
//////////////
		
			 $.ajax({
   					type: "POST",
  					 url: "ajax_keraat.php",
   					data: "ShowByPartNo=1&PartNo="+pg,
   					success: function(m){
     
												$("#ker").html(m);
												
	 
   											}
 				});
/////////////
		$.ajax({
   					type: "POST",
   					url: "ajax2.php",
   					data: "PartNo="+pg,
   					success: function(s_no){
    											$("select#QuranSuraNo option[selected]").removeAttr("selected");
												$("select#QuranSuraNo option[value="+s_no+"]").attr("selected", "selected");
											///////////
						        
 											}
 			});
///////	
		$.getJSON(
			"ajax3.php?ShowByPartNo=1&page="+pg, function(j){
      		var options = '';
      		for (var i = 0; i < j.length; i++) {
        	options += '<option value="' + j[i].optionValue + '" ' + j[i].selected + '="' + j[i].selected + '">' + j[i].optionDisplay + '</option>';
      											}
      				$("select#QuranVerseNo").html(options);
    });
////////

})


//////////Tagweed/////////////////
////// go to next page //////	///////////									
$("#Right_ar_t").click(function () {

pg=$("#QuranPartNo option:selected").val();
pg=parseInt(pg);
if (pg!=604)
{
pg=pg+1;
}
$("#pageno_t").html(pg);
////////
		 $.ajax({
   					type: "POST",
  					 url: "ajax_tagweed_a.php",
   					data: "ShowByPartNo=1&PartNo="+pg,
   					success: function(data){
     
												$("#t_quran").html(data);
												
												
												
player.sendEvent('LOAD', {file:'dummy.flv'});
player.sendEvent('LOAD', {file:'playlist.php?con='+$("#continous option:selected").val()+'&rec='+$("#rec option:selected").val()+'&page='+pg});
	$("select#QuranPartNo option[selected]").removeAttr("selected");
$("select#QuranPartNo option[value="+pg+"]").attr("selected", "selected");																							
												
	 
   											}
 				});
//////////////
		
/////////////
		$.ajax({
   					type: "POST",
   					url: "ajax2.php",
   					data: "PartNo="+pg,
   					success: function(s_no){
    											$("select#QuranSuraNo option[selected]").removeAttr("selected");
												$("select#QuranSuraNo option[value="+s_no+"]").attr("selected", "selected");
											///////////
						        
 											}
 			});
///////	
		$.getJSON(
			"ajax3.php?ShowByPartNo=1&page="+pg, function(j){
      		var options = '';
      		for (var i = 0; i < j.length; i++) {
        	options += '<option value="' + j[i].optionValue + '" ' + j[i].selected + '="' + j[i].selected + '">' + j[i].optionDisplay + '</option>';
      											}
      				$("select#QuranVerseNo").html(options);
    });
////////

})
 
 ////// go to Pervious page //////	///////////									
$("#Left_ar_t").click(function () {

pg=$("#QuranPartNo option:selected").val();
pg=parseInt(pg);
if (pg!=1)
{
pg=pg-1;
}

$("#pageno_t").html(pg);
////////
		 $.ajax({
   					type: "POST",
  					 url: "ajax_tagweed_a.php",
   					data: "ShowByPartNo=1&PartNo="+pg,
   					success: function(data){
     
												$("#t_quran").html(data);
												
												
player.sendEvent('LOAD', {file:'dummy.flv'});
												player.sendEvent('LOAD', {file:'playlist.php?con='+$("#continous option:selected").val()+'&rec='+$("#rec option:selected").val()+'&page='+pg});
																								
$("select#QuranPartNo option[selected]").removeAttr("selected");
$("select#QuranPartNo option[value="+pg+"]").attr("selected", "selected");												
	 
   											}
 				});
//////////////
		

		$.ajax({
   					type: "POST",
   					url: "ajax2.php",
   					data: "PartNo="+pg,
   					success: function(s_no){
    											$("select#QuranSuraNo option[selected]").removeAttr("selected");
												$("select#QuranSuraNo option[value="+s_no+"]").attr("selected", "selected");
											///////////
						        
 											}
 			});
///////	
		$.getJSON(
			"ajax3.php?ShowByPartNo=1&page="+pg, function(j){
      		var options = '';
      		for (var i = 0; i < j.length; i++) {
        	options += '<option value="' + j[i].optionValue + '" ' + j[i].selected + '="' + j[i].selected + '">' + j[i].optionDisplay + '</option>';
      											}
      				$("select#QuranVerseNo").html(options);
    });
////////

})


//////////Motashabehat/////////////////
////// go to next page //////	///////////									
$("#Right_ar_m").click(function () {

pg=$("#QuranPartNo option:selected").val();
pg=parseInt(pg);
if (pg!=604)
{
pg=pg+1;
}
$("#pageno_m").html(pg);
////////
		 $.ajax({
   					type: "POST",
  					 url: "quran_mot_a.php",
   					data: "ShowByPartNo=1&PartNo="+pg,
   					success: function(data){
     
												$("#m_quran").html(data);
												
												
player.sendEvent('LOAD', {file:'dummy.flv'});
												player.sendEvent('LOAD', {file:'playlist.php?con='+$("#continous option:selected").val()+'&rec='+$("#rec option:selected").val()+'&page='+pg});
	$("select#QuranPartNo option[selected]").removeAttr("selected");
$("select#QuranPartNo option[value="+pg+"]").attr("selected", "selected");																							
												
	 
   											}
 				});
//////////////
		 
////////////// 	
			 $.ajax({
   					type: "POST",
  					 url: "ajax_motashabeh.php",
   					data: "ShowByPartNo=1&PartNo="+pg,
   					success: function(m){
     
												$("#mot").html(m);
												
	 
   											}
 				});
/////////////
		$.ajax({
   					type: "POST",
   					url: "ajax2.php",
   					data: "PartNo="+pg,
   					success: function(s_no){
    											$("select#QuranSuraNo option[selected]").removeAttr("selected");
												$("select#QuranSuraNo option[value="+s_no+"]").attr("selected", "selected");
											///////////
						        
 											}
 			});
///////	
		$.getJSON(
			"ajax3.php?ShowByPartNo=1&page="+pg, function(j){
      		var options = '';
      		for (var i = 0; i < j.length; i++) {
        	options += '<option value="' + j[i].optionValue + '" ' + j[i].selected + '="' + j[i].selected + '">' + j[i].optionDisplay + '</option>';
      											}
      				$("select#QuranVerseNo").html(options);
    });
////////

})
 
 ////// go to Pervious page //////	///////////									
$("#Left_ar_m").click(function () {

pg=$("#QuranPartNo option:selected").val();
pg=parseInt(pg);
if (pg!=1)
{
pg=pg-1;
}


$("#pageno_m").html(pg);
////////
		 $.ajax({
   					type: "POST",
  					 url: "quran_mot_a.php",
   					data: "ShowByPartNo=1&PartNo="+pg,
   					success: function(data){
     
												$("#m_quran").html(data);
												
player.sendEvent('LOAD', {file:'dummy.flv'});
player.sendEvent('LOAD', {file:'playlist.php?con='+$("#continous option:selected").val()+'&rec='+$("#rec option:selected").val()+'&page='+pg});
																								
$("select#QuranPartNo option[selected]").removeAttr("selected");
$("select#QuranPartNo option[value="+pg+"]").attr("selected", "selected");												
	 
   											}
 				});

////////////// 	
			 $.ajax({
   					type: "POST",
  					 url: "ajax_motashabeh.php",
   					data: "ShowByPartNo=1&PartNo="+pg,
   					success: function(m){
     
												$("#mot").html(m);
												
	 
   											}
 				});
/////////////
		$.ajax({
   					type: "POST",
   					url: "ajax2.php",
   					data: "PartNo="+pg,
   					success: function(s_no){
    											$("select#QuranSuraNo option[selected]").removeAttr("selected");
												$("select#QuranSuraNo option[value="+s_no+"]").attr("selected", "selected");
											///////////
						        
 											}
 			});
///////	
		$.getJSON(
			"ajax3.php?ShowByPartNo=1&page="+pg, function(j){
      		var options = '';
      		for (var i = 0; i < j.length; i++) {
        	options += '<option value="' + j[i].optionValue + '" ' + j[i].selected + '="' + j[i].selected + '">' + j[i].optionDisplay + '</option>';
      											}
      				$("select#QuranVerseNo").html(options);
    });
////////

})
////////////////
 });




