var HotSongSize=0,HotSongIndex=-1,DoubleClick=true;function GetTopVipPromotion(a,b){b=="true"&&new Ajax.Request("/index.click.jsp",{method:"post",parameters:"tag=3"});new Ajax.Updater("topvip","/Main/index.topvipshow.jsp",{parameters:{mdid:a}})}
function NewIndexHref(a,b){var c=location.href,d=false;if(c.indexOf("fetnet.ikala.tv")>0||c.indexOf("hikala04.ikala.tv")>0)d=true;if(d)if(a==101||a==103)fetCTR("R","R1");else if(a==102||a==104)fetCTR("R","R2");new Ajax.Request("/index.click.jsp",{method:"post",parameters:"tag="+a});window.location.href=b}
function NewIndexOpen(a,b){var c=location.href,d=false;if(c.indexOf("fetnet.ikala.tv")>0||c.indexOf("hikala04.ikala.tv")>0)d=true;if(d)if(a==33)fetCTR("R","R5");else if(a==105||a==106||a==107||a==108)fetCTR("R","R3");else if(a==109||a==110||a==111||a==112)fetCTR("R","R4");new Ajax.Request("/index.click.jsp",{method:"post",parameters:"tag="+a});window.open(b,"NewIndex")}
function IndexOpenModify(a,b){var c=location.href,d=false;if(c.indexOf("fetnet.ikala.tv")>0||c.indexOf("hikala04.ikala.tv")>0)d=true;if(d)if(a=="201011001"||a=="201011002")fetCTR("R","R1");new Ajax.Request("/index.click.jsp",{method:"post",parameters:"tag="+a});window.open(b,"NewIndex")}function NewUploadMusicTrans(a,b,c,d){new Ajax.Request("/index.click.jsp",{method:"post",parameters:"tag="+a});Add_MyMusic(b,c,d)}
function NewUploadGetPageTrans(a,b){new Ajax.Request("/index.click.jsp",{method:"post",parameters:"tag="+a});ikalaGetNew(b)}function RandomFriend(a,b,c){if(a=="false")new Ajax.Request("/index.click.jsp",{method:"post",parameters:"tag=13"});else new Ajax.Request("/index.click.jsp",{method:"post",parameters:"tag=14"});new Ajax.Updater("index.iFriend","/Main/index.ifriend.jsp",{parameters:"sex="+a+"&r="+b+"&r2="+c})}
function ChangePKtag(a){if(a=="new")new Ajax.Request("/index.click.jsp",{method:"post",parameters:"tag=23"});else new Ajax.Request("/index.click.jsp",{method:"post",parameters:"tag=24"});new Ajax.Updater("index.PK","/Main/index.pk.jsp",{parameters:"type="+a})}
function ChangeSongFlash(a){var b=location.href,c=false;if(b.indexOf("fetnet.ikala.tv")>0||b.indexOf("hikala04.ikala.tv")>0)c=true;if(a=="promotion"){new Ajax.Request("/index.click.jsp",{method:"post",parameters:"tag=29"});c&&fetCTR("R","R1")}else if(a=="hot"){new Ajax.Request("/index.click.jsp",{method:"post",parameters:"tag=30"});c&&fetCTR("R","R2")}else if(a=="new"){new Ajax.Request("/index.click.jsp",{method:"post",parameters:"tag=31"});c&&fetCTR("R","R3")}else if(a=="free"){new Ajax.Request("/index.click.jsp",
{method:"post",parameters:"tag=32"});c&&fetCTR("R","R4")}else a=="mktHot"&&new Ajax.Request("/index.click.jsp",{method:"post",parameters:"tag=100810"});b="type="+a;if(a=="hot"||a=="promotion"){b+="&ajaxReload=true";new Ajax.Request("/Main/index.ksong.jsp",{method:"post",parameters:b,onComplete:function(d){d=d.responseText.trim().split("===Ajax===");$("index.player").innerHTML=d[0];IndexKsongSizeInit(d[1]);DefaultIndexFlashKsong(0,d[2],d[3],"")}})}else new Ajax.Updater("index.ksong","/Main/index.ksong.jsp",
{parameters:b})}function IndexKsongSizeInit(a){HotSongSize=a}
function ChangeIndexKsongDisplay(a){if(DoubleClick){DoubleClick=false;if(a=="up"){if($("hotSongUl"+(HotSongSize-1)))if($("hotSongUl"+(HotSongSize-1)).style.display=="block"){for(a=0;a<HotSongSize;a++)if(a<=3)$("hotSongUl"+a).style.display="block";else $("hotSongUl"+a).style.display="none";DoubleClick=true;return}for(a=0;a<HotSongSize;a++)if($("hotSongUl"+a))if($("hotSongUl"+a).style.display=="block"){$("hotSongUl"+a).style.display="none";break}for(a=0;a<HotSongSize;a++)if($("hotSongUl"+a))if($("hotSongUl"+
a).style.display=="block"){$("hotSongUl"+(a+3)).style.display="block";break}}else if(a=="down"){if($("hotSongUl0"))if($("hotSongUl0").style.display=="block"){for(a=HotSongSize-1;a>=0;a--)if(a>HotSongSize-5)$("hotSongUl"+a).style.display="block";else $("hotSongUl"+a).style.display="none";DoubleClick=true;return}for(a=HotSongSize-1;a>=0;a--)if($("hotSongUl"+a))if($("hotSongUl"+a).style.display=="block"){$("hotSongUl"+a).style.display="none";break}for(a=HotSongSize-1;a>=0;a--)if($("hotSongUl"+a))if($("hotSongUl"+
a).style.display=="block"){$("hotSongUl"+(a-3)).style.display="block";break}}DoubleClick=true}}
function DefaultIndexFlashKsong(a,b,c,d){if(a>-1)HotSongIndex=a;for(a=0;a<HotSongSize;a++)if($("un"+a))if(HotSongIndex==a)$("un"+a).innerHTML="";else $("un"+a).innerHTML='<img src="/index_images/unitMvF.png" width="60" height="44" border="0" class="mask" />';$("index.flashcontent").innerHTML="<div style='text-align:center;padding:50px;' ><img src='/ikala_images/reg_yz.gif'/>loading...</div>";d!=""&&new Ajax.Request("/index.click.jsp",{method:"post",parameters:"tag="+d});GetFlashMovie_index("index.flashcontent",
"#869ca7","/PK/player/pk_music_integrated.swf?togra="+b,"flashmovieid","340","358");b="<a href=\"javascript:NewIndexOpen(100,'"+c+'\');" title="\u6211\u4e5f\u8981\u5531\u9019\u9996\u6b4c" style="position:absolute; bottom:92px; left:0px;"><img src="/index_images/gosingBtn.png" width="306" height="62" border="0" /></a>';$("index.flashcontent").innerHTML+=b}
var sUserAgent=navigator.userAgent,isOpera=sUserAgent.indexOf("Opera")>-1,isIE=sUserAgent.indexOf("compatible")>-1&&sUserAgent.indexOf("MSIE")>-1&&!isOpera;
function NewIndexLoadTop10(a,b){if(a==1){new Ajax.Request("/index.click.jsp",{method:"post",parameters:"tag=201011009"});b==2&&new Ajax.Request("/index.click.jsp",{method:"post",parameters:"tag=201011014"})}else if(a==2){new Ajax.Request("/index.click.jsp",{method:"post",parameters:"tag=201011010"});b==2&&new Ajax.Request("/index.click.jsp",{method:"post",parameters:"tag=201011017"})}else if(a==3){new Ajax.Request("/index.click.jsp",{method:"post",parameters:"tag=201011011"});b==2&&new Ajax.Request("/index.click.jsp",
{method:"post",parameters:"tag=201011020"})}$j("#innerTop10").fadeTo(500,0.5,function(){$j.post("/Main/index.top10.jsp",{tag:a,pages:b},function(c){$j("#innerTop10").html($j.trim(c));isIE?$j("#innerTop10").fadeTo(1E3):$j("#innerTop10").fadeTo(1E3,1)})})}
function JoinFans(a,b,c){new Ajax.Request("/index.click.jsp",{method:"post",parameters:"tag=201011018"});if(a==null||a==""){alert("\u8acb\u5148\u767b\u5165iKala\u611b\u5361\u62c9\u6703\u54e1\u5594\uff01");window.location.replace("/login.jsp");return false}else $j.post("/servlet/AddToFans_Servlet",{mdid:b},function(d){switch($j.trim(d)){case "addsucc":alert("\u606d\u559c\uff0c\u60a8\u5df2\u7d93\u6210\u70ba"+c+"\u7684\u7c89\u7d72\uff01");break;case "addfault":alert("\u51fa\u932f\u5566\uff0c\u8acb\u91cd\u8a66\uff01");
break;case "nologin":alert("\u8acb\u5148\u767b\u5165iKala\u611b\u5361\u62c9\u6703\u54e1\u5594\uff01");window.location.replace("/login.jsp");break;case "nomdid":alert("\u4f3a\u670d\u5668\u932f\u8aa4\uff0c\u8acb\u91cd\u8a66\uff01");break;case "alreadyfans":alert("\u60a8\u5df2\u7d93\u662f"+c+"\u7684\u7c89\u7d72\uff0c\u8acb\u52ff\u91cd\u8907\uff01");break;case "blacklist":alert("\u4ed6\u5728\u4f60\u7684\u9ed1\u540d\u55ae\u88e1\uff0c\u4e0d\u80fd\u6210\u70ba\u5c0d\u65b9\u7684\u7c89\u7d72\uff01");break;
case "hisBlackList":alert("\u62b1\u6b49\u5594~\u7248\u4e3b\u4e0d\u8b93\u4f60\u6210\u70ba\u4ed6\u7684\u7c89\u7d72\u54e6!");break;case "addmyself":alert("\u81ea\u5df1\u4e0d\u80fd\u52a0\u5165\u81ea\u5df1\u70ba\u7c89\u7d72\u5594\uff01\uff01");break;case "nocookies":alert("\u60a8\u7684\u6d41\u89bd\u5668\u6c92\u6709\u6253\u958bcookies\uff0c\u9019\u6a23\u7121\u6cd5\u767b\u5165\uff0c\u8acb\u5148\u8a2d\u7f6e\uff01");break}})};

