
function mediaPlay(id,src,btn,w,h,classN){
        $(id).jPlayer({
            ready: function () {
                $(this).jPlayer("setMedia", {
                    m4v: src
                });
            },
            swfPath: "jplayer",
            supplied: "m4v",
            cssSelectorAncestor: btn,
            size: {
                width: w,
                height: h,
                cssClass: classN
            },
            useStateClassSkin: true,
            autoBlur: false,
            smoothPlayBar: true,
            keyEnabled: true,
            remainingDuration: true,
            toggleDuration: true
        });
   };
   
    function jplayerp(id,src,btn){
        $(id).jPlayer({
            ready: function (event) {
                $(this).jPlayer("setMedia", {
                    title: "Bubble",
                    mp3: src
                });
            },
            swfPath: "jplayer",
            supplied: "mp3, oga",
            cssSelectorAncestor: btn,
            wmode: "window",
            useStateClassSkin: true,
            autoBlur: false,
            smoothPlayBar: true,
            keyEnabled: true,
            remainingDuration: true,
            toggleDuration: true
        });
    };
    
    $(function(){
        $(".jp-play").click(function(){
            var prCl = $(this).parents(".audioDiv").find(".soundBox");
            $(".soundBox").addClass("soundBoxUn");
            prCl.removeClass("soundBoxUn");
            $(".soundBoxUn .jp-stop").click();
        });
    });

//图片按比例放大缩小
function DrawImage(ImgD, FitWidth, FitHeight) {
    var image = new Image();
    image.src = ImgD.src;
    if (image.width > 0 && image.height > 0) 
    {
        if (image.width / image.height >= FitWidth / FitHeight){
			if (image.width > FitWidth) {
				//ImgD.width = FitWidth;
				ImgD.height = FitHeight;
				var ml = ((image.width * FitHeight) / image.height - FitWidth)/2;
				ImgD.style.marginLeft = -ml + "px";
			}else{
				//ImgD.width = FitWidth;
				ImgD.height = FitHeight;
			}
		}else {
			if (image.height > FitHeight) {
				//ImgD.height = FitHeight;
				ImgD.width = FitWidth;
			}else {
				ImgD.width = FitWidth;
				//ImgD.height = FitHeight;
			}
		}
	}
}


