	var loadingImage = ' <center><img src="images/loading.gif" border="0" /><br/>Loading Data</center>';
	var arrowimg = '<img src="images/arrow.gif" border="0" />';
	var mvbegin = "release";
	function chmvtab(obj){
		var mvclick = obj.title;
		$("#"+mvbegin).empty();
		$("#"+mvclick).empty();
		$("#"+mvclick).append(arrowimg);
		mvbegin = mvclick;
		getUrl(obj);	
	}
	function getUrl(obj){
		var address = obj.href;  
		if( address != "http://none/"){
			
			$("#div_musicvdo").empty();
			$("#div_musicvdo").append(loadingImage);
			
			$.ajax({
				url: address,
				dataType: "html",
				type: "GET",
				cache: false,
				error: function(e){
					$("#div_musicvdo").empty();
					$("#div_musicvdo").append("<B>Application Error</B><br/>Unfortunately a fatal error has been encountered and the script cannot continue.<br/><br/>Please try again.");
					return;
				},
				success: function(data){
					$("#div_musicvdo").empty();
					$("#div_musicvdo").append(data);
					return;
				}
			});
		}else{ return false;}	
	}
	function songrequest(sendtype){
        if( $("#txt_songrequest").val() =="" ){
			alert( " กรอกชื่อเพลงที่จะขอค่ะ " );
		}else{
			var paramdata = $("#requestForm").serialize();
			$("#requestForm").resetForm();
			$.ajax({
				url: "songrequest.php",
				dataType: "html",
				type: "POST",
				cache: false,
				data: paramdata,
				success: function(data){
					alert(data);
					getSongRequest(sendtype);
					return;
				}
			});
		}
	}
	function getSongRequest(sendtype){
		$("#frm_request").attr("src","songrequestlist.php?request=" + sendtype + "&ss_=" + Math.random());
		chimgSongrequest(sendtype);
	}
	function chimgSongrequest(sendtype){
		if(sendtype == "hour"){
			$("#img_hour").attr("src","images/re1_01.gif?ss_=" + Math.random());	
			$("#img_day").attr("src","images/re2_02.gif?ss_=" + Math.random());	
		}else{
			$("#img_hour").attr("src","images/re1_02.gif?ss_=" + Math.random());	
			$("#img_day").attr("src","images/re2_01.gif?ss_=" + Math.random());		
		}
	}
 ddaccordion.init({
	headerclass: "headlink", //Shared CSS class name of headers group
	contentclass: "contentlink", //Shared CSS class name of contents group
	collapseprev: true, //Collapse previous content (so only one open at any time)? true/false 
	defaultexpanded: [1], //index of content(s) open by default [index1, index2, etc]. [] denotes no content.
	animatedefault:  true, //Should contents open by default be animated into view?
	persiststate: false, //persist state of opened contents within browser session?
	toggleclass: ["", "openlink"], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
	togglehtml: ["none", "", ""], //Additional HTML added to the header when it's collapsed and expanded, respectively  ["position", "html1", "html2"] (see docs)
	animatespeed: "slow" //speed of animation: "fast", "normal", or "slow"
})