﻿

var beautyListArr = null;

var beautyClock = {
    historyPhotoList: new Array(), //历史照片
    cur_pcb_id: null, //当前用户编号
    cur_pcp_id: null, //当前照片编号
    curUserName: null, //当前用户名
    curNickName: null, //当前昵称
    curPhotoPath: null, //当前照片路径
    curWishCode: null, //当前心情ID
    curWish: null, //当前心情
    curPhotoObj: new Array(), //当前照片数组
    isNullArr: true, //数组是否为空
    commentTempTxt: null, //评论内容
    commentIntTime: 0, //评论间隔时间
    commentFirst: 0, //第一次评论
    /**************************************************
    * *功能描述：取得照片信息
    **************************************************/
    timer1: null, //循环执行时间
    curPopNum: 0, //人气值
    loopNum: 0, //循环次数
    prestrainSource: null, //预加载对像

    getPhotoInfo: function() {

        beautyClock.commentTempTxt = null;
        beautyClock.commentIntTime = 0;
        beautyClock.commentFirst = 0;
        $("#div_showPhoto").html("<img id='loadimg' src=\"http://css.sodao.com/girltime/img/loading1.gif\"/>");
        if (beautyClock.prestrainSource != null && beautyClock.prestrainSource != '' && beautyClock.prestrainSource != undefined) {
            beautyClock.showPhotoInfo(beautyClock.prestrainSource);

        }
        else {
            window.setTimeout(
        $.get('/showtime/gt', { pcs_id: pcs_id, rnd: Math.random() }, function(data) {
            if (data != "[]") {
                beautyClock.showPhotoInfo(data);
            }
        }), 1000);

        }





    },
    showPhotoInfo: function(data) {
        window.clearTimeout(beautyClock.timer1);
        beautyClock.prestrainSource = null;
        var json = eval(data);
        if (json.length != 0) {

            var pcb_id = json[0].pcb_id;
            beautyClock.cur_pcb_id = pcb_id;
            var pcs_name = json[0].pcs_name;
            beautyClock.cur_pcb_id = pcb_id;
            var pcp_id = json[0].pcp_id;
            beautyClock.cur_pcp_id = pcp_id;
            var showTime = json[0].showTime;
            var path = $("#nextLoadImg").attr("src");
            if (path == null || path == "")
                path = json[0].path;
            var path_s = json[0].path_s;
            var headimg = json[0].headimg;
            var nickName = json[0].nickName;
            beautyClock.curNickName = nickName;
            var userName = json[0].userName;
            beautyClock.curUserName = userName;
            var wish = json[0].wish;
            beautyClock.curWishCode = json[0].wishCode;
            beautyClock.curWish = wish;
            var birthday = json[0].birthday;
            var birthplace = json[0].birthplace;
            var height = json[0].height;
            var job = json[0].job;
            var hobby = json[0].hobby;
            //var blood = json[0].blood;
            var constellation = json[0].constellation;
            var takeAddress = json[0].takeAddress;
            var takeCity = json[0].takeCity;
            var companyname = json[0].companyname;
            var companycode = json[0].companycode;
            var companyurl = json[0].companyurl;
            var building = json[0].building;
            var md5Me = json[0].md5Me;
            var md5UserName = json[0].md5UserName;
            var isOL = json[0].isOL;
            var dt = json[0].dt;
            var age = json[0].age;
            //   alert(md5Me + ":" + md5UserName);

            beautyClock.curPhotoObj = { "pcp_id": pcp_id, "pcb_id": pcb_id, "path": path, "path_s": path_s, "userName": userName, "nickName": nickName, "showTime": showTime, age: age, job: job };


            $("#div_showPhoto").html("<img src=\"" + path + "\" id=\"photoShow\" />");
            if (userName != "" && userName != null) {
                //取得个人动态
                beautyClock.GetOneFeed(userName);
                //取得人气数
                beautyClock.getPersonNum(pcb_id);
                $("#str_nickName").html("<a href='http://www.sodao.com/u/" + userName + "/user/covershow' target='_blank'>" + nickName + "</a>");
            }
            else {
                $("#span_friendNum").html(0);
                $("#span_giftNum").html(0);
                $("#dd_beautyFeedList").html("<li>这家伙好懒，什么也没有留下！</li>");

                $("#str_nickName").html("<a href='/showtime/show?id=" + pcb_id + "' target='_blank'>" + nickName + "</a>");
            }
            if (isOL == "true") {
                $("#img_online").show();
            }
            else {
                $("#img_online").hide();
            }
            $("#div_showInfo").click(function() { $("#div_info").show(); $("#h_showInfo").addClass("on") });
            $('#div_info').mouseleave(function() {
                $("#div_info").hide("slow"); $("#h_showInfo").removeClass("on");
            });

            var info = "";
            info += "<li><span>出生日期</span>：" + birthday + "</li>";
            info += "<li><span>出生地</span>：" + birthplace + "</li>";
            info += "<li><span>身高</span>：" + (height == 0 ? "保密" : height + "cm") + "</li>";
            info += "<li><span>职业</span>：" + job + "</li>";
            info += "<li><span>星座</span>：" + constellation + "</li>";
            info += "<li><span>兴趣</span>：" + hobby + "</li>";
            if (pcs_id == 4) {
                info += "<li title='" + building + "'><span>办公楼</span>：" + building + "</li>";
                if (companyurl != "" && companyurl != null)
                    info += "<li title='" + companyname + "'><span>公司</span>：<a href='" + companyurl + "' target='_blank'>" + companyname + "</a></li>";
                else
                    info += "<li title='" + companyname + "'><span>公司</span>：" + companyname + "</li>";
            }

            else {
                info += "<li class=\"photo-space\"><span>拍摄地点</span>：" + takeCity + " " + takeAddress + "</li>";
            }

            $("#u_info").html(info);
            $("#img_head").attr("src", headimg);



            if (userName != "" && userName != null) {
                $("#goToAlbum").attr("href", "http://www.sodao.com/u/" + userName + "/album/list").attr("target", "_blank");
                $("#goToSpace").attr("href", "http://www.sodao.com/u/" + userName + "/user/covershow").attr("target", "_blank");
                $("#a_head").attr("href", "http://www.sodao.com/u/" + userName + "/user/covershow").attr("target", "_blank");
                $("#span_message").show();
                $("#span_photo").show();
                $("#a_friend").show();

            }
            else {
                $("#span_message").hide();
                $("#span_photo").hide();
                $("#a_friend").hide();
                $("#goToSpace").attr("href", "/showtime/show?id=" + pcb_id + "").attr("target", "_blank");
                $("#a_head").attr("href", "/showtime/show?id=" + pcb_id).attr("target", "_blank");

            }
            var sharetitle = escape("搜道网" + pcs_name + ":" + nickName + "");
            var sharetitle1 = "搜道网" + pcs_name + ":" + nickName + "";
            beautyClock.sharePhoto(path, path_s, sharetitle, sharetitle1);
            setTimeout("beautyClock.doing()", 100);
            if (pcs_id != 5) {
                $("#a_sodao").unbind();
                $("#a_message").unbind();
                $("#a_message1").unbind();
                $("#a_friend").unbind();
                $("#show_gift").unbind();
                if (vistorUser != "" && vistorUser != null) {

                    $("#a_sodao").bind("click", function() {
                        SoDaoShare.SharePicture(vistorUser, sharetitle, "http://www.sodao.com/app/showtime/show?id=" + pcb_id, path, path_s, vistorUser, null);
                    });
                    if (userName != "" && userName != null) {
                        $("#a_message").bind("click", function() { SoDaoMessage.sendMessage(vistorUser, md5Me, userName, md5UserName, "/Utility/CloseCrossSitePop"); return false; });
                        $("#a_message1").bind("click", function() { SoDaoMessage.sendMessage(vistorUser, md5Me, userName, md5UserName, "/Utility/CloseCrossSitePop"); return false; });
                        $("#a_friend").bind("click", function() { FriendRequestAdd.concern(userName, true, null, function() { sDialog.hideLoading(); }); return false; }).addClass("follow");
                        $("#show_gift").bind("click", function() { SoDaoGift.show(userName); return false; });

                    }

                }
                else {

                    $("#a_sodao").bind("click", function() { sDialog.loadIFrame('/user/LoginWindows', '登陆', 442, 348, true); return false; });
                    $("#a_message").bind("click", function() { sDialog.loadIFrame('/user/LoginWindows', '登陆', 442, 348, true); return false; ; return false; });
                    $("#a_message1").bind("click", function() { sDialog.loadIFrame('/user/LoginWindows', '登陆', 442, 348, true); return false; });
                    $("#a_friend").bind("click", function() { sDialog.loadIFrame('/user/LoginWindows', '登陆', 442, 348, true); return false; });
                    $("#show_gift").bind("click", function() { sDialog.loadIFrame('/user/LoginWindows', '登陆', 442, 348, true); return false; });
                }
            }
            if (pcs_id == 5) {
                $("#inp_message").unbind();
                $("#inp_space").unbind();
                $("#inp_album").unbind();
                if (vistorUser != "" && vistorUser != null) {
                    if (userName != "" && userName != null) {
                        $("#inp_message").bind("click", function() { SoDaoMessage.sendMessage(vistorUser, md5Me, userName, md5UserName, "/Utility/CloseCrossSitePop"); return false; });
                    }
                }
                else {
                    $("#inp_message").bind("click", function() { sDialog.loadIFrame('/user/LoginWindows', '登陆', 442, 348, true); return false; ; return false; });
                }
                var url = "";
                if (userName != "" && userName != null) {
                    url = "http://www.sodao.com/u/" + userName;
                    $("#inp_space").bind("click", function() { goTo(url + "/user/covershow"); return false; });
                    $("#inp_album").bind("click", function() { goTo(url + "/album/list"); return false; });

                }
                else {
                    url = "/showtime/show?id=" + pcb_id;
                    $("#inp_message").bind("click", function() { goTo(url); return false; });
                    $("#inp_space").bind("click", function() { goTo(url); return false; });
                    $("#inp_album").bind("click", function() { goTo(url); return false; });
                }

                getCorpInfo(companycode);
                if (companyurl != "" && companyurl != null)
                    $("#h_companyName").html("<a href='" + companyurl + "' target='_blank'>" + companyname + "</a>");
                else
                    $("#h_companyName").html(companyname);
            }
            else if (pcs_id == 3) {
                if (userName != "" && userName != null) {
                    $("#a_addboy").attr("href", "http://www.sodao.com/u/" + userName + "/user/covershow");
                }

            }

            $("#nextLoadImg").attr("src", "");
            //预加载
            $.get('/showtime/gt1', { pcs_id: pcs_id, rnd: Math.random() }, function(data1) {
                if (data1 != "[]") {
                    beautyClock.prestrainSource = data1;
                    var json2 = eval(data1);
                    $("#nextLoadImg").attr("src", json2[0].path);
                }
            });





        }
    },
    /**************************************************
    * *功能描述：分享
    **************************************************/
    sharePhoto: function(path, path_s, sharetitle, sharetitle1) {
        path = "http://www.sodao.com/app/showtime/girl";
        $("#a_kaixin").attr("href", "http://www.kaixin001.com/repaste/share.php?rurl=" + path + "&rcontent=" + path + "&rtitle=" + sharetitle + "");
        $("#a_renren").attr("href", "http://share.renren.com/share/buttonshare.do?link=" + path + "&title=" + sharetitle);
        $("#a_qq").attr("href", "http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=" + path + "");
        $("#a_baisohu").attr("href", "http://bai.sohu.com/appLogin.jsp?border=1&bru=/share/blank/add.do?link=" + path + "");
        $("#a_douban").attr("href", "http://www.douban.com/recommend/?url=" + path + "&title=" + sharetitle1 + "");
        $("#a_sina").attr("href", "http://v.t.sina.com.cn/share/share.php?c=spr_web_bd_youku_weibo&url=" + path + "&title=" + sharetitle1 + "&source=" + sharetitle1 + "&sourceUrl=http://www.sodao.com/&content=utf8&pic=" + path_s + "");
    },
    /**************************************************
    * *功能描述：10秒执行一次
    **************************************************/
    doing: function() {
        beautyClock.getComment();
        window.clearTimeout(beautyClock.timer1);
        beautyClock.timer1 = setTimeout("beautyClock.doing()", 10000);
    },
    /**************************************************
    * *功能描述：添加日志
    **************************************************/
    addLog: function(pcb_showTime, pcvl_type, pcb_code, pcb_userName, pcb_nickName, pcb_path) {
        $.get('/ajax/addLog.ashx', { pcb_showTime: pcb_showTime, pcvl_type: pcvl_type, pcvl_pageUrl: window.location.href, pcb_code: pcb_code, pcb_userName: pcb_userName, pcb_nickName: pcb_nickName, pcb_path: pcb_path, rnd: Math.random() }, function(data) {

        });

    },
    /**************************************************
    * *功能描述：取得心情
    **************************************************/
    getNewWish: function() {
        $.get('/showtime/GetNewOneWordBlog', { userName: beautyClock.curUserName, rnd: Math.random() }, function(data) {
            var json = eval(data);
            if (json.length > 0) {
                beautyClock.curWish = json[0].content;
                beautyClock.curWishCode = json[0].wishCode;
                $("#p_wish").html(beautyClock.curWish);
            }


        });
    },
    GetOneFeed: function(userName) {

        $.get('/showtime/GetOneFeed', { userName: userName, rnd: Math.random() }, function(data) {

            $("#dd_beautyFeedList").html(data);

        });

    },
    /**************************************************
    * *功能描述：取得相关数目
    **************************************************/
    getPersonNum: function(pcb_id) {
        $.get('/showtime/GetPersonNum', { pcb_id: pcb_id, rnd: Math.random() }, function(data) {
            var json = eval(data);
            if (json.length > 0) {
                // $("#popNum").html(parseInt(json[0].popnum));
                $("#span_friendNum").html(parseInt(json[0].friendnum) + parseInt(json[0].attentionnum));
                $("#span_giftNum").html(parseInt(json[0].giftnum));

            }



        });
    },
    /**************************************************
    * *功能描述：加载美女
    **************************************************/
    getHisBeauty: function() {
        var url = "/showtime/GetTopLeastList?pcs_id=" + pcs_id + "&rnd=" + Math.random();
        $.ajax(
            {
                type: "get",
                url: url,
                async: false,
                success: function(data) {
                    var json = eval(data);
                    beautyClock.historyPhotoList = new Array();
                    for (var i = 0; i < json.length; i++) {
                        var arr = json[i];
                        beautyClock.historyPhotoList.push(arr);
                    }
                    beautyListArr = beautyClock.historyPhotoList;
                    beautyClock.showHisBeauty();
                }
            });

    },
    /**************************************************
    * *功能描述：显示历史美女
    **************************************************/
    showHisBeauty: function() {


        var str = "";
        var len = beautyClock.historyPhotoList.length;
        beautyClock.loopNum++;
        if (beautyClock.loopNum > 1) {
            $("#ul_leastPhotoList").html("系统繁忙,正在载入");
            return;
        }
        if (len < 1 && beautyClock.isNullArr) {

            beautyClock.getHisBeauty();

            beautyClock.isNullArr = false;
        }
        else {
            beautyClock.loopNum = 0;

            for (var i = 0; i < len; i++) {
                str += "<li rel='setliClass'>";
                var userName = beautyClock.historyPhotoList[i].userName;
                if (userName != "" && userName != null) {
                    str += "<a href='" + beautyClock.historyPhotoList[i].path + "' rel='group' title='" + beautyClock.historyPhotoList[i].nickName + "$" + beautyClock.historyPhotoList[i].pcb_id + "$" + beautyClock.historyPhotoList[i].userName + "$" + beautyClock.historyPhotoList[i].job + "$" + beautyClock.historyPhotoList[i].age + "' class='lightsGal'>";
                    str += "<img src=\"" + beautyClock.historyPhotoList[i].path_s + "\" alt='" + beautyClock.historyPhotoList[i].nickName + "' width=\"43\" height=\"28\" /></a>";

                }
                else {
                    str += "<a href='" + beautyClock.historyPhotoList[i].path + "' rel='group' title='" + beautyClock.historyPhotoList[i].nickName + "$" + beautyClock.historyPhotoList[i].pcb_id + "$" + beautyClock.historyPhotoList[i].userName + "$" + beautyClock.historyPhotoList[i].job + "$" + beautyClock.historyPhotoList[i].age + "' class='lightsGal'>";
                    str += "<img src=\"" + beautyClock.historyPhotoList[i].path_s + "\" alt='" + beautyClock.historyPhotoList[i].nickName + "'  width=\"43\" height=\"28\"  /></a>";


                }
                str += "</li>";

            }
            $("#ul_leastPhotoList").html(str);


            $(".lightsGal").fancybox({
                'transitionIn': 'elastic',
                'transitionOut': 'elastic',
                'titlePosition': 'over',
                'titleFormat': this.title,
                'cyclic': true

            });
            $("li[rel^='setliClass']").each(function() {
                $(this).mousemove(
            function() {
                $(this).addClass("on");
            }
            ).mouseout(
            function() {
                $(this).removeClass("on");
            }
            );
            });


        }



    },
    /**************************************************
    * *功能描述：加载评论
    **************************************************/
    getComment: function() {
        $.get('/showtime/GetComment', { pcs_id: pcs_id, rnd: Math.random() }, function(data) {
            $("#div_comment").html(data);


        });

    },
    fireComment: function() {
        var txt = $("#commentInput").val().trim();
        if (vistorUser == "" || vistorUser == null) {
            sDialog.loadIFrame("/user/LoginWindows", "登陆", 442, 348, true);
        }
        else {
            txt = txt.replace("请登录后评论", " ");
            $("#commentInput").val(txt);
        }

    },
    /**************************************************
    * *功能描述：添加评论
    **************************************************/
    addComment: function() {
        if (vistorUser == "" || vistorUser == null) {
            sDialog.loadIFrame("/user/LoginWindows", "登陆", 442, 348, true);
        }
        else {
            var txt = $("#commentInput").val().trim();
            if (txt == "请登录后评论") {
                return sDialog.activeMsg('commentInput', '请输入评论内容', 'T', 100, 2000, 'fade');

            }

            txt = escapeHTML(txt);
            var len = txt.len();
            var isComment = true;
            if (len == 0) {
                return sDialog.activeMsg('commentInput', ' 请输入评论内容', 'T', 100, 2000, 'fade');

            }
            else if (len > 70) {
                return sDialog.activeMsg('commentInput', '请输入少于70个字的评论内容', 'T', 200, 2000, 'fade');

            }
            else {

                if (beautyClock.commentFirst != 0) {

                    if (beautyClock.commentTempTxt == txt) {
                        sDialog.activeMsg('commentInput', '请不要重复评论', 'T', 100, 2000, 'fade');

                        isComment = false;
                        return;
                    }
                    if (beautyClock.commentIntTime < 5) {
                        isComment = false;
                        return sDialog.activeMsg('commentInput', ' 您评论速度太快了，请慢些', 'T', 200, 2000, 'fade');
                    }

                }
                if (isComment) {

                    beautyClock.commentFirst = 1;
                    isComment = false;
                    beautyClock.commentTempTxt = txt;
                    beautyClock.commentIntTime = 0;

                    $.get('/showtime/addComment', { pcb_id: beautyClock.cur_pcb_id, userName: beautyClock.curUserName, nickName: escapeHTML(beautyClock.curNickName), pcs_id: pcs_id, comment: escape(txt), rnd: Math.random() }, function(data) {
                        if (data != 0) {
                            $("#div_comment").scrollTop(0);
                            beautyClock.getComment();

                        }
                    });

                }

                $("#commentInput").val("");
                $("#commentInput").focus();

            }
        }

    },

    /**************************************************
    * *功能描述：回车提交评论
    **************************************************/
    keyAddComment: function(event) {

        var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
        if (event.ctrlKey && keyCode == 13) {
            beautyClock.addComment();
        }

    },
    /**************************************************
    * *功能描述：加载合作单位
    **************************************************/
    getCoo: function() {

        $.get('/ajax/getFriendlyLink.ashx', { isCoo: 1, isIndex: 1, rnd: Math.random() }, function(data) {

            var json = eval(data);
            var str = "";
            for (var i = 0; i < json.length; i++) {
                str += "<a href=\"" + json[i].fl_siteUrl + "\" target=\"_blank\">" + json[i].fl_siteName + "</a>"

            }
            $("#pcoo").html(str);


        });

    }

};
/**************************************************
* *功能描述：显示美女动态
**************************************************/
function getBeautyFeed() {
    /*
    $.get('/showtime/GetBeautyFeed', { rnd: Math.random() }, function(data) {

        $("#dd_beautyFeedList").html(data);

    });
    */

}
/**************************************************
* *功能描述：过滤出生地
**************************************************/
function getBirthPlace(barthplace) {
    if (barthplace != "" && barthplace != null)
        if (barthplace.indexOf(';') > -1) {
        var arr = barthplace.split(';');
        return arr[0];
    }
    return "";

}
/**************************************************
* *功能描述：显示列表
**************************************************/
function showList(tag) {
    if (tag == 1) {
        $("#a_album").addClass("on");
        $("#a_feed").removeClass("on");
        $("#div_beautyPhotoList").show();
        $("#div_beautyFeed").hide();

    }
    else {
        getBeautyFeed();
        $("#a_album").removeClass("on");
        $("#a_feed").addClass("on");
        $("#div_beautyPhotoList").hide();
        $("#div_beautyFeed").show();
    }
}
/**************************************************
* *功能描述：送礼后添加评论
**************************************************/
function giftAddComment(toUserName, txt) {
    //    $.get('/showtime/addComment', { userName: toUserName, comment: escape(txt), rnd: Math.random() }, function(data) {
    //        if (data != 0)
    //            beautyClock.getComment();
    //    });

    $.get('/showtime/addComment', { pcb_id: beautyClock.cur_pcb_id, userName: beautyClock.curUserName, nickName: escapeHTML(beautyClock.curNickName), pcs_id: pcs_id, comment: escape(txt), rnd: Math.random() }, function(data) {
        if (data != 0)
            beautyClock.getComment();
    });
}
/**************************************************
* *功能描述：活动列表
**************************************************/
function getActList() {
    $.get('/showtime/GetActList', { rnd: Math.random() }, function(data) {
        $("#u_actList").html(data);
    });
}
/**************************************************
* *功能描述：周人气榜列表
**************************************************/
function getWeekList() {
    $.get('/showtime/GetWeekList', { rnd: Math.random() }, function(data) {
        $("#u_weeklist").html(data);
    });
}
/**************************************************
* *功能描述：美女相册
**************************************************/
function getAlbumList() {
    $.get('/showtime/GetPhotoList', { rnd: Math.random() }, function(data) {
        $("#ul_beautyPhotoList").html(data);
    });
}
/**************************************************
* *功能描述：加载系列
**************************************************/
function getSeriesList() {
    $.getJSON('/showtime/GetSeriesList', { rnd: Math.random() }, function(json) {
        var str = "";
        for (var i = 0; i < json.length; i++) {
            str += "<li>";
            str += "<a href='" + json[i]._pcs_url + "' target=\"_blank\"><img src=\"" + json[i]._pcs_photourl + "\" width=\"84\" height=\"84\" /></a>";
            str += "<span><a href='" + json[i]._pcs_url + "' target=\"_blank\">" + json[i]._pcs_name + "</a></span>";
            str += "</li>";

        }

        $("#ul_seriesList").html(str);

    });

}
function getOLList() {
    $.get('/showtime/getol', { rnd: Math.random() }, function(data) {
        $("#ul_onlineList").html(data);

    });

}
function goTo24H(pcs_id) {

    var url = "h24List";
    var txt = "&gt;&gt;更多美女";
    //    <a href="#" class="more" id="moreBody">&gt;&gt;更多美女</a>
    if (pcs_id == 3) {
        url += "?ser=" + pcs_id;
        txt = "&gt;&gt;更多帅哥";

    }
    else if (pcs_id == 4) {
        url += "?ser=" + pcs_id;
        txt = "&gt;&gt;查看更多";

    }
    else if (pcs_id == 5) {
        url += "?ser=" + pcs_id;
        txt = "&gt;&gt;查看更多";

    }
    else if (pcs_id == 7) {
        url += "?ser=" + pcs_id;
        txt = "&gt;&gt;更多宝宝";

    }
    else {
        url += "?ser=" + pcs_id;
        txt = "&gt;&gt;更多美女";

    }

    $("#goTo24H").attr("href", url).attr("target", "_blank");
    $("#goTo24H").html(txt)
}
/**************************************************
* *功能描述：帮我想几句
**************************************************/
function helpFeeWords() {

    var Arr1 = ["这个MM可以上新闻联播了", "这是真人？我揉揉眼", "o my lady gaga！估计我这被子再也见不到这样的美女了，省着点看", "美女，原谅我，看到照片我决定人肉你", "感谢老天，感谢神仙姐姐让我看到这么美的照片", "自从上次看到你的照片,我的心久久不能平静,震撼啊!", "苍天有眼啊,让我在有生之年得以观得如此倾城之貌", "是你让我的心死灰复燃,是你拯救了我一颗拨凉拨凉的心", "能够在如此精彩的照片下留下自己的网名是多么骄傲的一件事啊", "我有点不敢回复,因为生怕我庸俗不堪的回复玷污这少有的美女", "哇噻！你这个照片连哑巴都能叫'绝！'", "天啊，这还是照片吗？简直是神作", "你是大家公认的美女啊！", "鱼雁俱下 花月含羞",
"嫦娥 你来这里干嘛？", "艳若桃李", "美的很和谐", "有味道！", "恩，长的挺好的！", "有点抽象啦～", "你一定很温柔～", "好惊险啊！", "长的很梦幻", "长的很写意嘛～", "You swept me off my feet", "Yummy", "啧啧，秀色可餐呀", "倾国倾城", "野兽派？", "此刻脑袋嗡嗡响～", "鬼斧神工呀", "真的很提神！", "蛮可爱", "pretty pretty", "这样的美女我灰常喜欢", "国色天香", "哇～你的容貌超出了我的想象", "莔", "美化尚未成功，同志还需努力", "兰心惠质", "You are such a dish", "好惊险", "佩服佩服！", "请打扮的认真一点吧", "What a knock-out!", "半妝美人", "值得关注！", "Tell me your story, I'm all ears", "你很耀眼嘛", "我震惊了", "风华绝代", "出来炸道？", "很美很妖娆", "打听一下~你是怎么上的美女时钟？", "一般一般，世界第三～", "为你彷徨～", "回眸一笑百媚生", "你怎么舍得，让我的鼻血流向海...", "美的由内而外，由皮到骨，连绵不绝呈新意", "你，站在了美丽之巅！", "很大方 很具体", "人间胸器啊", "I only have eyes for you .", "恩～稍微有那么点...", "挺有气质的", "风生水起了", "我拜倒了...", "大家快出来看美女！", "Hello beauty～", "你要小心被劫色呀...", "手如柔荑，肤如凝脂，领如蝤蛴，齿如瓠犀，螓首蛾眉，巧笑倩兮，美目盼兮。", "仿佛兮若轻云之蔽月，飘飘兮若流风之回雪。", "美得象一首抒情诗", "什么时候你都是那么的好看！", "森林系女孩就是你！", "好有范啊～"];
    var Arr2 = ["比萨斜塔是被你倾歪的吧？", "还等什么，进军演艺圈！", "哇，美女是酱紫滴！", "very photogenic", "你是大家公认的可爱多！", "鱼雁俱下 花月含羞", "小新 你来这里干嘛？", "以后不要这么顽皮了", "有味道！", "恩，长的挺好的！", "好像动漫人物啊！", "长的很梦幻", "长的很写意嘛～", "You swept me off my feet", "Yummy", "啧啧，秀色可餐呀", "哈哈 你像一个小纽扣", "野兽派？", "此刻脑袋嗡嗡响～", "真的很提神！", "蛮可爱", "pretty pretty", "这样的小孩我灰常喜欢", "哇～你的容貌超出了我的想象", "莔", "美化尚未成功，童鞋还需努力", "好惊险", "年纪小小 胆子挺大！", "小美人一个", "值得关注！", "你很耀眼嘛", "我震惊了", "打听一下~你是怎么上的宝宝时钟？", "一般一般，世界第三～", "为你彷徨～", "回眸一笑百媚生", "幸好你还小 否则我怕我按耐不住", "很大方 很具体", "小鬼当家", "Hello beauty～", "什么时候你都是那么的可爱！"];
    var Arr3 = ["你怎么舍得 让我的口水流成海？", "还等什么，进军演艺圈！", "哇，原来帅哥是酱紫滴！", "很MAN 恩 真的很MAN", "男人大丈夫 那么害羞做什么", "长的很和谐", "有味道！", "恩，长的挺好的！", "有点抽象啦～", "你一定很温柔～", "身材不错嘛", "好惊险啊！", "长的很写意嘛～", "野兽派？", "此刻脑袋嗡嗡响～", "鼻子真挺", "鬼斧神工呀", "真的很提神！", "我喜欢你的眼神！", "嘴唇好性感！", "蛮可爱", "这样的帅哥我灰常喜欢", "好高啊！", "像个孩子～", "哇～你的容貌超出了我的想象", "不要太潇洒呦！", "美化尚未成功，同志还需努力", "好惊险", "佩服佩服！", "请打扮的认真一点吧", "值得关注！", "Tell me your story, I'm all ears", "你很醒目嘛", "我震惊了", "出来炸道？", "打听一下~你是怎么上的帅哥时钟？", "一般一般，世界第三～", "为你彷徨～", "很大方 很具体", "施瓦辛格？", "I only have eyes for you .", "恩～稍微有那么点...", "风生水起了", "我拜倒了", "大家快出来看帅哥！", "HI~"];
    var Arr4 = ["长的那么美还上什么班呀！", "你一定是公司的红人吧", "这是什么公司，还招人吗？", "还等什么，进军演艺圈！", "男人大丈夫 那么害羞做什么", "长的很和谐", "你们招人标准挺宽的～", "在你们公司上班很爽吧？", "有味道！", "恩，长的挺好的！", "有点抽象啦～", "你一定很温柔～", "身材不错嘛", "好惊险啊！", "长的很写意嘛～", "野兽派？", "此刻脑袋嗡嗡响～", "鼻子真挺", "鬼斧神工呀", "真的很提神！", "我喜欢你的眼神！", "嘴唇好性感！", "蛮可爱", "这样的帅哥我灰常喜欢", "好高啊！", "像个孩子～", "哇～你的容貌超出了我的想象", "不要太潇洒呦！", "美化尚未成功，同志还需努力", "好惊险", "佩服佩服！", "请打扮的认真一点吧", "值得关注！", "我震惊了", "出来炸道？", "一般一般，世界第三～", "为你彷徨～", "很大方 很具体", "I only have eyes for you .", "恩～稍微有那么点...", "风生水起了", "我拜倒了...", "大家快出来看帅哥！", "HI~", "还等什么，进军演艺圈！", "哇，原来美女是酱紫滴！", "very photogenic", "你是大家公认的美女啊！", "鱼雁俱下 花月含羞", "嫦娥 你来这里干嘛？", "艳若桃李", "美的很和谐", "有味道！", "恩，长的挺好的！", "有点抽象啦～", "你一定很温柔～", "好惊险啊！", "长的很梦幻", "长的很写意嘛～", "You swept me off my feet", "Yummy", "啧啧，秀色可餐呀", "倾国倾城", "野兽派？", "此刻脑袋嗡嗡响～", "鬼斧神工呀", "真的很提神！", "蛮可爱", "pretty pretty", "我拜倒了...", "大家快出来看美女！", "Hello beauty～", "你要小心被劫色呀...", "手如柔荑，肤如凝脂，领如蝤蛴，齿如瓠犀，螓首蛾眉，巧笑倩兮，美目盼兮。", "仿佛兮若轻云之蔽月，飘飘兮若流风之回雪。", "美得象一首抒情诗", "什么时候你都是那么的好看！"];
    var txt = "";
    if (pcs_id == 1 || pcs_id == 8 || pcs_id == 9) {
        var n = Math.floor(Math.random() * Arr1.length + 1) - 1;
        txt = Arr1[n];
    }
    else if (pcs_id == 3) {
        var n = Math.floor(Math.random() * Arr3.length + 1) - 1;
        txt = Arr3[n];
    }
    else if (pcs_id == 4 || pcs_id == 5) {
        var n = Math.floor(Math.random() * Arr4.length + 1) - 1;
        txt = Arr4[n];
    }
    else if (pcs_id == 7) {
        var n = Math.floor(Math.random() * Arr2.length + 1) - 1;
        txt = Arr2[n];
    }
    $("#commentInput").val(txt);


}
/**************************************************
* *功能描述：北软
**************************************************/
function getCorpInfo(code) {

    if (code == '') {
        var ccorp = "<li>地址：暂无</li>";
        $("#ul_ccorp").html(ccorp);
        $("#p_cintro").html("暂无");
        $("#a_corpurl1").attr("href", "http://bendi.sodao.com/life");
        $("#a_corpurl2").attr("href", "http://bendi.sodao.com/life");
        $("#h_cname").html("暂无");

    }
    else {
        $.get('/ShowTime/NorthSoftCorp', { code: code, rnd: Math.random() }, function(data) {
            var json = eval(data);
            if (json.length != 0) {
                var fax = json[0].c_fax == "" ? "暂无" : json[0].c_fax;
                var email = json[0].c_email == "" ? "暂无" : json[0].c_email;
                var addr = json[0].c_address == "" ? "暂无" : json[0].c_address;
                var postcode = json[0].c_postcode == "" ? "暂无" : json[0].c_postcode;
                var tel = json[0].c_tel == "" ? "暂无" : json[0].c_tel;
                var ccorp = "<li>地址：" + addr + "</li>";
                ccorp += "<li>邮编：" + postcode + "</li>";
                ccorp += "<li>电话：" + tel + "</li>";
                ccorp += "<li>传真：" + fax + "</li>";
                ccorp += "<li>E_mail：" + email + "</li>";
                $("#ul_ccorp").html(ccorp);
                $("#p_cintro").html(json[0].c_introduction == '' ? "暂无" : json[0].c_introduction);
                if (json[0].c_code != "" && json[0].c_code != null) {
                    $("#a_corpurl1").attr("href", "http://bendi.sodao.com/store/detail?qid=" + json[0].c_code).attr("target", "_blank");
                    $("#a_corpurl2").attr("href", "http://bendi.sodao.com/store/detail?qid=" + json[0].c_code).attr("target", "_blank");
                }
                else {
                    $("#a_corpurl1").attr("href", "return false;");
                    $("#a_corpurl2").attr("href", "return false;");
                }
                $("#h_cname").html(json[0].c_name);
            }
        });
    }
}


var num = 60;
var isFirst = true;
var sec = 0;
function showBeauty() {

    beautyClock.commentIntTime = beautyClock.commentIntTime + 1;
    var ss = $("#em_showTime").html();
    if (ss.length == 2 && ss.substr(0, 1) == 0) {
        ss = ss.substr(1, 1);
    }
    ss = parseInt(ss);
    sec = ss - 1;
    if (sec <= 0)
        sec = 60;
    if (sec >= 0) {
        if (sec < 10)
            msg = "0" + sec;
        else
            msg = sec;
        $("#em_showTime").html(msg);
        if (isFirst) {
            isFirst = false;
            //取得照片信息
            beautyClock.getPhotoInfo();
            //初始化历史美女
            beautyClock.getHisBeauty();


        }
        else {

            if (sec == 60) {
                //加载 历史美女
                var len = beautyClock.historyPhotoList.length;
                var pcp_id = beautyClock.curPhotoObj.pcp_id;
                if (pcp_id != undefined) {
                    if (len == 7) {
                        beautyClock.historyPhotoList.pop();
                    }
                    beautyClock.historyPhotoList.unshift(beautyClock.curPhotoObj);

                    beautyListArr = beautyClock.historyPhotoList;
                }
                beautyClock.getPhotoInfo();
                $.fancybox.close();
                beautyClock.showHisBeauty();
                //加载动态
                getBeautyFeed()

            }


        }


    }
    window.setTimeout("showBeauty()", 1000);

};
$(function() {
    var s = 60 - serverTime;
    if (s < 10) {
        s = "0" + s;
    }
    $("#em_showTime").html(s);
    showBeauty();
    if (pcs_id != 2) {
        //  getBeautyFeed();
        // getWeekList();
        //getActList();
        //getSeriesList();
        // getAlbumList();
        //getOLList();
        $("#show_commentList").bind("click", function() {
            return sDialog.loadIFrame('CommentList?pcs_id=' + pcs_id, '聊天记录', 530, 500, false);

        });

    }
    goTo24H(pcs_id);
    //    $("#commentInput").bind("keypress", function() { beautyClock.keyAddComment() });



});
$(document).keypress(function(e) {
    if (e.ctrlKey && (e.which == 13 || e.which == 10)) {
        beautyClock.addComment()

    } else if (e.shiftKey && (e.which == 13 || e.which == 10)) {
        beautyClock.addComment()
    }
});



