<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Dd_music.aspx.cs" Inherits="HteamDd.Web.Web.Dd_music" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>分享音乐|海客轻微博</title>
    <meta content="IE=EmulateIE7" http-equiv="X-UA-Compatible" />
    <meta http-equiv="Content-Type" content="text/html;charset=gb2312" />
    <link href="/css/opration.css" rel="stylesheet" type="text/css" />
    <script src="/jscript/jquery-1.4.2.js" type="text/javascript"></script>
    <script src="/jscript/Dd_image_deal.js" type="text/javascript"></script>
    <!--编辑器代码-开始 -->
    <script src="/kindeditor/kindeditor.js" type="text/javascript"></script>
    <script type="text/javascript">
        KE.show({
            id: 'pb-text-textarea',
            imageUploadJson: '/kindeditor/plugins/upload_json.ashx',
            fileManagerJson: '/kindeditor/plugins/file_manager_json.ashx',
            allowFileManager: true,
            width: "100%", //编辑器的宽度为70%  
            height: "353px", //编辑器的高度为100px    
            filterMode: false, //不会过滤HTML代码  
            resizeMode: 0 //2或1或0，2时可以拖动改变宽度和高度，1时只能改变高度，0时不能拖动。
        });

        //歌曲搜索、试听
        $(document).ready(function () {
            $("#searchclick").click(function () {
                var musicname = document.getElementById("pb-text-title").value;
                var musicname2 = document.getElementById("pb-text-title2").value;
                var searchbtn = document.getElementById("searchclick");
                var pbflashdiv = document.getElementById("deletediv");
                if (musicname != "") {
                    if (!pbflashdiv.hasChildNodes()) {
                        var creat = document.createElement("application/x-shockwave-flash"); //创建播放器元素
                        creat.innerHTML = "<embed wmode='transparent' id='musicflash' name='' style='width: 405px; height: 100px; margin: 0 auto;padding: 0px;' name='musicflash' type='application/x-shockwave-flash' src='http://" + "box.baidu.com/widget/flash/mbsong.swf?name=" + musicname + "&artist=" + musicname2 + "&extra='></embed>";
                        $("#deletediv").append(creat); //将播放器元素添加到DIV中。
                    }
                    else {
                        $("#deletediv").children().remove();
                        var creat = document.createElement("application/x-shockwave-flash");
                        creat.innerHTML = "<embed wmode='transparent' id='musicflash' style='width: 405px; height: 100px; margin: 0 auto;padding: 0px;' name='musicflash' type='application/x-shockwave-flash' src='http://" + "box.baidu.com/widget/flash/mbsong.swf?name=" + musicname + "&artist=" + musicname2 + "&extra='></embed>";
                        $("#deletediv").append(creat);
                    }
                }
                else if (musicname == "" || musicname2 == "") {
                    alert("为了准确快速搜索，请正确输入:歌曲或歌手名");
                }
              
            });

        });

        $(document).ready(function () {
            $("#post-tag-input").focusin(function () {
                if ($(this).val() == "为您的音乐添加一个标签吧！") {
                    $(this).val("");
                }               
            }).focusout(function () {
                if ($(this).val() == "") {
                    $(this).val("为您的音乐添加一个标签吧！");
                }             
            });
        });
 
        function check() {
            var cookie_info = '<%=user_Mes%>';
            var musicurl = "http://box.baidu.com/widget/flash/mbsong.swf?name=" + $("#pb-text-title").val();
            if (cookie_info != "") {
                user = cookie_info.split(',');
                var userid = user[0];
            }

            if ($("#pb-text-title").val() != "" && $("#pb-text-title2").val() != "") {
                $.ajax({
                    type: "POST",
                    url: "/ashx/Dd_music.ashx",
                    data: "UserID=" + userid + "&Music_Address=" + musicurl + "&artist=" + $("#pb-text-title2").val() + "&Music_Description=" + $("#pb-text-textarea").val() + "&Music_Tag=" + $("#post-tag-input").val() + "&Music_Originld=" + userid,
                    success: function () {
                        window.location.href = "/Default.aspx";
                    }
                })
            }
            else if ($("#pb-text-title").val() == "") {
                alert("为了准确搜索您想要的歌曲，建议正确填写歌曲名！！");
            }
            else if ($("#pb-text-title2").val() == "") {
                alert("为了准确搜索您想要的歌曲，建议正确填写歌手名！！");
            }
            else if ($("#post-tag-input").val() == "为您的音乐添加一个标签吧！") {
                $("#post-tag-input").val("");
            }
             
            
            
            
            
            //            if (document.getElementById("pb-text-title").value.replace(/(^\s*)|(\s*$)/g, "") == "") {
            //                alert("请选择一首歌~~~");
            //                return false;
            //            }

            //    + "&artist=" + $("#pb-text-title2").val() + "&extra="

            //            if (document.getElementById("post-tag-input").value.replace(/(^\s*)|(\s*$)/g, "") == "") {
            //                alert("给音乐添加个标签吧~");
            //                return false;
            //            }

        }

    </script>
    <script type="text/javascript">
        // <!-- 编辑器代码结束 -->

//        function lable_check() {
//            document.getElementById("post-tag-list").style.display = "none";
//        }

        // var jq = jQuery.noConflict();
        $(function () {
            var cookie_info ='<%=user_Mes%>';
            if (cookie_info != "") {
                user = cookie_info.split(',');
                blogname.innerHTML = user[1];
               // img_user(user[0], "1"); //处理个人图片问题
            }

        });

    </script>
    <style type="text/css">
        ul#nav-blog-list li.active a, ul#nav-blog-list li
        {
            background: url("/images/header_$2174.png") no-repeat scroll -238px 39px transparent;
        }
        
        ul#nav-blog-list .nav-blog-name
        {
            color: #ffffff;
            font-size: 18px;
            line-height: 50px;
        }
        ul#nav li.active a.nav-item
        {
            color: #A3B2BE;
        }
        ul#nav li a.nav-item:hover
        {
            background: url("/images/header_$2174.png") no-repeat scroll center 39px transparent;
            color: #FFFFFF;
        }
        .pb-btn-search
        {
            height: 48px;
            background-color: #2D9DDE;
            color: #FFF;
            font-size: 25px;
            width: 140px;
            font-weight: bold;
        }
    </style>
</head>
<body>
    <div id="wrap">
        <div id="header" class="clearfix">
            <div id="logo">
                <a href="/Default.aspx">海客网</a>
            </div>
            <ul id="nav">
                <li id="nav-index" class="active"><a class="nav-item" href="/Default.aspx">首页</a> <a
                    id="new-feed-count" class="header-pop-notice" style="display: none"></a></li>
                <li><a id="nav-explore" class="nav-item" href="/Web/Dd_discover/Dd_FerverTag.aspx">发现</a>
                </li>
            </ul>
            <ul id="sub-nav">
                <li><a href="/Dd_login.aspx" id="uer_Exit">退出</a> </li>
                <li><a href="/Web/Dd_setting.aspx">设置</a> </li>
                <li><a href="/Web/Dd_Intro_Master/Dd_aboutme.aspx">关于</a> </li>
                <%-- <li>
                <a href="#">手机</a>
            </li>
            <li>
                <a href="#">邀请</a>
            </li>--%>
            </ul>
            <ul id="nav-blog-list" class="clearfix">
                <li id="nav-blog-8500453"><a href="/Web/Dd_private_index.aspx"><span class="nav-blog-avatar">
                    <img width="20" height="20" id="img_personal" src="/images/avatar_30_30.$1095.png"
                        alt="" />
                </span><span class="nav-blog-name" id="blogname"></span></a></li>
            </ul>
        </div>
        <div id="content-holder">
            <form id="Form1" action="/ashx/Dd_music.ashx" method="get" runat="server" onsubmit="return oncheck()">
            <div id="content" style="background-image: url('/images/publisher_content_$1349.png');
                background-repeat: repeat-y;">
                <div id="pb-main">
                    <h2 id="pb-main-title">
                        分享音乐</h2>
                    <div id="pb-post-area">
                        <div class="pb-post-section" id="pb-text-title-holder">
                            <h3 class="pb-section-title">
                                为了准确为您搜索想要的歌曲——<span><br />
                                    <br />
                                    请正确输入歌曲名:</span><span style="margin: 150px;">请正确输入歌手名:</span></h3>
                            <div id="pb-audio-search-tip" class="pb-input-tip ">
                            </div>
                            <input tabindex="1" class="pb-input-text" name="musicstr1" id="pb-text-title" type="text"
                                style="width: 200px;" />
                            <input tabindex="1" class="pb-input-text" name="musicstr2" id="pb-text-title2" type="text"
                                style="width: 200px;" />
                            <input type="button" class="pb-btn-search" id="searchclick" value="海客试听" />
                        </div>
                        <div id="pb-audio-player" style="margin: 0px; padding: 0px; display: block;">
                            <div class="pb-music-preview-flash" id="pb-flash-div" style="margin: 0px; padding: 0px;">
                                <div id="deletediv">
                                </div>
                            </div>
                        </div>
                        <div class="pb-post-section" id="pb-text-post-holder">
                            <h3 class="pb-section-title">
                                描述<span>(可不填)</span></h3>
                            <textarea class="pb-input-text" id="pb-text-textarea" cols="" rows="" name="musicdescription"></textarea>
                        </div>
                    </div>
                    <div id="pb-action-holder">
                        <a id="pb-submit" class="blue-button" onclick="return check()">发布</a> <a id="pb-preview"
                            class="gray-button">预览</a>
                        <div style="display: none">
                            <a id="pb-draft" class="gray-button">保存草稿</a>
                        </div>
                        <a id="pb-cancel" class="gray-button">取消</a> <span style="display: none;" id="pb-submiting-tip">
                            正在保存...</span>
                    </div>
                </div>
                <div id="pb-aside">
                    <div class="aside-item" id="post-to-holder">
                        <label for="post-to-select" style="color: #666666;">
                            发布至</label>
                        <select id="post-to-select" name="D1" style="color: #666666;">
                            <option value="langzi88">超级管理员</option>
                        </select>
                    </div>
                    <hr class="separator" />
                    <div class="aside-item" id="post-privacy-holder">
                        <select id="post-privacy-select" style="color: #666666;">
                            <option value="0" selected="selected">立即发布</option>
                            <option value="draft">保存到草稿</option>
                            <option value="queue">加入到自动发布列表</option>
                            <option value="2">仅自己可见</option>
                        </select>
                    </div>
                    <hr class="separator" />
                    <div class="aside-item" id="post-tag-holder">
                        <div id="post-tag">
                            <%--<ul class="clearfix" id="post-tag-list">
                                <li>添加标签，用逗号分隔</li>
                            </ul>--%>
                            <div id="post-tag-input-holder">
                                <%--<input type="text" id="post-tag-input" name="musictag" />--%>
                                <textarea id="post-tag-input" name="musictag" style="color: #666666; height: 100px;">为您的音乐添加一个标签吧！</textarea>
                            </div>
                        </div>
                    </div>
                    <div style="display: none;" class="aside-item" id="recommand-tag-holder">
                        <h4>
                            常用标签</h4>
                        <ul class="clearfix" id="recommand-tag-list">
                        </ul>
                    </div>
                    <hr class="separator" />
                    <div class="aside-item pb-side-opt" id="top-post-holder">
                        <label>
                            <input type="checkbox" id="pb-top-post" />文章置顶</label>
                        <p id="top-post-tip">
                            每个博客只能置顶一篇文章</p>
                    </div>
                    <hr id="pb-sync-sep" class="separator" style="display: none;" />
                </div>
            </div>
            </form>
        </div>
    </div>
</body>
</html>
