function onclick_solink(o,fr){
var k=$("soform_keyword");
if(k){
if(k.value==ERROR_NO_SEARCHCONTENT){
k.value="";
}else{
if(k.value.length>0){
var h=o.href;
var q=encodeURIComponent(k.value);
if(h.indexOf("q=")!=-1){
o.href=h.replace(new RegExp("q=[^&$]*"),"q="+q);
}else{
if(o.href.toString().indexOf("?")>0){
o.href+="&q="+q;
}else{
o.href+="?q="+q;
}
}
o.href=o.href.replace(new RegExp("fr=[^&$]*"),"fr="+fr);
}
}
}
}
function onsubmit_soform(){
var k=$("soform_keyword");
if(k){
if(k.value==ERROR_NO_SEARCHCONTENT){
k.value="";
}
}
}
function show_sousermore(){
var d=$("soform_usermore");
if(d){
Element.show(d);
}
}
function hide_sousermore(){
var d=$("soform_usermore");
if(d){
Element.hide(d);
}
}
function show_soartisttab(_9,_a,_b){
for(var i=1;i<=_b;i++){
var _d=$(_9+i);
var _e=$(_9+"tab"+i);
if(_d&&_e){
Element.hide(_d);
_e.className="linktab";
}
}
var _d=$(_9+_a);
var _e=$(_9+"tab"+_a);
if(_d&&_e){
Element.show(_d);
_e.className="linktabcur";
}
}
function clearoption_sor(_f){
for(var i=_f.options.length-1;i>=0;i--){
_f.remove(0);
}
}
function addoption_sor(sel,opt){
try{
sel.add(opt);
}
catch(e){
sel.add(opt,null);
}
}
function onchange_sorcountry(){
var cty=$("sorfilter_country");
var cbr=$("sorfilter_citybar");
var prv=$("sorfilter_province");
if(cty&&cbr&&prv){
if(parseInt(cty.value)==1){
Element.show(cbr);
}else{
Element.hide(cbr);
}
prv.selectedIndex=0;
onchange_sorprovince();
}
}
function onchange_sorprovince(){
var prv=$("sorfilter_province");
var cty=$("sorfilter_city");
if(prv&&cty){
var _18=parseInt(prv.value);
if(_18==0){
Element.hide(cty);
clearoption_sor(cty);
}else{
var _19=YOBO_SETTING_CITY[_18];
var len=_19.length;
clearoption_sor(cty);
for(var i=0;i<len;i++){
addoption_sor(cty,new Option(_19[i].name,_19[i].id));
}
Element.show(cty);
}
}
}
function init_sorcountry(){
var cty=$("sorfilter_country");
if(cty){
cty.selectedIndex=0;
onchange_sorcountry();
}
}
function onshow_uplyric(div,sid){
var dlg=$("sor_uplyricdlg");
var cnt=$("sor_uplyric_content");
var hid=$("sor_uplyric_id");
var yb=$("yobo");
if(yb&&dlg&&hid&&cnt){
before_showfloatdialog();
var wd=500;
var wy=yb.offsetWidth;
var yl=getPos(yb,"Left");
dlg.style.top=getPos(div,"Top")+"px";
dlg.style.left=(Math.floor((wy-wd)/2)+yl)+"px";
hid.value=sid;
Element.show(dlg);
}
}
function soh_onsubmitlyric(div){
var cnt=$("sor_uplyric_content");
if(cnt){
if(cnt.value.length==0){
alert(ERROR_NO_UPLOADCONTENT);
}else{
if(cnt.value.length>2048){
alert(MSG_UPLOADCONTENTMAX);
}else{
show_loading(div);
return true;
}
}
}
return false;
}
if(typeof (yobo_soLoopItem)!="function"){
var yobo_soLoopItem=Class.create();
yobo_soLoopItem.prototype={initialize:function(_28,_29,_2a){
try{
if($(_28)){
this.loopItem=$(_28);
this.startDelay=_29*1000;
this.loopInterval=_2a*1000;
if(this.loopInterval<5000){
this.loopInterval=5000;
}
this.updatePlus=8;
this.loopTimer=null;
this.updateInterval=10;
this.offsetHeight=0-this.loopItem.parentNode.offsetHeight;
this.targetHeight=this.offsetHeight;
this.updateHeight=this.offsetHeight/this.updateInterval;
this.totalHeight=this.loopItem.offsetHeight;
this.loopItem.style.top="0px";
var _2b=this;
this.loopTimer=setTimeout(function(){
_2b.loopFunc();
},this.startDelay);
}
}
catch(e){
traceError("Error yobo_soLoopItem::startLoop -> "+e);
}
},loopFunc:function(){
try{
if(this.loopTimer){
clearTimeout(this.loopTimer);
}
var _2c=parseInt(this.loopItem.style.top);
if(_2c==this.targetHeight){
if(this.offsetHeight>0){
if(this.targetHeight>=0){
this.offsetHeight=0-this.offsetHeight;
this.updateHeight=this.offsetHeight/this.updateInterval;
}
}else{
if(this.targetHeight+this.offsetHeight+this.totalHeight<=0){
this.offsetHeight=0-this.offsetHeight;
this.updateHeight=this.offsetHeight/this.updateInterval;
}
}
this.targetHeight=this.targetHeight+this.offsetHeight;
var _2d=this;
this.loopTimer=setTimeout(function(){
_2d.loopFunc();
},this.loopInterval);
}else{
this.loopItem.style.top=(_2c+this.updateHeight)+"px";
var _2d=this;
this.loopTimer=setTimeout(function(){
_2d.loopFunc();
},(this.updatePlus*this.updateInterval));
}
}
catch(e){
traceError("Error yobo_soLoopItem::loopFunc -> "+e);
}
}};
}
if(typeof (yobo_soSearchItem)!="function"){
var yobo_soSearchItem=Class.create();
yobo_soSearchItem.prototype={initialize:function(fr,_2f,q){
this.itemList=[];
this.isInit=false;
this.fr=fr;
this.defaultQ=q;
this.actionPrefix=_2f;
this.listTimer=null;
},addItem:function(_31,_32,_33){
try{
var isd=_33||false;
this.itemList.push({n:_31,v:_32,d:isd});
}
catch(e){
traceError("Error yobo_soSearchItem::addItem -> "+e);
}
},drawForm:function(_35){
try{
if($(_35)&&this.itemList.length>0){
var _36=this;
this.container=$(_35);
this.form=document.createElement("form");
this.form.className="sorsearchform";
this.form.action=this.actionPrefix;
this.container.appendChild(this.form);
this.form.onsubmit=function(){
return _36.checkForm();
};
this.listbtn=document.createElement("a");
this.listbtn.href="javascript:void(0);";
this.listbtn.className="searchbtndown";
this.listbtn.innerHTML="&nbsp;";
this.form.appendChild(this.listbtn);
this.submitbtn=document.createElement("a");
this.submitbtn.href="#";
this.submitbtn.className="searchtext";
this.submitbtn.innerHTML="&nbsp;";
this.form.appendChild(this.submitbtn);
Event.observe(this.submitbtn,"click",this.submitForm.bindAsEventListener(this));
this.input=document.createElement("input");
this.input.type="text";
this.input.className="searchinpt";
this.input.name="q";
if(this.defaultQ.length>0){
this.input.value=this.defaultQ;
}else{
this.input.value=MSG_INPUTVALUEDEFAULT[11];
}
this.form.appendChild(this.input);
Event.observe(this.input,"focus",this.inputFocus.bindAsEventListener(this));
this.hiddeninput=document.createElement("input");
this.hiddeninput.type="hidden";
this.hiddeninput.name="action";
this.hiddeninput.value="";
this.form.appendChild(this.hiddeninput);
this.hiddenfr=document.createElement("input");
this.hiddenfr.type="hidden";
this.hiddenfr.name="fr";
this.hiddenfr.value=this.fr;
this.form.appendChild(this.hiddenfr);
this.hiddensubmit=document.createElement("input");
this.hiddensubmit.type="image";
this.hiddensubmit.src="/images/blank_image.gif";
this.form.appendChild(this.hiddensubmit);
this.downlist=document.createElement("div");
this.downlist.className="searchlist";
this.downlist.style.display="none";
this.form.appendChild(this.downlist);
for(var i=0;i<this.itemList.length;i++){
var itm=this.itemList[i];
var tmp=document.createElement("a");
tmp.className="linklist";
tmp.href="javascript:void(0);";
tmp.innerHTML=itm.n;
tmp.name=itm.v;
this.downlist.appendChild(tmp);
tmp.onclick=function(){
_36.clickList(this);
};
if(itm.d){
this.submitbtn.innerHTML=itm.n;
this.hiddeninput.value=itm.v;
this.form.action=this.actionPrefix+itm.v;
}
}
Event.observe(this.listbtn,"mouseover",this.showList.bindAsEventListener(this));
Event.observe(this.downlist,"mouseover",this.showList.bindAsEventListener(this));
Event.observe(this.listbtn,"mouseout",this.outList.bindAsEventListener(this));
Event.observe(this.downlist,"mouseout",this.outList.bindAsEventListener(this));
this.isInit=true;
}
}
catch(e){
traceError("Error yobo_soSearchItem::drawForm -> "+e);
}
},inputFocus:function(){
try{
if(this.isInit){
if(this.input.value==MSG_INPUTVALUEDEFAULT[11]){
this.input.value="";
}
this.input.select();
}
}
catch(e){
traceError("Error yobo_soSearchItem::inputFocus -> "+e);
}
},submitForm:function(){
try{
if(this.isInit){
this.form.submit();
}
}
catch(e){
traceError("Error yobo_soSearchItem::inputFocus -> "+e);
}
},checkForm:function(){
try{
if(this.isInit){
if(this.input.value==MSG_INPUTVALUEDEFAULT[11]){
this.input.value="";
}
if(this.input.value==""){
alert(ERROR_NO_SEARCHCONTENT);
}else{
return true;
}
}
}
catch(e){
alert(e);
traceError("Error yobo_soSearchItem::inputFocus -> "+e);
}
return false;
},clickList:function(_3a){
try{
if(this.isInit){
this.submitbtn.innerHTML=_3a.innerHTML;
this.hiddeninput.value=_3a.name;
this.form.action=this.actionPrefix+_3a.name;
this.hideList();
}
}
catch(e){
traceError("Error yobo_soSearchItem::clickList -> "+e);
}
},showList:function(){
try{
if(this.isInit){
if(this.listTimer){
clearTimeout(this.listTimer);
}
traceError("show:"+this.listbtn.className);
this.listbtn.className="searchbtnup";
Element.show(this.downlist);
}
}
catch(e){
traceError("Error yobo_soSearchItem::showList -> "+e);
}
},outList:function(){
try{
if(this.isInit){
var _3b=this;
this.listTimer=setTimeout(function(){
_3b.hideList();
},500);
}
}
catch(e){
traceError("Error yobo_soSearchItem::hideList -> "+e);
}
},hideList:function(){
try{
if(this.isInit){
this.listbtn.className="searchbtndown";
Element.hide(this.downlist);
}
}
catch(e){
traceError("Error yobo_soSearchItem::hideList -> "+e);
}
}};
}
