﻿N.lastKey="";N.suggestBox=$("#suggest_box");N.kwf=$("#baidu input[name=wd]");N.loadNum=0;N.curAction="";window.onload=function(){loadCurtain()}; $(document).ready(function(){$.ajaxSetup({contentType:"application/json; charset=utf-8",type:"POST",dataType:"json",data:"{}",error:function(){Site.inProcess=false}});loadCurtain=function(){(new PCN.Media.CurtainADs("images/media/tuan.gif",{path:"images/media/tuan.swf",width:"110px",height:"300px"},"http://tuan.p.cn")).init().autoShow(5E3)};var b=curDesktop;curDesktop.charAt(0)=="S"?$.post("default.aspx/ChangeDesktop",$.toStr({isReg:isRegUser,deskStr:curDesktop}),function(c){c=c.d;if(c.Result){$("#desktop_area_"+ curDesktop).html(c.Data);$(".DMItem").attr("style","");$("#"+curDesktop).attr("style","color:#ffffff")}else new rPrompt("\u5bf9\u4e0d\u8d77\uff0c\u684c\u9762\u52a0\u8f7d\u53d1\u751f\u5f02\u5e38\uff01")}):$.post("default.aspx/BindGrids",$.toStr({isReg:isRegUser,deskStr:b,isFirst:isFirst}),function(c){c=c.d;if(c.Result){$("#desktop_area_"+curDesktop).remove();$("#desktop").append(c.Message);Desktop.initLoad(curDesktop)}else new rPrompt("\u5bf9\u4e0d\u8d77\uff0c\u684c\u9762\u52a0\u8f7d\u53d1\u751f\u5f02\u5e38\uff01")}); $.post("default.aspx/GetUmediaList",function(c){c.d.Result&&$("#divMedia").html(c.d.Message)});isRegUser&&$.post("default.aspx/GetUserBG",$.toStr({isReg:isRegUser}),function(c){c.d.Success&&$("body").css("background","url("+c.d.Obj+")")});isRegUser||$(".icon_share").hide();lasttime=(new Date).getTime();N.iconPanel=$("#icon_panel");N.rebateIcon=$("#icon_rebate");if(N.rebateIcon.length===0)N.rebateIcon=$("<div id='icon_rebate'></div>").appendTo("body").click(function(){new rebatePrompt}).mouseleave(function(c){$(c.relatedTarget).is(".iconcontent")|| $(this).hide()});N.qSchResult=$("#qckSchResult");N.qSchResult.container=$("#qckSchResult").find(".container");N.qSchResult.emptyModel=$("#qckSchResult").find(".result");N.qSchResult.locate=function(){var c=$(".Search"),d=c.offset(),e=d.left-(this.width()-c.width());c=d.top+c.height()+1;this.css({left:e,top:c});return this};N.quickSearch=$("#qckSchBox");N.quickSearch.Btn=$("#qckSchBtn");N.quickSearch.Btn.click(function(){N.quickSearch.start()});N.quickSearch.start=function(){var c=$.trim($(this).val()), d=N.qSchResult;if(c==""||c=="\u7f51\u5740\u5feb\u901f\u6dfb\u52a0"){d.is(":visible")&&N.quickSearch.vanish();return false}d.locate().container.html(N.qSchResult.emptyModel).end().show();$.post("default.aspx/GetSearchResult",$.toStr({key:c}),function(e){d.container.html(e.d);d.slideDown(function(){$(document).click(N.quickSearch.vanish);d.click(function(f){f.stopPropagation()})});d.find("li").find("div:first").mousedown(function(){var f=null;if(curDesktop.charAt(0).toLowerCase()=="s"||$("#"+curDesktop).attr("noAdd"))f= "\u5bf9\u4e0d\u8d77\uff0c\u6b64\u684c\u9762\u4e0d\u80fd\u6dfb\u52a0\uff01";else{var g=this.id.replace("Sch_","");if(Site.isPreset(g)>-1)f="\u6b64\u7f51\u5740\u5df2\u5b58\u5728\uff01"}if(f){$(document).trigger("mouseup");new rPrompt(f);$(this).draggable("disable")}}).click(function(){if(!$(this).draggable("option","disabled")){N.quickSearch.vanish();var f=$(this).clone().attr("id","id"+(new Date).valueOf().toString()).css({position:"absolute",zIndex:"999999",left:$(this).offset().left,top:$(this).offset().top}).appendTo("body"), g=$("<div id='a_a_a_a'></div>");Site.addSch($(this),g,f)}return false}).draggable({helper:"clone",opacity:0.35,appendTo:"body",zIndex:999999,start:function(){N.quickSearch.vanish()}})})};N.quickSearch.vanish=function(){N.qSchResult.slideUp(function(){$(document).unbind("click",N.quickSearch.vanish);$(this).unbind("click")})};N.quickSearch.bindEvents=function(){this.focus(function(){var c=$.trim(this.value);this.value=c=="\u7f51\u5740\u5feb\u901f\u6dfb\u52a0"?"":c;this.select()}).blur(function(){var c= $.trim(this.value);this.value=c==""?"\u7f51\u5740\u5feb\u901f\u6dfb\u52a0":c}).keyup(this.start);this.find(".button").click(this.start)};N.quickSearch.bindEvents();N.weatherDetail=$("#weatDetaContainer");N.weatherDetail.inited=false;N.weatherDetail.display=function(){if(!this.inited){var c=this,d=$("#focastWeatherInfo").html();c.find(".container").html(d).end().invisible().show();var e=$("#divWeather");d=e.offset();var f=c.width()-e.width();e=e.height();c.css({left:d.left-f,top:d.top+e,zIndex:99999}).hide().visible(); c.find(".Add_Web_closeBtn").click(function(){c.fadeOut()});c.inited=true}this.fadeIn()};Desktop.init();$(".icon_del").click(function(){if(Site.lastHoverId!=null){Site.remove($("#"+Site.lastHoverId));Site.clearHoverTimeout()}return false}).hover(function(){$(this).addClass("icon_del_hover")},function(){$(this).removeClass("icon_del_hover")});$(".icon_share").click(function(){var c={isReg:isRegUser,siteID:Site.lastHoverId},d=Site.getSiteData(Site.lastHoverId),e=$("body").jmodal({content:{iframe:"shareSite.aspx?"+ $.param(c)},initWidth:520,full:true,load:function(){window.frames[e.iframe.attr("name")].paintIcon(d)}});Site.clearHoverTimeout();N.iconPanel.hide();return false}).hover(function(){$(this).addClass("icon_share_hover")},function(){$(this).removeClass("icon_share_hover")});$("#liBoxDel").droppable({over:function(){$(this).css("backgroundPosition","right top")},out:function(){$(this).css("backgroundPosition","left top")},drop:function(c,d){Site.remove(d.draggable)}});$("#liBoxEdit").droppable({over:function(){$(this).css("backgroundPosition", "right top")},out:function(){$(this).css("backgroundPosition","left top")},drop:function(){$(".icon_edit").click()}});$("#liBoxCopy").droppable({over:function(){$(this).css("backgroundPosition","right top")},out:function(){$(this).css("backgroundPosition","left top")},drop:function(c,d){if(d.draggable.attr("rel")!="sso")var e=d.draggable.attr("id").split("_")[3],f={isReg:isRegUser,siteID:e,deskID:curDesktop},g=$("body").jmodal({content:{iframe:"copySite.aspx?"+$.param(f)},initWidth:300,initHeight:170, full:true,load:function(){window.frames[g.iframe.attr("name")].Doc(f.isReg,e)}})}});$("a.setHomePage").click(function(){setHomepage(N.url);return false});$("a.setFav").click(function(){addFav(N.url,"P.CN\uff0c\u6211\u7684\u4e0a\u7f51\u4e3b\u9875!");return false});if(document.all){document.body.style.behavior="url(#default#homepage)";document.body.isHomePage("http://www.p.cn")&&$("a.setHomePage").remove()}$("body").delegate("#desk_edit","click",Desktop.edit);$(".DMItem").click(function(){$(this).blur()}); $("#themeSelector a").click(function(){$(this).parents("ul").children("li").removeClass("selected");$(this).parent().addClass("selected");var c=0;if(this.hash.length>1)c=this.hash.substr(1);$.cookie("theme",c,{expires:300,path:"/"});$("#csslink").attr("href","/themes/"+c+"/s.css");return false});$(".t"+($.cookie("theme")?$.cookie("theme"):"0"),"#themeSelector").parent().addClass("selected");N.kwf.keyup(function(c){switch(c.keyCode){case 37:case 39:return false;case 40:if(!N.suggestBox.is(":hidden")){c= $("tr",N.suggestBox);var d=null;if(c.filter(".hover").length>0){d=c.filter(".hover").next();c.removeClass("hover");d.addClass("hover")}else d=c.eq(0).addClass("hover");N.kwf.val($(".suggest_keyword",d).text())}return false;case 38:if(!N.suggestBox.is(":hidden")){c=$("tr",N.suggestBox);if(c.filter(".hover").length>0){d=c.filter(".hover").prev();c.removeClass("hover");d.addClass("hover")}else d=c.eq(c.length-1).addClass("hover");N.kwf.val($(".suggest_keyword",d).text())}return false}c=$.trim(this.value); if(c!=""&&c.length>0){if(c==N.lastKey)return false;N.lastKey=c;$.getScript("http://www.google.cn/complete/search?hl=zh-CN&client=suggest&js=true&q="+encodeURIComponent(c))}else N.suggestBox.hide()});$(document).click(function(c){c=$(c.target);if(c.parents("#suggest_box").length==0)N.suggestBox.hide();else if(c.parents("#icon_panel").length==0){N.iconPanel.hide();Site.clearHoverTimeout()}});tipReg.show();initComponents.call(window);N.pBtnPrompt.locate();GetWeather();GetNotice();$("#searchSwitchBox").length> 0&&initSearch();initForReg();$("#taobao .searchInputBox").append($("#taobaoJS iframe"))}); var initComponents=function(){N.pBox=$("#key");N.pBox.blur(function(){if(this.value=="")this.value="\u8f93\u5165\u5173\u952e\u5b57/GID/\u5361\u53f7/\u547d\u4ee4"}).focus(function(){if(this.value=="\u8f93\u5165\u5173\u952e\u5b57/GID/\u5361\u53f7/\u547d\u4ee4")this.value=""});N.pBox.mouseenter(function(){N.pBox.isOn=true;window.setTimeout(function(){if(N.pBox.isOn===true){N.pBtnPrompt.isVisible=true;N.pBtnPrompt.fadeIn()}},1E3)}).mouseleave(function(){N.pBox.isOn=false;if(N.pBtnPrompt.isVisible===true){N.pBtnPrompt.fadeOut(); N.pBtnPrompt.isVisible=false}});N.pBtnPrompt=$(".P_prompt");N.pBtnPrompt.locate=function(){$("#gid").prepend(this);this.css({top:$("#gid").height()+3})}},initForReg=function(){if(isRegUser){N.hoo=$("#hoo");N.hoo.oriTop=N.quickSearch.offset().top+N.quickSearch.height()+7;N.hoo.draggable({handle:"#hooHandle"});N.hoo.switcher=$("#hooSwitch");N.hoo.switcher.click(function(){N.hoo.switcher.toggleClass("hooVis");if(N.hoo.switcher.hasClass("hooVis"))N.hoo.animate({top:N.hoo.oriTop},function(){N.hoo.animate({height:N.hoo.oriHeig}, function(){N.hoo.slider&&N.hoo.slider.fire()})});else{N.hoo.slider&&N.hoo.slider.halt();N.hoo.oriHeig=N.hoo[0].offsetHeight;var b=$(document).scrollTop()+$(window).height()-40;N.hoo.animate({height:"40px"},function(){N.hoo.animate({top:b,right:"10px"})})}});N.hoo.find("#hooTitleClose").click(function(){var b=function(){N.hoo.draggable("destroy");N.hoo.slider&&N.hoo.slider.dispose();N.hoo.fadeOut().remove()};$("#hooChkbox input").attr("checked")?b():rConfirmDeed(function(){b();$.post("default.aspx/SetIsayStatus", "{'visitStatus':false}")},'\u5982\u60f3\u91cd\u65b0\u6dfb\u52a0\u767b\u5f55\u540e\u663e\u793a,\u8bf7\u5230\u60a8\u7684"\u4e00\u547c\u767e\u5e94"\u540e\u53f0\u8fdb\u884c\u8bbe\u7f6e\uff01\u60a8\u8981\u5173\u95ed\u767b\u5f55\u540e\u663e\u793a\u5417\uff1f');return false});N.hoo.find("#hooSay").click(function(){var b=$("#hooTxt").val();if(b==""||b=="\u8f93\u5165\u4e00\u53e5\u8bdd"){new rPrompt("\u8bf7\u8f93\u5165[\u4e00\u547c\u767e\u5e94]\u5185\u5bb9");$("#hooTxt").focus()}else if(b.length>140){new rPrompt("[\u4e00\u547c\u767e\u5e94]\u5185\u5bb9,\u4e0d\u80fd\u8d85\u8fc7140\u4e2a\u5b57"); $("#hooTxt").focus()}else{$("#txtSay").html("");b&&$.post("default.aspx/Say",$.toStr({msg:b}),function(c){if(c.d.Result){N.hoo.find("#isayList").prepend(c.d.Message);$("#hooTxt").val("\u8f93\u5165\u4e00\u53e5\u8bdd").focus()}else new rPrompt(c.d.Message)});return false}});N.hoo.css({zIndex:"99999",right:"10px",top:N.hoo.oriTop,position:"absolute"}).invisible().show();$.post("default.aspx/GetSayList",$.toStr({isReg:isRegUser}),function(b){if(b.d.Result){N.hoo.find("#isayList").html(b.d.Message);N.hoo.hide().visible().fadeIn()}}); $.post("Default.aspx/GetUnreadShareNum",$.toStr({isReg:true}),function(b){b&&b.d.Success&&b.d.Obj!="0"&&$("#shareNo").html("(<span style='color:red'>"+b.d.Obj+"</span>)")})}},tipReg={timeout:null,show:function(b){var c=(new Date).toDateString().replace(/\u0020/g,""),d=document.cookie.replace(/\u0020/g,""),e=d.indexOf("tipRegStamp");if(e!=-1){var f=e+11+1,g="";e=d.indexOf(";",e);g=e==-1?d.substr(f):d.substr(f,e-f);if(g==c)return false}document.cookie="tipRegStamp="+c;b=b||1E4;c=$("#headbox");$(".bubble").removeClass("hidden").css({left:c.offset().left+ c.width()-$(".bubble").width(),top:c.offset().top+c.height()}).fadeIn("slow");var h=this;h.timeout=window.setTimeout(function(){h.close()},b);$(".bubble,.bubble-close").click(function(){tipReg.close("fast");return false});$(".bubble a").click(function(k){k.stopPropagation();tipReg.close("fast")})},close:function(b){if(this.timeout!=null){window.clearTimeout(this.timeout);this.timeout=null}b=b||"slow";$(".bubble").fadeOut(b)}}; function initSearch(){$.each(["Tool_Img007.png","Tool_Img008.png","Tool_Img009.png"],function(b,c){(new Image).src="/images/"+c});$("#searchSwitchBox li").click(function(){var b=this.id;$("#searchSwitchBox li").each(function(c,d){var e=d.id;$(this).removeClass(e+"on")});$(this).addClass(b+"on");b=b.replace("li","");$(".Search_Box>div").addClass("none");$("#"+b).removeClass("none")})} function setSiteInactive(b){var c=b.css("top"),d=b.css("left");c=curDesktop+"_"+c.replace("px","")+"_"+d.replace("px","");b.empty().attr("id",c).removeClass().addClass("icon inactive").css("backgroundImage","").unbind().draggable("destroy");Site.initInactive($("#"+c))}function gridToPos(b,c,d,e){return Site.gridToPos(b,c,d,e)}function idToGrid(b){var c=b.css("top").replace("px","");b=b.css("left").replace("px","");return Array(c,b)} function posToGrid(b,c,d){c=c||90;d=d||90;b=b.toString();if(b.length<2)b="0"+b;var e=parseInt(b.charAt(0));b=parseInt(b.charAt(1));return Array(e*d,b*c)} function addNewSite(b){a="S_"+b.sid;b.bg=b.bg||"";if(b.fc=="")b.color=b.bg=="icon_white"?"#000":"#fff";var c="";if(get_extname(b.icon)=="png"&&$.isIE6)c="_background-image:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+b.icon+"',sizingMethod='crop');";$("#"+b.did+"_"+b.pos_y+"_"+b.pos_x).attr("id",b.did+"_"+a).unbind().removeClass("inactive").html('<div class="icon_bg '+b.bg+'"></div><div class="icon_ft" style="background-image: url('+b.icon+");;"+c+'"></div><div class="icon_chr" title="'+ b.title+'" edittitle="'+b.title+'" href="'+b.url+'" target="_blank" style="color:'+b.color+' ;" >'+b.title.subBytes(0,10)+'<div class="mask"><div class="maskInner"></div></div></div>');get_extname(b.bg)=="png"&&$.isIE6&&$("#"+b.did+"_"+a).find(".icon_bg").attr("style","background-image:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+b.bg+"',sizingMethod='crop')");Site.initDrag($("#"+b.did+"_"+a))} var Site={inProcess:false,lastHoverTimeoutId:null,lastHoverId:null,editSiteId:null,checkStatus:function(){this.inProcess&&new rPrompt("\u8bf7\u7a0d\u7b49\uff0c\u4e0a\u6b21\u8bf7\u6c42\u6b63\u5728\u5904\u7406\u4e2d...");return this.inProcess},checkRsp:function(b){this.inProcess=false;var c=b.d.Success;if(!c){$.fn.hideJmodal();if(b.d.NeedRefresh){b=$('<div style=" width:290px; padding:25px 30px;background-color:#fff; overflow:hidden;"> <span style="display:inline-block;vertical-align:middle;width:63px;"><img src="images/Update.png"></span> <span style="width:155px;vertical-align:middle;display:inline-block;margin-left:5px; font-size:12px; line-height:22px; color:#333;">\u53ef\u80fd\u60a8\u7684PCN\u5ba2\u6237\u7aef\u6216\u8005\u4f7f\u7528\u5176\u4ed6\u65b9\u5f0f\u8fdb\u884c\u4e86\u6dfb\u52a0\u7f51\u5740\u64cd\u4f5c,\u6211\u4eec\u6b63\u5728\u4e3a\u60a8\u66f4\u65b0\u6570\u636e\uff0c\u8bf7\u7a0d\u540e... </span></div>'); b=new RPrompt(b);setTimeout(b.close,3E3);Desktop.load(curDesktop)}else if(b.d.Detail)new rPrompt(b.d.Detail);else new rPrompt("\u64cd\u4f5c\u5931\u8d25")}return c},addSch:function(b,c,d){if(this.checkStatus()){d.remove();return false}var e=false,f=c.attr("id"),g=f.split("_");if(g.length==4){var h=-1;c=[];if(isNaN(parseInt(g[2]))){if((h=Site.findEmptyPos())>-1){e=true;c=posToGrid(h);N.currentGrid=curDesktop+"_"+c[0]+"_"+c[1]}}else{e=true;N.currentGrid=f;c=idToGrid($("#"+f));h=gridToPos(c[1],c[0])}if(e){var k= null,i=$("#"+N.currentGrid);f=i.offset();var l=i.position();data=Site.getSiteData(b.attr("id"));data.did=curDesktop;data.pos_x=c[1];data.pos_y=c[0];$.post("/default.aspx/AddSysIcon",$.toStr({deskStr:curDesktop,position:h,webSiteID:data.sid,content:para[curDesktop].desktop.toStr(),isReg:isRegUser}),function(j){k=Site.checkRsp(j)});this.inProcess=true;d.animate({top:f.top,left:f.left},1E3,function(){i.parent().append(d.css({zIndex:10,left:l.left,top:l.top}));var j=function(){if(k==null)setTimeout(j, 100);else{if(k==true){para[curDesktop].desktop[h]=data.sid;Site.update(data)}d.remove()}};j()})}}return e},setLogin:function(b){var c=$.fn.jmodal({content:{iframe:"SetLogin.aspx?id="+b},initWidth:350,initHeight:310,full:true,load:function(){window.frames[c.iframe.attr("name")].websiteID=b}})},update:function(b){var c=$("#"+N.currentGrid);grida=idToGrid($(c));var d=gridToPos(grida[1],grida[0]);para[curDesktop].desktop[d]=b.sid.toString();N.currentGrid=null;setSiteInactive(c);addNewSite(b)},edit:function(b){idToGrid($("#"+ b));var c=b;b=b.split("_");Site.editSiteId=b[2]+"_"+b[3];N.currentGrid=c;var d=$.fn.jmodal({content:{iframe:"AddSite.aspx"},initHeight:598,initWidth:782,full:true,load:function(){var e=window.frames[d.iframe.attr("name")];e.Popup.open("customed");e.Popup.siteData=Site.getSiteData(c)}})},getSiteData:function(b){var c=$("#"+b);b=b.split("_")[3];var d="",e=c.find(".icon_bg").attr("class").replace("icon_bg","").match(/.*(icon_\w+).*/);if(e)d=e[1];e=c.find(".icon_ft").css("backgroundImage").match(/url\(["']?(.+?)["']?\)/); var f=null;if(e)f=e[1];if(f==null||f=="")f=c.find(".icon_ft")[0].filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src;return{sid:b,bg:d,url:c.find(".icon_chr").attr("href"),icon:f,color:c.find(".icon_chr").css("color"),title:c.find(".icon_chr").attr("edittitle")}},remove:function(b){if(this.checkStatus())return false;var c=b.attr("id").substr(b.attr("id").lastIndexOf("_")+1),d=$.inArray(c,para[curDesktop].desktop);if(d>-1){c={isReg:isRegUser,pos:d,websiteID:c,deskID:para[curDesktop].desktopId, data:para[curDesktop].desktop.toStr()};$.post("default.aspx/DelIcon",$.toStr(c),function(e){this.inProcess=false;if(Site.checkRsp(e)){para[curDesktop].desktop[d]=0;setSiteInactive(b);N.iconPanel.hide();Site.clearHoverTimeout()}});this.inProcess=true}else new rPrompt("\u5220\u9664\u5931\u8d25\uff01")},swap:function(b,c,d){if(this.checkStatus()){d.remove();return false}var e=b.draggable,f={top:e.css("top"),left:e.css("left")},g={top:c.css("top"),left:c.css("left")};b=c.offset();var h={deskID:para[curDesktop].desktopId, content:para[curDesktop].desktop.toString(),isReg:isRegUser},k=curDesktop;d.animate({top:b.top,left:b.left},function(){e.show();d.remove()});e.hide().css({top:g.top,left:g.left});if(c.hasClass("inactive")){c.attr("id",curDesktop+"_"+f.top.replace("px","")+"_"+f.left.replace("px",""));c.css({top:f.top,left:f.left})}else c.animate({top:f.top,left:f.left});h.siteMsg=[];c.hasClass("inactive")||h.siteMsg.push({Site:c.attr("id"),SiteLeft:f.left.replace("px",""),SiteTop:f.top.replace("px","")});h.siteMsg.push({Site:e.attr("id"), SiteLeft:g.left.replace("px",""),SiteTop:g.top.replace("px","")});$.post("default.aspx/TransIcon",$.toStr(h),function(i){this.inProcess=false;if(Site.checkRsp(i))para[k].desktop=i.d.DataArray;else{e.css({top:f.top,left:f.left});c.css({top:g.top,left:g.left})}});this.inProcess=true},findEmptyPos:function(){for(var b=para[curDesktop].desktop,c=b.length,d=0;d<c;d++)if(b[d]=="0")break;if(d>=c){d=-1;new rPrompt("\u684c\u9762\u5df2\u6ee1")}return d},isPreset:function(b){return $.inArray(b,para[curDesktop].desktop)}, gridToPos:function(b,c,d,e){b=parseInt(b);c=parseInt(c);d=d||90;e=e||90;var f=para[curDesktop].desktopCols||10;return Math.floor(c/e)*f+Math.floor(b/d)},clearHoverTimeout:function(){if(this.lastHoverTimeoutId!=null){window.clearTimeout(this.lastHoverTimeoutId);this.lastHoverTimeoutId=null}},splitSiteId:function(){},initDrag:function(b){var c=this;Site.initClick(b);b.draggable({helper:"clone",opacity:0.35,zIndex:9999,revert:"invalid",appendTo:"body",start:function(){$("#boxmain").hide();$("#boxmainAc").show(); N.iconPanel.hide()},stop:function(){$("#boxmain").show();$("#boxmainAc").hide()}}).hover(function(){var d=$(this);$(".handle",this).show();if(!N.iconPanel.is(":hidden")&&d.attr("id")==c.lastHoverId)return false;c.lastHoverId=d.attr("id");var e=d.attr("rel");if(e)e=e.toLowerCase();if(e=="sso"){$(".icon_share").hide();$(".icon_edit").addClass("icon_edit2").unbind().click(function(){Site.setLogin(Site.lastHoverId);Site.clearHoverTimeout();N.iconPanel.hide();return false}).hover(function(){$(this).addClass("icon_edit2_hover")}, function(){$(this).removeClass("icon_edit2_hover")})}else{$(".icon_share").show();$(".icon_edit").removeClass("icon_edit2").unbind().click(function(){Site.edit(Site.lastHoverId);Site.clearHoverTimeout();N.iconPanel.hide();return false}).hover(function(){$(this).addClass("icon_edit_hover")},function(){$(this).removeClass("icon_edit_hover")})}N.iconPanel.hide().css({top:d.offset().top-10,left:d.offset().left+8});c.clearHoverTimeout();c.lastHoverTimeoutId=window.setTimeout(function(){N.iconPanel.show()}, 1E3)},function(){c.clearHoverTimeout()})},initDroppable:function(b){b||(b=$(".icon",".icon_area"));b.droppable({accept:".icon,.HomeIcon",drop:function(c,d){var e=d.draggable,f=$(this),g=d.helper.clone(),h=d.helper.offset();g.appendTo("body").css({left:h.left,top:h.top,zIndex:999999});e.attr("id").indexOf("X_X_")!=-1?Site.addSch(e,f,g):Site.swap(d,f,g)}})},initInactive:function(b){b||(b=$(".inactive"));b.hover(function(){$(this).addClass("hover");N.iconPanel.hide()},function(){$(this).removeClass("hover")}).click(function(c){var d= $.fn.jmodal({content:{iframe:"AddSite.aspx"},initHeight:598,initWidth:782,full:true,load:function(){window.frames[d.iframe.attr("name")].Popup.open("customed")}});Site.editSiteId=null;$(this);N.currentGrid=this.id;c.preventDefault();return false})},initClick:function(b){b.click(function(){var c=$(this).find(".icon_chr").attr("href");Site.clearHoverTimeout();N.iconPanel.hide();window.open(c);$.post("default.aspx/ClickIcon",$.toStr({url:c}));return false}).mouseenter(function(){$(this).find(".mask").show()}).mouseleave(function(){$(this).find(".mask").hide()})}}; $(".desktopMenu").not(".active").hover(function(){$(this).addClass("hover")},function(){$(this).removeClass("hover")}); var Desktop={add:function(){$("").jmodal({content:{iframe:"AddDesk.aspx"},full:true});return false},edit:function(){var b=this,c=$.fn.jmodal({content:{iframe:"AddDesktop.aspx?id=2"},initWidth:350,initHeight:170,full:true,load:function(){window.frames[c.iframe.attr("name")].fill({name:$(b).parent().text(),title:"\u4fee\u6539\u684c\u9762",id:$(b).prev().attr("id")})}});return false},editComplete:function(b){var c=b.Did;b=b.Title;if(c.charAt(0)=="M")$("#"+c+" span:eq(1)").text(b);else{$("#"+c).text(b); window.para[c].title=b}},change:function(b){N.iconPanel.hide();b.split("_");if(b==curDesktop)return false;$("#SubMenus").hide();$("#desktopLoading").show();if($("#desktop_area_"+b).length==0)this.load(b);else{b.split("_");$("#desktop_area_"+b).show();Desktop.close(b)}$.cookie("ldid",b,{expires:180});return false},initLoad:function(b){var c=$("#desktop_area_"+b),d=b.charAt(0),e=$("#"+b),f=e.attr("attr"),g=$(".icon:not('.inactive')",c),h=$(".inactive",c),k=$(".icon",c);if(b==="S_2"||b==="S_10"){Site.initClick(g); g.hover(function(i){if(i.relatedTarget!==N.rebateIcon[0]){i=$(this).offset();var l=N.rebateIcon.outerWidth(),j=N.rebateIcon.outerHeight();N.rebateIcon.css({left:i.left+80-l,top:i.top-j/2}).show()}},function(i){i.relatedTarget!==N.rebateIcon[0]&&N.rebateIcon.hide()})}else if(b==="S_4"||b==="S_12")Site.initClick(g);else if(b=="S_9"){Site.initClick(g.filter(":not(#S_9_S_3197741)"));c.find("#S_9_S_3197741").click(function(){$.fn.jmodal({content:{iframe:"http://online.jiangmin.com/KvOnline.aspx"},initWidth:550, initHeight:445,full:true,hasCloser:true,title:"\u6c5f\u6c11\u5728\u7ebf\u6740\u6bd2"});return false})}else if(d=="D"||d=="C"&&(f=="2"||f=="4")||d=="W"){Site.initInactive(h);Site.initDrag(g);Site.initDroppable(k)}else if(d=="C"&&f=="5"){e.attr("noAdd","true");Site.initDrag(g)}else{e.attr("noAdd","true");Site.initClick(g)}},load:function(b,c){var d=function(){$("#desktopLoading_loading").hide();$("#desktopLoading_error").show().find("a").click(function(){Desktop.change(b);return false});return false}; $.ajax({type:"POST",url:"Default.aspx/ChangeDesktop",data:$.toStr({deskStr:b,isReg:isRegUser}),contentType:"application/json; charset=utf-8",dataType:"json",success:function(e){e=e.d;e.Result||d();var f=e.DeskID,g=e.Content;window.para[f]={title:e.Title,desktopId:f.split("_")[1],desktop:g};g="desktop_area_"+f;var h=$("#"+g);if(h.length==0)h=$("<div></div>").attr("id",g).addClass("icon_area none").prependTo($("#desktop"));else h.find(".icon").droppable("destroy").draggable("destroy");h.html(e.Data); Desktop.initLoad(f);c||Desktop.close(f)},error:function(){d()}})},init:function(){var b=this;$("#addNew").click(Desktop.add);N.pages=$("#deskpage");N.pages.download=function(c,d){$.ajax({type:"POST",url:"Default.aspx/ShowPages",data:$.toStr({isReg:isRegUser,deskType:c,deskID:d}),contentType:"application/json; charset=utf-8",dataType:"json",success:function(e){N.pages.fill(e.d,c)}})};N.pages.fill=function(c,d){N.pages.html(c);N.pages.find("a").click(function(){N.pages.find("div").removeClass("FlipJs_One").addClass("FlipJs_Two"); $(this).parent().addClass("FlipJs_One").removeClass("FlipJs_Two");N.subList.download($(this).attr("attr"),$(this).attr("id"),$(this).attr("sm"));Desktop.change(this.id);return false});N.pages.find("a:first").click();d!=2&&N.pages.show()};N.pages.clear=function(){this.empty().hide()};N.subList=$("#desktopList");N.subList.download=function(c,d,e){this.children().hide();if(e=="false")return false;e=this.find("#menu_"+c);if(e.length>0)return e.show();else $.post("Default.aspx/ShowMenus",$.toStr({isReg:isRegUser, attr:c,deskStr:d,defaultDeskStr:window.defaultDesktop}),function(f){var g=$('<ul id="menu_'+c+'"class="Gray12"></ul>');g.html(f.d);N.subList.append(g)})};$("body").delegate('#desk-bar a[id!="desk_edit"],.DMItem',"click",function(){if(this.id==curDesktop)return false;b.setActive(this.id);var c=this.id,d=c.charAt(0),e=$(this).attr("sm"),f=$(this).attr("attr");N.pages.clear();if(c=="menu_rb")N.pages.fill("<div class='FlipJs_One'><a id='S_2' sm='true' attr='100' href='javascript:;' rel='0_0'>1</a></div><div class='FlipJs_Two'><a id='S_10' sm='true' attr='100' href='javascript:;' rel='0_1'>2</a></div>"); else if(c=="menu_goods")N.pages.fill("<div class='FlipJs_One'><a id='S_4' sm='true' attr='100' href='javascript:;' rel='0_0'>1</a></div><div class='FlipJs_Two'><a id='S_12' sm='true' attr='100' href='javascript:;' rel='0_1'>2</a></div>");else if(d=="M")N.pages.download(f,c);else{N.subList.download(f,c,e);Desktop.change(this.id)}return false});this.setActive(curDesktop)},setActive:function(b){var c=b.charAt(0);if(c=="D"||c=="M"||c=="F"){$("#desk-bar li").removeClass("on").addClass("Default").find("#desk_edit").remove(); $("#"+b).parent().removeClass("Default").addClass("on");$('<a id="desk_edit" title="\u8bbe\u7f6e" href="#"><span class="setIcon"></span></a>').appendTo($("#"+b).parent())}if(c=="W"){$("#"+b).parent().addClass("on").parents("ul").find(".on").removeClass("on").end().find(".desk_edit").remove();$('<a class="desk_edit" href="#" style="color:#0CF">\u5220\u9664</a>').click(function(){rConfirmDeed(function(){Desktop.sendDel(b)});return false}).appendTo($("#"+b).parent())}if(b=="S_0"){$("#desk-bar li").removeClass("on").addClass("Default").find("#desk_edit").remove(); $("#"+b).parent().removeClass("Default").addClass("on")}else if(c=="S"||c=="m"){$(".DMItem").attr("style","");$("#"+b).attr("style","color:#ffffff")}},create:function(b){did=b.data.desktopId;title=b.data.title;var c='<li class="Default"><a id="'+did+'" href="#'+did+'" " rel="'+did+'" >'+title+"</a></li>";$(".sysdesktop").length>0?$($(".sysdesktop")[0]).before(c):$("#desk-bar").append(c);window.para[did]=b.data;$("#"+did).click();desktopNum++;return false},del:function(b){b.indexOf("W")!=-1?$("#"+ b).parent().parent().remove():$("#"+b).parent().remove();b=$("#desk-bar a.on");if(b.length==0)b=$("#desk-bar a:first");b.click();desktopNum--},sendDel:function(b){b=b?b:curDesktop;$.ajax({type:"POST",url:"Default.aspx/DelDesktop",data:$.toStr({isReg:isRegUser,deskStr:b}),contentType:"application/json; charset=utf-8",dataType:"json",success:function(c){c.d.Result&&Desktop.del(c.d.Did)},error:function(){}})},close:function(b){var c=curDesktop;if(c!=b){var d=$("#desk-bar a"),e=-895,f=895;if(jQuery.inArray($("#"+ curDesktop)[0],d)>jQuery.inArray($("#"+b)[0],d)){e=895;f=-895}$("#desktop_area_"+curDesktop).css("left","0");$("#desktop_area_"+curDesktop).animate({left:e},{duration:500,complete:function(){$("#desktop_area_"+c).hide();$("#SubMenus").show();$("#desktopLoading").hide().find("#desktopLoading_error").hide().find("#desktopLoading_loading").show()}});Desktop.show(b,f)}},show:function(b,c){$("#desktop_area_"+b).removeClass("none").css("left",c).animate({left:0},{duration:500});curDesktop=b},checkFull:function(b){b|| (b=curDesktop);b=window.para[b].desktop;var c=true;for(var d in b)if(b[d]=="0"){c=false;break}return c}};window.google={ac:{}}; window.google.ac.h=function(b,c,d){c=b[0];d=b[1];b="<table cellspacing='0' cellpadding='0'>";c=d.length;if(c>0){for(var e=0;e<c;e++)b+="<tr><td class='suggest_keyword'>"+d[e][0]+"</td><td class='suggest_num'>"+d[e][1]+"</td></tr>";b+="</table>";d=N.kwf.offset();N.suggestBox.html(b).css({left:d.left,top:d.top+N.kwf.outerHeight()});N.suggestBox.width()<N.kwf.outerWidth()&&$("table",N.suggestBox).width(N.kwf.outerWidth());N.suggestBox.show();$("tr",N.suggestBox).hover(function(){$(this).addClass("hover")}, function(){$(this).removeClass("hover")}).click(function(){N.kwf.val($(".suggest_keyword",this).text());N.suggestBox.hide()})}else N.suggestBox.hide()}; function onsearch(b,c){var d,e;switch(b){case "gid":d=$("#key")[0].value;if(d=="\u8f93\u5165\u5173\u952e\u5b57/GID/\u5361\u53f7/\u547d\u4ee4")d="";d=="9889"?window.open("http://www.gid01.com/business/"):window.open("http://search.p.cn/Search.aspx?str="+escape(d));e=d;d="http://www.gidsoo.com";break;case "baidu":d="http://www.baidu.com";break;case "google":d="http://www.google.com";break}e||(e=$(c).parents("form").find("input:text").val());$.post("default.aspx/SearchEngineCount",$.toStr({url:d,keyWord:e})); return false}function EnterPSubmit(b,c){keyPressed=window.event?window.event.keyCode:c.which;if(keyPressed==13){onsearch();return false}}function Reg(){$.fn.jmodal({content:{iframe:"Reg.aspx"},initWidth:500,initHeight:450,full:true})}function NoRegDirect(){alert("\u8fd8\u6ca1\u6ce8\u518cP.CN,\u8bf7\u6ce8\u518c\u540e\u767b\u5f55\uff01");window.location.href="http://www.p.cn"} function GetWeather(){var b=IPData[2];$.ajax({type:"POST",url:"Default.aspx/GetWeatherMsg",data:"{'cityName': '"+(b=="\u5317\u4eac\u5e02"||b=="\u4e0a\u6d77\u5e02"||b=="\u5317\u4eac\u5e02"||b=="\u5929\u6d25\u5e02"||b=="\u91cd\u5e86\u5e02"?b:IPData[3])+"'}",contentType:"application/json; charset=utf-8",dataType:"json",success:function(c){$("#divWeather").html(c.d).click(function(){N.weatherDetail.display()})}})} function EnterPSubmit(b,c){keyPressed=window.event?window.event.keyCode:c.which;if(keyPressed==13){onsearch();return false}} function addSiteP(b){if(curDesktop.charAt(0).toLowerCase()=="s"||$("#"+curDesktop).attr("noAdd"))$.alert("\u5bf9\u4e0d\u8d77\uff0c\u6b64\u684c\u9762\u4e0d\u80fd\u6dfb\u52a0\uff01");var c=posToGrid(b.Positon),d={did:curDesktop,title:b.Title,url:b.Url,icon:b.IconUrl,bg:b.BackColor,color:b.FontColor,pos_x:c[1],pos_y:c[0],sid:b.WebSiteID.toString()},e=$("<div style='position:absolute;z-index:20000;left:0;top:0;display:none;'></div>");b="";if(get_extname(d.icon)=="png"&&$.isIE6)b="_background-image:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ d.icon+"',sizingMethod='crop');";e.addClass(d.bg).html('<a target="_blank" style="background-image: url('+d.icon+"); color:"+d.color+b+'" class="iconcontent White">'+d.title.subBytes(0,10)+"</a>");get_extname(d.bg)=="png"&&$.isIE6&&e.css({"_background-image":"none",_filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+d.bg+"',sizingMethod='crop')"});b=$("#gid").offset();e.appendTo("body").css({left:b.left,top:b.top});N.currentGrid=curDesktop+"_"+d.pos_y+"_"+d.pos_x;b=$("#"+N.currentGrid).offset(); e.show().animate({left:b.left,top:b.top},1E3,function(){Site.update(d);e.remove();return true})} function onp(){var b=$("#key")[0].value;if(b=="\u8f93\u5165\u5173\u952e\u5b57/GID/\u5361\u53f7/\u547d\u4ee4")b="";if(!b)return false;new rPrompt("\u6b63\u5728\u5904\u7406\u4e2d\uff0c\u8bf7\u7a0d\u7b49......",3,null,1E3);$.ajax({type:"POST",url:"Default.aspx/AddIconByUrl",data:"{'isReg':"+isRegUser+",'url':'"+b+"', 'defaultDeskID':'"+curDesktop+"'}",contentType:"application/json; charset=utf-8",dataType:"json",success:function(c){c=c.d;new rPrompt(c.Detail);if(c.Success)switch(c.OperationType){case 0:new rPrompt("\u672a\u5b9a\u4e49\u64cd\u4f5c\u3002"); break;case 1:addSiteP(c.Obj);break;case 2:window.open(c.Obj);break;case 3:window.open(c.Obj);break;case 4:break;case 5:break;case 6:break;case 7:break;case 8:$.fn.jmodal({content:{iframe:c.Obj},initWidth:500,initHeight:390,full:true});break;case 9:break;case 10:break;default:new rPrompt("\u64cd\u4f5c\u5f02\u5e38\u3002");break}}})} function SetHome(b,c){try{b.style.behavior="url(#default#homepage)";b.setHomePage(c)}catch(d){if(window.netscape){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect")}catch(e){alert("\u6b64\u64cd\u4f5c\u88ab\u6d4f\u89c8\u5668\u62d2\u7edd\uff01\n\u8bf7\u5728\u6d4f\u89c8\u5668\u5730\u5740\u680f\u8f93\u5165\u201cabout:config\u201d\u5e76\u56de\u8f66\n\u7136\u540e\u5c06 [signed.applets.codebase_principal_support]\u7684\u503c\u8bbe\u7f6e\u4e3a'true',\u53cc\u51fb\u5373\u53ef\u3002")}Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch).setCharPref("browser.startup.homepage",c)}}} function clickFriend(){$.fn.jmodal({content:{iframe:"RecommendPrize.aspx"},full:true,initWidth:600});return false}function MsgClick(){$.fn.jmodal({content:{iframe:"SayIdea.aspx"},initWidth:550,initHeight:300,full:true});return false} function GetNotice(){$.ajax({type:"POST",url:"Default.aspx/BindAnnouncement",data:$.toStr({isReg:isRegUser}),contentType:"application/json; charset=utf-8",dataType:"json",success:function(b){$("#notices").html(b.d);$("#notices").textSlider({line:1,speed:500,timer:3E3});if($("#hoo").length>0){$("#isayAnno ul").html($("#notices ul").html());if(N.hoo)N.hoo.slider=$("#isayAnno").textSlider({line:3,speed:500,timer:3E3})}}})} (function(){if(typeof PCN==="undefined")PCN={};if(!PCN.Media)PCN.Media={};PCN.Media.CurtainADs=function(b,c,d){var e=this;this.addComps=function(){var f,g;if(typeof b!=="string"){f='<object width="WIDTH" height="HEIGHT"><param name="movie" value="FILENAME"><param name="wmode" value="transparent" /><embed width="WIDTH" height="HEIGHT" src="FILENAME" wmode="transparent"></embed></object>'.replace(/FILENAME/g,b.path);f=f.replace(/WIDTH/g,b.width);f=f.replace(/HEIGHT/g,b.height)}else{f=new Image;f.src= b;f="<img src='SRC'/>".replace("SRC",b)}if(typeof c!=="string"){g='<object width="WIDTH" height="HEIGHT"><param name="movie" value="FILENAME"><param name="wmode" value="transparent" /><embed width="WIDTH" height="HEIGHT" src="FILENAME" wmode="transparent"></embed></object>'.replace(/FILENAME/g,c.path);g=g.replace(/WIDTH/g,c.width);g=g.replace(/HEIGHT/g,c.height)}else{g=new Image;g.src=c;g="<img src='SRC'/>".replace("SRC",c)}this.wins=$("<a href='"+d+"' target='_blank' class='curtainADs curtainADsLeft'><div class='mask'></div><div class='bigImg'>"+ g+"</div><div class='smallImg'>"+f+"</div></a><a href='"+d+"' target='_blank' class='curtainADs curtainADsRight'><div class='mask'></div><div class='bigImg'></div><div class='smallImg'></div></a>").appendTo("body");this.wins.eq(1).find(".bigImg").html(this.wins.eq(0).find(".bigImg").html());this.wins.eq(1).find(".smallImg").html(this.wins.eq(0).find(".smallImg").html());this.masks=this.wins.find(".mask");this.bigImg=this.wins.find(".bigImg");this.smallImg=this.wins.find(".smallImg");this.enter=function(){e.smallImg.hide(); e.bigImg.show();$.isIE6&&e.masks.css({width:e.bigImg.width(),height:e.bigImg.height()})};this.leave=function(){e.bigImg.hide();e.smallImg.show();$.isIE6&&e.masks.css({width:e.smallImg.width(),height:e.smallImg.height()})};return this};this.bindEvents=function(){e.wins.mouseenter(function(){e.enter()});e.wins.mouseleave(function(){e.leave()});return this};this.autoShow=function(f){e.wins.mouseenter();setTimeout(function(){e.wins.mouseleave()},f);return this};this.init=function(){this.addComps().bindEvents(); return this}}})(); (function(b){b.fn.textSlider=function(c){c=jQuery.extend({speed:"normal",line:2,timer:1E3},c);if(this.length===0)return null;if(b("ul:eq(0)",this).children().length<=c.line)return null;return new b.textSlider(this,c)};b.extend({textSlider:function(c,d){if(c.length===0)return null;var e=b("ul:eq(0)",c),f=e.children(),g=f.length;if(g<=d.line)return null;var h,k=b(".up:eq(0)",c),i=b(".down:eq(0)",c);f=b(f[0]).outerHeight();var l=0-d.line*f;if(g<d.line*2)for(var j=0;j<d.line*2-g;j++)e.find("li:eq("+j+ ")").clone().appendTo(e);e.wrap(b("<div></div>").css({overflow:"hidden","white-space":"nowrap",height:-l}));var m=function(){k.unbind("click",m);e.animate({marginTop:l},d.speed,function(){for(j=0;j<d.line;j++)e.find("li:first").appendTo(e);e.css({marginTop:0});k.bind("click",m)})},n=function(){i.unbind("click",n);e.css({marginTop:l});for(j=0;j<d.line;j++)e.find("li:last").prependTo(e);e.animate({marginTop:0},d.speed,function(){i.bind("click",n)})};g=function(){h=window.setInterval(m,d.timer)};f=function(){window.clearInterval(h)}; e.hover(f,g).mouseout();k.css("cursor","pointer").click(m);k.hover(f,g);i.css("cursor","pointer").click(n);i.hover(f,g);this.halt=f;this.fire=g;this.dispose=function(){this.halt();e.unbind();i.unbind();k.unbind()}}})})(jQuery);