//Page Drag
jQuery(function($){
	$('.drag').drag(function( ev, dd ){
		$( this ).css({
			top: dd.offsetY,
			left: dd.offsetX
		});
	},{ not:'map' });
});

//Audio Controls
	function aud_play_pause(e, id) {  
		var audio = $("#myAudio").get(0);
		//$("#myAudio").attr("src", e)[0];
		$(audio).bind('timeupdate', function() {
  			if(audio.duration < audio.currentTime) {
  				$("#"+id).attr("src", "../images/icon/play.png");
  				audio.pause();
  			}
		});
		
		if (audio.paused) {
			$("#myAudio").attr("src", e)[0];
			$("#"+id).attr("src", "../images/icon/pause.png");
			audio.play();
			
		} else {
			$("#"+id).attr("src", "../images/icon/play.png");
			audio.pause();  
		}
		//audio.play();
	}
	
	
	function aud_play_pause2(e, id) {  
		var audio = $("#myAudio").get(0);
		//$("#myAudio").attr("src", e)[0];
		$(audio).bind('timeupdate', function() {
  			if(audio.duration < audio.currentTime) {
  				$("#"+id).attr("src", "../images/icon/play_s.png");
  				audio.pause();
  			}
		});
		
		if (audio.paused) {
			$("#myAudio").attr("src", e)[0];
			$("#"+id).attr("src", "../images/icon/pause_s.png");
			audio.play();
			
		} else {
			$("#"+id).attr("src", "../images/icon/play_s.png");
			audio.pause();  
		}
		//audio.play();
	}

//View Answer Key
	function viewanswer(id) {  
		$("."+id).toggle();
	}
	
// Hide Answer Key
	function hideanswer(id) {  
		$("."+id).hide();
	}
	
