var DB_mode=false;function DumpError(a){try{throw a;}catch(b){DumpException(b)}}
function DumpException(a,b){b="Javascript exception: "+(b?b:"")+" "+a;if(BR_IsIE())b+=" "+a.name+": "+a.message+" ("+a.number+")";var c="";if(typeof a=="string")c=a+"\n";else for(var d in a)try{c+=d+": "+a[d]+"\n"}catch(e){}c+=DB_GetStackTrace(DumpException.caller);a=b+"\n"+c;if(DB_mode){try{var g=(new Date).getTime()-DB_starttime,f="["+g+"] "+HtmlEscape(a).replace(/\n/g,"<br>")+"<br>";f="<font color=#ff0000><b>Error: "+f+"</b></font>";DB_win.focus()}catch(k){}DB_WriteDebugHtml(f)}else typeof log!=
"undefined"&&log(HtmlEscape(a))}var function_name_re_=/function (\w+)/;
function DB_GetStackTrace(a){try{if(!BR_IsIE()&&!(BR_AgentContains_("safari")||BR_AgentContains_("konqueror"))&&BR_AgentContains_("mozilla"))return Error().stack;if(!a)return"";var b;var c=function_name_re_.exec(String(a));b=c?c[1]:"";b="- "+b+"(";for(c=0;c<a.arguments.length;c++){if(c>0)b+=", ";var d=String(a.arguments[c]);if(d.length>40)d=d.substr(0,40)+"...";b+=d}b+=")\n";b+=DB_GetStackTrace(a.caller);return b}catch(e){return"[Cannot get stack trace]: "+e+"\n"}}
var DB_starttime,DB_win=null,DB_winopening=false;
function DB_WriteDebugHtml(a){if(DB_mode)try{if((DB_win==null||DB_win.closed)&&!DB_winopening)try{DB_winopening=true;DB_win=window.open("","debug","width=700,height=500,toolbar=no,resizable=yes,scrollbars=yes,left=16,top=16,screenx=16,screeny=16");DB_win.blur();DB_win.document.open();DB_winopening=false;var b="<font color=#ff0000><b>To turn off this debugging window,hit 'D' inside the main caribou window, then close this window.</b></font><br>";DB_WriteDebugHtml(b)}catch(c){}DB_win.document.write(a);DB_win.scrollTo(0,
1E6)}catch(d){}};function BR_AgentContains_(a){if(a in BR_AgentContains_cache_)return BR_AgentContains_cache_[a];return BR_AgentContains_cache_[a]=navigator.userAgent.toLowerCase().indexOf(a)!=-1}var BR_AgentContains_cache_={};function BR_IsIE(){return BR_AgentContains_("msie")&&!window.opera}function GetPageOffset(a){var b=a.offsetLeft,c=a.offsetTop;if(a.offsetParent!=null){a=GetPageOffset(a.offsetParent);b+=a.x;c+=a.y}return{x:b,y:c}}var amp_re_=/&/g,lt_re_=/</g,gt_re_=/>/g;
function HtmlEscape(a){if(!a)return"";return a.replace(amp_re_,"&amp;").replace(lt_re_,"&lt;").replace(gt_re_,"&gt;").replace(quote_re_,"&quot;")}var quote_re_=/\"/g,plus_re_=/\+/g;function CancelEvent(a){if(BR_IsIE())a.cancelBubble=true;else a.stopPropagation&&a.stopPropagation()}function forid_1(a){return document.getElementById(a)}function forid_2(a){return document.all[a]}var forid=document.getElementById?forid_1:forid_2;
function log(a){try{if(window.parent!=window&&window.parent.log){window.parent.log(window.name+"::"+a);return}}catch(b){}var c=forid("log");if(c){a="<p class=logentry><span class=logdate>"+new Date+"</span><span class=logmsg>"+a+"</span></p>";c.innerHTML=a+c.innerHTML}else window.status=a};var Utils={};Utils.MARKER_NUMBER="#";Utils.MARKER_EMPTY="*";Utils.ER_QUERY_RE=/_QUERY_/g;Utils.bids=[];Utils.adjustBillboardPreview=function(a){Utils.bids.push(a);Utils.adjustLines(a,8,0,1,false)};
Utils.adjustLines=function(a,b,c,d,e){a=DM_GlobalDom.$(a).getElementsByTagName("tbody")[0];var g=a.getElementsByTagName("tr");d=g.length-d;c=c;for(var f=1;c<d;c++){if(g[c].getElementsByTagName("td")[0].innerHTML==Utils.MARKER_NUMBER){if(f==b+1)break;g[c].getElementsByTagName("td")[0].innerHTML=f;f++}else if(g[c].getElementsByTagName("td")[0].innerHTML==Utils.MARKER_EMPTY){if(f==b+1)break;g[c].getElementsByTagName("td")[0].innerHTML="&nbsp;";f++}if(e&&f%2==1)g[c].className="grayrow"}b=c-1;for(c=d-
1;c>b;c--)a.removeChild(g[c])};Utils.U_AppendParam1=function(a,b,c){var d=a.indexOf("?");if(d<0){a+="?";d=a.length-1}return d==a.length-1||d<0?a+b+"="+encodeURIComponent(c):a+("&"+b+"="+encodeURIComponent(c))};
Utils.redirectClipToDetail=function(a){if(window==top){var b;b={};a=a.split("?");a=a[a.length-1].split("&");for(var c=0;c<a.length;c++){var d=a[c].split("=");if(d[0])b[d[0].toLowerCase()]=d.length>1?decodeURIComponent(d[1].replace(plus_re_," ")):""}b=b;b=b.bid;b=Utils.U_AppendParam1("/rebang/detail","bid",b);top.location.href=b}};Utils.getBillboardPreviewTableByBid=function(a){return DM_GlobalDom.$(a).parentNode.parentNode.parentNode.parentNode.parentNode};
Utils.genInstantsQueries=function(a,b){for(var c=DM_GlobalDom.$("iq"),d='<marquee scrolldelay="0" scrollamount="1" onmouseover="this.stop()" onmouseout="this.start()" direction="left">',e=0;e<a.length;e++)d=d+'<a href="'+b.replace(Utils.ER_QUERY_RE,a[e])+'">'+a[e]+"</a>&nbsp;&nbsp;&nbsp;";d+="</marquee>";c.innerHTML=d};Utils.getElementsByIdInNode=function(a,b){var c=[];a=DM_GlobalDom.$(a).getElementsByTagName("*");for(var d=0;d<a.length;d++)b==a[d].getAttribute("id")&&c.push(a[d]);return c};
Utils.highlightTextByIdInNode=function(a,b,c){a=Utils.getElementsByIdInNode(a,b);for(b=0;b<a.length;b++)a[b].innerHTML=a[b].innerHTML.replace(c,'<span style="background-color:yellow;color:000">'+c+"</span>","g")};var _WriteLabelLinks=Utils.writeLabelLinks,_AdjustLines=Utils.adjustLines,_Adjust=Utils.adjustBillboardPreview,_RedirectClipToDetail=Utils.redirectClipToDetail,_GenInstantsQueries=Utils.genInstantsQueries,_HighlightTextByIdInNode=Utils.highlightTextByIdInNode;function AS_Assert(){}AS_Assert.raise=function(a){if(typeof Error!="undefined")throw new Error(a||"Assertion Failed");else throw a;};AS_Assert.fail=function(a){a=a||"Assertion failed";typeof DumpError!="undefined"&&DumpError(a+"\n");AS_Assert.raise(a)};AS_Assert.isTrue=function(a,b){if(!a){if(b===undefined)b="Assertion failed";AS_Assert.fail(b)}};AS_Assert.equals=function(a,b,c){if(a!=b){if(c===undefined)c="AS_Assert.equals failed: <"+a+"> != <"+b+">";AS_Assert.fail(c)}};
AS_Assert.typeOf=function(a,b,c){if(typeof a!=b){if(a||a=="")try{if(b==AS_Assert.TYPE_MAP[typeof a]||a instanceof b)return}catch(d){}if(c===undefined){if(typeof b=="function")if(c=b.toString().match(/^\s*function\s+([^\s\{]+)/))b=c[1];c="AS_Assert.typeOf failed: <"+a+"> not typeof "+b}AS_Assert.fail(c)}};AS_Assert.TYPE_MAP={string:String,number:Number,"boolean":Boolean};
AS_Assert.numArgs=function(a,b){var c=AS_Assert.numArgs.caller;if(c&&c.arguments.length!=a){if(b===undefined)b=c.name+" expected "+a+" arguments  but received "+c.arguments.length;AS_Assert.fail(b)}};function Dom(a){this.doc=a||document;this.getElementById_=this.doc.getElementById?function(b){return this.doc.getElementById(b)}:function(b){return this.doc.all[b]}}Dom.prototype.$=function(a){return this.getElementById_(a)};Dom.prototype.create=function(a){return this.doc.createElement(a)};Dom.remove=function(a){AS_Assert.isTrue(a.parentNode);a.parentNode.removeChild(a)};Dom.insertAfter=function(a,b){AS_Assert.isTrue(b.parentNode);b.parentNode.insertBefore(a,b.nextSibling)};
Dom.insertBefore=function(a,b){AS_Assert.isTrue(b.parentNode);b.parentNode.insertBefore(a,b)};Dom.replace=function(a,b){AS_Assert.isTrue(b.parentNode);b.parentNode.replaceChild(a,b)};Dom.getInnerText=function(a){var b=[];Dom.getInnerTextHelp_(a,b);return b.join("")};Dom.getInnerTextHelp_=function(a,b){if(a.innerText)b.push(a.innerText);else if(a.data)b.push(a.data);else if(a.hasChildNodes())for(var c=a.firstChild;c;){arguments.callee(c,b);c=c.nextSibling}};var DM_GlobalDom=new Dom;var XH_ieProgId_,JSCompiler_inline_XH_ACTIVE_X_IDENTS_36=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"];
if(typeof XMLHttpRequest=="undefined"&&typeof ActiveXObject!="undefined"){for(var JSCompiler_inline_i$$27_37=0;JSCompiler_inline_i$$27_37<JSCompiler_inline_XH_ACTIVE_X_IDENTS_36.length;JSCompiler_inline_i$$27_37++){var JSCompiler_inline_candidate_38=JSCompiler_inline_XH_ACTIVE_X_IDENTS_36[JSCompiler_inline_i$$27_37];try{new ActiveXObject(JSCompiler_inline_candidate_38);XH_ieProgId_=JSCompiler_inline_candidate_38;break}catch(JSCompiler_inline_e$$11_39){}}if(!XH_ieProgId_)throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed.");
}function XH_XmlHttpCreate(){return XH_ieProgId_?new ActiveXObject(XH_ieProgId_):new XMLHttpRequest}function XH_XmlHttpGET(a,b,c){a.open("GET",b,true);a.onreadystatechange=c;XH_XmlHttpSend(a,null)}function XH_XmlHttpPOST(a,b,c,d){a.open("POST",b,true);a.onreadystatechange=d;a.setRequestHeader("Content-Type","application/x-www-form-urlencoded");a.setRequestHeader("Content-Length",c.length);XH_XmlHttpSend(a,c)}
function XH_XmlHttpSend(a,b){try{a.send(b)}catch(c){log("XMLHttpSend failed "+c.toString()+"<br>"+c.stack);throw c;}};if("undefined"==typeof log)log=function(){};var RS_selectRegionSelected,RS_selectRegionList,RS_regions=["\u5b89\u5fbd","\u6fb3\u95e8","\u5317\u4eac","\u91cd\u5e86","\u798f\u5efa","\u7518\u8083","\u5e7f\u4e1c","\u5e7f\u897f","\u8d35\u5dde","\u6d77\u5357","\u6cb3\u5317","\u6cb3\u5357","\u9ed1\u9f99\u6c5f","\u6e56\u5317","\u6e56\u5357","\u5409\u6797","\u6c5f\u82cf","\u6c5f\u897f","\u8fbd\u5b81","\u5185\u8499\u53e4","\u5b81\u590f","\u9752\u6d77","\u5c71\u4e1c","\u5c71\u897f","\u9655\u897f","\u4e0a\u6d77","\u56db\u5ddd","\u53f0\u6e7e","\u5929\u6d25",
"\u897f\u85cf","\u9999\u6e2f","\u65b0\u7586","\u4e91\u5357","\u6d59\u6c5f"];function RS_initRegionSelection(){RS_selectRegionSelected=DM_GlobalDom.$("region_selected");RS_selectRegionList=DM_GlobalDom.$("region_list");var a=DM_GlobalDom.$("region_item");a.firstChild.nodeValue=RS_regions[0];for(var b=1;b<RS_regions.length;b++){var c=a.cloneNode(true);c.firstChild.nodeValue=RS_regions[b];RS_selectRegionList.appendChild(c)}document.onclick=RS_toggleRegionSelectOff}
function RS_toggleRegionSelect(a){RS_selectRegionList.style.display=="none"?RS_toggleRegionSelectOn(a):RS_toggleRegionSelectOff(a)}function RS_toggleRegionSelectOn(a){var b=RS_selectRegionSelected.offsetHeight,c=GetPageOffset(RS_selectRegionSelected);RS_selectRegionList.style.left=c.x-1+"px";RS_selectRegionList.style.top=c.y+b+1+"px";RS_selectRegionList.style.display="";CancelEvent(a)}function RS_toggleRegionSelectOff(a){RS_selectRegionList.style.display="none";CancelEvent(a)}
function RS_changeMyRegion(a){a=Dom.getInnerText(a);for(var b=null,c=0;c<RS_regions.length;c++)if(RS_regions[c]==a){b=c+11900001;break}RS_downloadRegionalBillboardXml(b);RS_toggleRegionSelectOff(null);RS_selectRegionSelected.firstChild.nodeValue=a+" "}
function RS_downloadRegionalBillboardXml(a){var b=XH_XmlHttpCreate();a="/rebang/xml?type=regional&utm_source=regional&bid="+a;XH_XmlHttpGET(b,a,function(){if(b.readyState==4)if(b.status==200)for(var c=b.responseXML.childNodes,d=0;d<c.length;d++)if(c[d].nodeName=="billboard"){var e=["/rebang/images/Arrow-down.gif","/rebang/images/Arrow-NoMove.gif","/rebang/images/Arrow-up.gif"],g=[],f=[],k=[],n=[];c=c[d].childNodes;for(d=0;d<c.length;d++){g.push(c[d].getAttribute("query"));f.push(c[d].getAttribute("trend"));
k.push(c[d].getAttribute("url"));n.push(c[d].getAttribute("new"))}c=0;var l=1;d="11900000";d=DM_GlobalDom.$(d);d=d.getElementsByTagName("tbody");d=d[0];d=d.getElementsByTagName("tr");l=d.length-l-c;for(var h=0;h<l;h++){if(h>=g.length){g.push("&nbsp");f.push("");k.push("")}var i=d[h+c].getElementsByTagName("td"),m=i[1].getElementsByTagName("a")[0],j=i[1].getElementsByTagName("img")[0];m.href=k[h];m.firstChild.nodeValue=g[h];if(f[h]!=""){i=i[2].getElementsByTagName("div")[0];i=i.getElementsByTagName("img");
i=i[0];i.src=e[parseInt(f[h],10)+1]}if(n[h]=="1"&&!j){j=DM_GlobalDom.create("img");j.src="/rebang/images/new.gif";Dom.insertAfter(j,m)}else j&&Dom.remove(j)}break}})}var _InitRegionSelection=RS_initRegionSelection,_ToggleRegionSelect=RS_toggleRegionSelect,_ChangeMyRegion=RS_changeMyRegion;var FV_favoriteBids=[];function FV_init(){FV_readFavoriteBids()}function FV_getElementsByTagName(a,b){return a.getElementsByTagName(b)}function FV_readFavoriteBids(){var a=XH_XmlHttpCreate();FV_favoriteBids=[];XH_XmlHttpPOST(a,"/rebang/userinfo?action=favor","",function(){if(a.readyState==4)if(a.status==200){FV_favoriteBids=eval(a.responseText);FV_rePaintFavorite()}})}function FV_alreadyInFavorite(a){for(var b=0;b<FV_favoriteBids.length;b++)if(a==FV_favoriteBids[b])return true;return false}
function FV_addToFavorite(a){for(var b=0;b<FV_favoriteBids.length;b++)if(a==FV_favoriteBids[b])return;FV_favoriteBids.push(a)}function FV_removeFromFavorite(a){for(var b=0;b<FV_favoriteBids.length;b++)if(a==FV_favoriteBids[b]){FV_favoriteBids[b]=FV_favoriteBids[FV_favoriteBids.length-1];FV_favoriteBids.pop();return}}
function FV_rePaintFavorite(){var a=new Image;a.src="/rebang/images/star_on_2.gif";a.height=15;a.width=15;var b=new Image;b.height=15;b.width=15;b.src="/rebang/images/star_off_2.gif";for(var c=0;c<Utils.bids.length;c++){var d=Utils.bids[c],e=FV_alreadyInFavorite(d);d=Utils.getBillboardPreviewTableByBid(d);d=FV_getElementsByTagName(FV_getElementsByTagName(FV_getElementsByTagName(d.getElementsByTagName("tbody")[0],"tr")[0],"td")[0],"span")[0];e=e?a.cloneNode(true):b.cloneNode(true);Dom.remove(d.firstChild);
d.appendChild(e)}}function FV_toggleFavorite(a,b){var c;if(FV_alreadyInFavorite(b)){c="/rebang/userinfo?action=removefavor";FV_removeFromFavorite(b)}else{c="/rebang/userinfo?action=addfavor";FV_addToFavorite(b)}FV_rePaintFavorite();b="bid="+encodeURIComponent(b);var d=XH_XmlHttpCreate();XH_XmlHttpPOST(d,c,b,function(){});CancelEvent(a)}var _InitFavorite=FV_init,_ToggleFavor=FV_toggleFavorite;
