//网站路径(域名)控制器
(function(){
	window.X||(window['X']={});
	X.domain = "10086.cn";
	X.PATH={
		HOME:"http://music.10086.cn/",
		ROOT:"http://music.10086.cn/newweb/",
		SUPPORT:"http://mdll.10086.cn/newweb/",
		VIP:"http://mapi.10086.cn/newweb/",
		CLUB:"http://mclub.10086.cn",
		WM:"http://wm.10086.cn",		
		M:"http://m.10086.cn",
		CONTENT:"http://content.12530.com/"		
	}
	//重载域名
	X.PATH.WAP=X.PATH.M;
	try{
		document.domain = location.host.match(/\w*\.\w*$/);
	}catch(e){};
})();

var flash_version = 1.0;
var domains=location.host.match(/\w*\.\w*$/);document.cookie=domains;var cookie_name="12530_listenings";var cookiestr="";var LISTEN_NUM=500;var g_s=false;var from;var fromchnl;var fromcchnl;var salesid;var singid;var channel;var cchannel;var rownew;var columns;var page;var fromtype;var salesid;var nodeid;var nowsonglist=0;if(typeof(nowsonglistdetail)=="undefined")
nowsonglistdetail="";var nowordingid=0;if(typeof(sub_times)=="undefined")
sub_times=0;var latest_id=0;if(typeof(from)=="undefined")
from="";var ifallsong=0;function BrowserCheck(){this.NavName=navigator.appName;this.NavAnt=navigator.userAgent;this.NavVer=navigator.appVersion;this.NavPlug=navigator.plugins;this.NavVsub=navigator.vendorSub;this.NavVerI=parseInt(this.NavVer);this.NavVerF=parseFloat(this.NavVer);this.NN=(this.NavName=="Netscape")
this.NN4=(this.NavAnt.indexOf("Mozilla/4")!=-1);this.NN6=(this.NavAnt.indexOf("Netscape6/")!=-1);this.NN7=(this.NavAnt.indexOf("Netscape/7")!=-1);this.IE=(this.NavName=="Microsoft Internet Explorer");this.IE3=(this.NavAnt.indexOf('MSIE 3')>0);this.IE45=(this.NavVer.indexOf('MSIE 4.5')>0);this.IE401=(this.NavVer.indexOf('MSIE 4.01')>0);this.IE4=(this.NavVer.indexOf('MSIE 4')>0);this.IE51=(this.NavAnt.indexOf('MSIE 5.1')>0);this.IE5=(this.NavVer.indexOf('MSIE 5')>0);this.IE6=(this.NavVer.indexOf('MSIE 6')>0);this.GEK=(this.NavAnt.indexOf("Gecko")!=-1);this.SAF=(this.NavAnt.indexOf("Safari",0)!=-1);this.CAB=(this.NavAnt.indexOf("iCab",0)!=-1);this.OPE=(this.NavAnt.indexOf("Opera",0)!=-1);this.Win=(this.NavAnt.indexOf("Win",0)!=-1);this.XP=(this.NavAnt.match(/NT 5\.1|XP/));this.ME=(this.NavAnt.match(/4\.90|ME/));this.TK=(this.NavAnt.match(/NT 5\.0|2000/));this.NT=(this.NavAnt.match(/NT 5\.0|WinNT/));this.Mac=(this.NavAnt.indexOf("Mac",0)!=-1);this.M68k=(this.NavAnt.indexOf("68k",0)!=-1);this.Uix=(this.NavAnt.indexOf("X11",0)!=-1);this.EGB=(this.NavAnt.indexOf("Planetweb",0)!=-1);}
var FlashInstalled=false;function FLashInstall(){var checkB=new BrowserCheck();if(checkB.OPE&&navigator.plugins["Shockwave Flash"]){var sp=navigator.plugins["Shockwave Flash"].description.indexOf("Flash");var ep=navigator.plugins["Shockwave Flash"].description.lastIndexOf(" ");var aver=parseFloat(navigator.plugins["Shockwave Flash"].description.substring(sp+6,ep));if(aver>=flash_version){FlashInstalled=true;}}else if(checkB.Win&&checkB.IE){document.write('<SCR'+'IPT LANGUAGE=VBScript\> \n');document.write('on error resume next \n');document.write('contentVersion = 6 \n');document.write('FlashInstalled = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & contentVersion))) \n');document.write('</SCR'+'IPT\> \n');if(checkB.IE4){FlashInstalled=false;}}else if(checkB.Mac&&checkB.IE){if(!checkB.IE4&&navigator.plugins["Shockwave Flash"]){var sp=navigator.plugins["Shockwave Flash"].description.indexOf("Flash");var ep=navigator.plugins["Shockwave Flash"].description.lastIndexOf(" ");var aver=parseFloat(navigator.plugins["Shockwave Flash"].description.substring(sp+6,ep));if(aver>=flash_version){FlashInstalled=true;}}}else if(checkB.NN&&navigator.plugins["Shockwave Flash"]){var sp=navigator.plugins["Shockwave Flash"].description.indexOf("Flash");var ep=navigator.plugins["Shockwave Flash"].description.lastIndexOf(" ");var aver=parseFloat(navigator.plugins["Shockwave Flash"].description.substring(sp+6,ep));if(aver>=flash_version){FlashInstalled=true;}}
return FlashInstalled;}
var FlashInstalled=FLashInstall();if(FlashInstalled)
LISTEN_NUM=500;else
LISTEN_NUM=20;function thisMovie(movieName){if(navigator.appName.indexOf("Microsoft")!=-1){return window[movieName]}
else{return document[movieName]}}
function setCookies(name,value,expires,path,domains,secure,optype)
{if(nowsonglist!=0&&optype!="autocookie")
{if(name=="12530_listenings")
nowsonglistdetail=value;else
{if(FlashInstalled)
{thisMovie("myFlash").setCookie(name,value);}
else
{var domain2=domains;var today=new Date();today.setTime(today.getTime());if(expires)
{expires=expires*1000*60*60*24;}
var expires_date=new Date(today.getTime()+(expires));document.cookie=name+"="+escape(value)+
((expires)?";expires="+expires_date.toGMTString():"")+
((path)?";path="+path:"")+
((domain2)?";domain="+domain2:"")+
((secure)?";secure":"");}}}
else
{if(FlashInstalled)
{thisMovie("myFlash").setCookie(name,value);}
else
{var domain2=domains;var today=new Date();today.setTime(today.getTime());if(expires)
{expires=expires*1000*60*60*24;}
var expires_date=new Date(today.getTime()+(expires));document.cookie=name+"="+escape(value)+
((expires)?";expires="+expires_date.toGMTString():"")+
((path)?";path="+path:"")+
((domain2)?";domain="+domain2:"")+
((secure)?";secure":"");}}}
function getCookies_old(name,type)
{{{if(document.cookie=="")
{return cookiestr;}
else
{var start=document.cookie.indexOf(name+"=");var len=start+name.length+1;if((!start)&&(name!=document.cookie.substring(0,name.length)))
{return null;}
if(start==-1)return null;var end=document.cookie.indexOf(";",len);if(end==-1)end=document.cookie.length;if(name=="12530_listenings")
{if(typeof(type)!="undefined")
return unescape(document.cookie.substring(len,end));else
{return specail_deal(unescape(document.cookie.substring(len,end)));}}
else
return unescape(document.cookie.substring(len,end));}}}}
function getCookies_ex(name,type)
{{if(FlashInstalled)
{return thisMovie("myFlash").getCookie(name);}
else
{if(document.cookie=="")
{return cookiestr;}
else
{var start=document.cookie.indexOf(name+"=");var len=start+name.length+1;if((!start)&&(name!=document.cookie.substring(0,name.length)))
{return null;}
if(start==-1)return null;var end=document.cookie.indexOf(";",len);if(end==-1)end=document.cookie.length;if(name=="12530_listenings")
{if(typeof(type)!="undefined")
return unescape(document.cookie.substring(len,end));else
{return specail_deal(unescape(document.cookie.substring(len,end)));}}
else
return unescape(document.cookie.substring(len,end));}}}}
function setCookies_ex(name,value,expires,path,domains,secure)
{{if(FlashInstalled)
{thisMovie("myFlash").setCookie(name,value);}
else
{var domain2=domains;var today=new Date();today.setTime(today.getTime());if(expires)
{expires=expires*1000*60*60*24;}
var expires_date=new Date(today.getTime()+(expires));document.cookie=name+"="+escape(value)+
((expires)?";expires="+expires_date.toGMTString():"")+
((path)?";path="+path:"")+
((domain2)?";domain="+domain2:"")+
((secure)?";secure":"");}}}
function deleteCookies(name,path,domains)
{if(nowsonglist!=0)
{value="";if(name=="12530_listenings")
nowsonglistdetail=value;else
{if(FlashInstalled)
{thisMovie("myFlash").setCookie(name,value);}
else
{var domain2=domains;var today=new Date();today.setTime(today.getTime());if(expires)
{expires=expires*1000*60*60*24;}
var expires_date=new Date(today.getTime()+(expires));document.cookie=name+"="+escape(value)+
((expires)?";expires="+expires_date.toGMTString():"")+
((path)?";path="+path:"")+
((domain2)?";domain="+domain2:"")+
((secure)?";secure":"");}}}
else
{if(FlashInstalled)
{thisMovie("myFlash").setCookie(name,"");}
else
{var domain2=domains;deleteCookies_old(name,path,domain2);if(getCookies(name))document.cookie=name+"="+
((path)?";path="+path:"")+
((domain2)?";domain="+domain2:"")+";expires=Thu, 01-Jan-1970 00:00:01 GMT";}}}
function deleteCookies_old(name,path,domains)
{var domain2="music.10086.cn";if(getCookies(name))document.cookie=name+"="+
((path)?";path="+path:"")+
((domain2)?";domain="+domain2:"")+";expires=Thu, 01-Jan-1970 00:00:01 GMT";}
function deleteCookies_olds(name,path,domains)
{var domain2=domains;if(getCookies(name))document.cookie=name+"="+
((path)?";path="+path:"")+
((domain2)?";domain="+domain2:"")+";expires=Thu, 01-Jan-1970 00:00:01 GMT";}
function win_open(type)
{var winurl="";if(newifmore==1)
{cookiestrs=getCookies("12530_listenings",'',1);arrs=cookiestrs.split("#");nums=arrs.length;cnw=nums-1-newsongnums<0?0:nums-1-newsongnums;setCookies("curid_new",cnw,189,"/");newsongnums=0;latest_id=0;}
wlh=window.location.href;if(typeof(wlh)!="undefined")
{url=wlh.split("/");if(url[2]!="")
winurl=url[2];}
if(winurl=="")
winurl="music.10086.cn";var winop=window.open("http://"+winurl+"/newweb/html/player/v3_player.htm","orders");winop.focus();}
function show_whole_par(str,tstr)
{tstrs=str.split("|");if(tstrs.length>15)
return str;else
{tstr_t=tstr.split(',');for(i=0;i<tstr_t.length;i++)
{tsp=tstr.split("#");for(ii=0;ii<tsp.length;ii++)
{if(tsp[ii]==str)
{return str+tstr[1];}}}}}
function del_more_cookie(cookie_values,optype)
{deleteCookies("12530_listenings","/");cookie_value=cookie_values;setCookies("12530_listenings",cookie_value,189,"/",'','',optype);}
function show_10(str,num,s)
{strss=str.split("|");var strs="";if(typeof(s)!="undefined")
sz=s;else
sz=strss.length;for(j=num;j<sz;j++)
{strs+="|"+strss[j];}
return strs;}
function show_10_old(str,num)
{tt=""
strs=str.split(",");if(num==1)
return strs[strs.length-1];else
{for(i=0;i<strs.length-1;i++)
{tt+=strs[i];}
return tt;}}
function chnnael_cookie(org,newcookie)
{if(org==""||org==null||typeof(org)=="undefined")
{newnum=newcookie.split(",");newcookie_mod=newcookie.split("#");if(newnum.length<2)
{newcookies="#"+show_10(newcookie_mod[1],1,10)+","+show_10(newcookie_mod[1],10)}
else
newcookies=newcookie;return newcookies;}
else
{var nt="";newtstr=newcookie.split('#');newtstrs=newtstr[1];if(org==""||org==null)
{tts="#"+show_10(newtstrs,1,10)+","+show_10(newtstrs,10);return tts;}
oldtstr=org.split('#');oldtstrs=oldtstr[oldtstr.length-1];if(show_10_old(oldtstrs,1)==show_10(newtstrs,10))
{res=(show_10_old(org,0)+"#"+show_10(newtstrs,1,10)+","+show_10(newtstrs,10));return res;}
else
{newnum=newcookie.split(",");newcookie_mod=newcookie.split("#");if(newnum.length<2)
{newcookies="#"+show_10(newcookie_mod[1],1,10)+","+show_10(newcookie_mod[1],10)}
else
newcookies=newcookie;return org+newcookies;}}}
var newsongnums=0;var newifmore=0;function SaveMusicCookie(songid,songname,singername,trynum,ordernum,recomm,listen_url,page,menu,sn,channel,childchannel,mtype,ifmore,from,fromchnl,fromcchnl,salesid,ordertype,fromtype,nodeid,winopen,optype,ifsub)
{if(songid==""||songid==0||songid==null||songname==""||songname=="undefined"||typeof(songname)=="undefined")
return false;if(typeof(optype)=='undefined'||optype==''||optype=='undefined')
{optype='AddMusic';}
if(typeof(from)=='undefined'||from==''||from=='undefined')
{from='';}
if(typeof(fromchnl)=='undefined'||fromchnl==''||fromchnl=='undefined')
{fromchnl='';}
if(typeof(fromcchnl)=='undefined'||fromcchnl==''||fromcchnl=='undefined')
{fromcchnl='';}
if(typeof(salesid)=='undefined'||salesid==''||salesid=='undefined')
{salesid='';}
if(typeof(channel)=='undefined'||channel==''||channel=='undefined')
{channel='';}
if(typeof(cchannel)=='undefined'||cchannel==''||cchannel=='undefined')
{cchannel='';}
if(typeof(page)=='undefined'||page==''||page=='undefined')
{page='';}
if(typeof(menu)=='undefined'||menu==''||menu=='undefined')
{menu='';}
if(typeof(sn)=='undefined'||sn==''||sn=='undefined')
{sn='';}
if(typeof(producttype)=='undefined'||producttype==''||producttype=='undefined')
{producttype='';}
if(typeof(ordertype)=='undefined'||ordertype==''||ordertype=='undefined')
{ordertype='';}
if(typeof(fromtype)=='undefined'||fromtype==''||fromtype=='undefined'||fromtype=='_')
{fromtype=0;}
if(typeof(nodeid)=='undefined'||nodeid==''||nodeid=='undefined'||nodeid=='_')
{nodeid=0;}
if(typeof(singid)=='undefined'||singid==''||singid=='undefined'||singid=='_')
{singid=0;}
if(typeof(ifsub)=='undefined'||ifsub==''||ifsub=='undefined'||ifsub=='_')
{ifsub=0;}
if(ifsub==1)
{ifclicksub=2;setCookies("ifclicksub",2,189,"/");}
isnew=true;cookiename=cookie_name;num=0;if(typeof(ifmore)=="undefined")
ifmore="";newifmore=ifmore;cookie_value=getCookies(cookiename,1,optype);if(cookie_value==null||cookie_value==""&&ifmore!=2)
{setCookies("curid_new",0,189,"/");cookie_value="";}
if(ifmore==1)
newsongnums++;cookie_value2="";cookie_values="";if(cookie_value!=null&&cookie_value!="")
{arr=cookie_value.split("#");num=arr.length;if(num>LISTEN_NUM)
{cookie_values="";startnum=num-LISTEN_NUM+1;for(i=startnum;i<LISTEN_NUM+1;i++)
{cookie_values+="#"+arr[i];}}
if(cookie_values!="")
{del_more_cookie(cookie_values,optype);}
cookie_value=getCookies(cookiename,1,optype);arr=cookie_value.split("#");num=arr.length;if(latest_id==0)
{newlar=arr[num-1].split("|");latest_id=newlar[6];}
var cookie_valuetemp="";for(i=1;i<num;i++)
{row=arr[i].split("|");if(row[6]==songid)
{}
else
{if(typeof(winopen)=="undefined"&&ifmore==0)
{if(num>=1)
setCookies("curid_new",num-1,189,"/");else
setCookies("curid_new",0,189,"/");}
cookie_valuetemp+="#"+arr[i];}
if((latest_id!=0&&latest_id!="d"&&latest_id==row[6])&&ifmore==1)
{setCookies("curid_new",i,189,"/");}}
cookie_value=cookie_valuetemp;}
else
latest_id="d";if(isnew)
{cookie_value2="#|"+decodeURI(songname)+"|"+decodeURI(singername)+"||||"+songid+"|"+page+"|"+menu+"|"+sn+"|"+channel+"|"+childchannel+"|"+mtype+"|"+from+"|"+fromchnl+"|"+fromcchnl+"|"+salesid+"|"+ordertype+"|3|"+nodeid;}
else
{cookie_value2="";if(typeof(winopen)=="undefined"&&ifmore==0)
win_open();return false;}
if(cookie_value2!=null&&cookie_value2!="")
{cookie_value_join=chnnael_cookie(cookie_value,cookie_value2);setCookies(cookiename,cookie_value_join,189,"/",'','',optype);}
if((typeof(winopen)=="undefined"||winopen=="")&&ifmore==0)
{cookiestrs=getCookies("12530_listenings",'',optype);arrs=cookiestrs.split("#");nums=arrs.length;if(nums-2>0)
ns=nums-2;else
ns=0;setCookies("curid_new",ns,189,"/");win_open();}
if(ifmore==0)
try{cookie_value2="#|"+decodeURI(songname)+"|"+decodeURI(singername)+"||||"+songid+"|"+page+"|"+menu+"|"+sn+"|"+channel+"|"+childchannel+"|"+mtype+"|"+from+"|"+fromchnl+"|"+fromcchnl+"|"+salesid+"|"+ordertype+"|3|"+nodeid;var LogType=optype;var largs=LogType+"|^|"+from+"|^|"+fromchnl+"|^|"+fromcchnl+"|^|"+channel+"|^|"+childchannel+"|^|"+page+"|^|"+menu+"|^|"+parseInt(sn)+"|^|"+songid;var sendlogurl=X.PATH.SUPPORT+"jsp/common/player_log.jsp?args="+encodeURI(largs);remoteRequest(sendlogurl);}catch(e){}}
function join_str(a_p,b_p)
{ret="";arrss_s=a_p.split("#");arr_l=a_p.split("|");arrs_s=arrss_s;for(i=1;i<arrs_s.length;i++)
{ret+="#"+arrs_s[i]+b_p;}
return ret;}
function specail_deal(str)
{if(str==""||str==null||str=="undefined")
return"";arrss=str.split("#");if(arrss.length==2)
return str;ret_rps="";bs="";arrs_p=str.split(",");p=arrs_p.length-1;for(iss=0;iss<p;iss++)
{dot="";dot=arrs_p[iss+1].split("#");bs=join_str(arrs_p[iss],dot[0]);ret_rps=ret_rps+bs;}
return ret_rps;}
function getCookies(name,type,optype)
{if(nowsonglist!=0&&optype!="autocookie")
{if(name=="12530_listenings")
return nowsonglistdetail;else
{if(FlashInstalled)
{return thisMovie("myFlash").getCookie(name);}
else
{if(document.cookie=="")
{return cookiestr;}
else
{var start=document.cookie.indexOf(name+"=");var len=start+name.length+1;if((!start)&&(name!=document.cookie.substring(0,name.length)))
{return null;}
if(start==-1)return null;var end=document.cookie.indexOf(";",len);if(end==-1)end=document.cookie.length;if(name=="12530_listenings")
{if(typeof(type)!="undefined")
return unescape(document.cookie.substring(len,end));else
{return specail_deal(unescape(document.cookie.substring(len,end)));}}
else
return unescape(document.cookie.substring(len,end));}}}}
else
{if(FlashInstalled)
{return thisMovie("myFlash").getCookie(name);}
else
{if(document.cookie=="")
{return cookiestr;}
else
{var start=document.cookie.indexOf(name+"=");var len=start+name.length+1;if((!start)&&(name!=document.cookie.substring(0,name.length)))
{return null;}
if(start==-1)return null;var end=document.cookie.indexOf(";",len);if(end==-1)end=document.cookie.length;if(name=="12530_listenings")
{if(typeof(type)!="undefined")
return unescape(document.cookie.substring(len,end));else
{return specail_deal(unescape(document.cookie.substring(len,end)));}}
else
return unescape(document.cookie.substring(len,end));}}}}
