/* Author: Syed Rasel paglasof@gmail.com
*/

$('document').ready(function(){
	$('#ayat').find("div").removeClass('false');
	$('input[name=arabic]').attr('checked',true);
	$('input[name=bangla]').attr('checked',true);
	$('input[name=english]').attr('checked',true);

	$(".trans").click(function(){
			var id=$(this).attr('id');
			
			if ($('#'+id).attr('checked')) {
				$('#ayat').find("."+id).removeClass('false');
			}else{
				$('#ayat').find("."+id).addClass('false');
			}
			
			if($(".arabic").hasClass('false') && $(".bangla").hasClass('false') && $(".english").hasClass('false'))
			{
				$('#ayat').find("div").removeClass('false');
				$('input[name=arabic]').attr('checked',true);
				$('input[name=bangla]').attr('checked',true);
				$('input[name=english]').attr('checked',true);
				
			}
		
			
	})
	
	$(".suralist").change(function(){
		location.href = $("#suralist option:selected").val();
	});	$('.a').click(function(){		var id=$(this).attr('id');
		$('.a').css({'color':'#004D99'});
		$(this).css({'color':'green'});
		$('html, body').animate({ scrollTop: $("#"+id+"s").offset().top }, 500);
		$('.blink').css({'opacity':0.1});
		$("#"+id+'b').css({'opacity':1});
		setTimeout(function() {$(".blink").animate({"opacity":"1"})} , 500 + 500); // delays 1 sec after the previous one

		});
	
	

});

    var name = "#mymenu";  
   var menuYloc = null;  
  var mactest=navigator.userAgent.indexOf("Mac")!=-1 
   $(document).ready(function(){  
        menuYloc = parseInt($(name).css("top").substring(0,$(name).css("top").indexOf("px")))  
        $(window).scroll(function () {  
            var offset = menuYloc+$(document).scrollTop()+"px";  
            $(name).animate({top:offset},{duration:500,queue:false});  
        });

	if(mactest){
		//$("#mymenu").css({'right':'9%'});
	}
   });  
