String.prototype.trim=function(){return this.replace(/^\s+|\s+$/,'');};String.prototype.chop=function(size)
{var ret=Array();var tstr=this;while(''!=tstr)
{ret.push(tstr.substr(0,size));tstr=tstr.substr(size);}
return ret;}
function StopPropagation(evt)
{if(evt&&evt.stopPropagation)
{evt.stopPropagation();}
else if(window.event)
{window.event.cancelBubble=true;}}
tt_Init=Tips=UnTip=hideThrober=showThrober=function(){}
hideThrober=function(){document.getElementById('divthrober').style['display']='none';}
function tagclick(evt)
{var e=evt||window['event'];if(!e)
{return;}
StopPropagation(e);var target=e['target']||e['srcElement'];if('b'==target.tagName.toLowerCase())
{target=target['parentNode']||parent;}
if('a'!=target.tagName.toLowerCase())
{return;}
var kwrd=target['innerText']||(target['textContent']||'');kwrd=encodeURIComponent(kwrd.trim());if(''==kwrd)
{return;}
var className=target['className']||'';if('related'==className)
{return;}
showThrober();if(2==window.format['tag_click'])
{var url=window.format['TC_REDIRECT_AD_URL']+'?q='+kwrd;var wnd=window.open(url,"_blank","fullscreen=1,location=1,menubar=1,resizable=1,scrollbars=1,status=1,titlebar=1,toolbar=1,height=,"+screen.height+"width="+screen.width);try
{wnd.focus();}catch(e){};wnd=null;hideThrober();}
else
{var url=window.location.href;if(-1!=url.indexOf('&q=')){window.location.href=url.substring(0,url.indexOf('&q='))+'&q='+kwrd+'&_rand_='+Math.random()+'&fromtck=1';}else{window.location.href=url.substring(0,url.indexOf('&_rand_'))+'&q='+kwrd+'&_rand_='+Math.random()+'&fromtck=1';}}}
function uline(obj,bval)
{obj['style']['textDecoration']=(bval)?'none':'none';}
function wrtrelsrch(sid,kwrd,kwrdbold,sep)
{tmpdiv.innerHTML+='<span id="'+sid+'" alt="'+kwrd+'" title="'+kwrd+'" ><a href="#" onclick="return false;" >'+kwrdbold+'</a></span>'+sep;if((tmptd.offsetHeight>mx_tc_height)||(tmptd.offsetWidth>mx_tc_width))
{tmpdiv.removeChild(tmpdiv.lastChild);if(''!=sep){tmpdiv.removeChild(tmpdiv.lastChild);}}}
function wrttck(sid,kwrd,fsz)
{var debug_str='';var ad_sucess_flag=false;if((tmptd.offsetWidth<=mx_tc_width)||(tmptd.offsetHeight<=mx_tc_height))
{debug_str=kwrd+'(1)'+' S: '+fsz+' W: '+tmptd.offsetWidth+" W: "+tmptd.offsetHeight+' || ';var sspan=' <span onmouseover="uline(this, true);" onmouseout="uline(this, false);" id="'+sid+'" alt="'+kwrd+'" title="'+kwrd+'" style="font-size:'+fsz+'em;"><a href="#" onclick="return false;">'+kwrd+'</a></span>';tmpdiv.innerHTML+=sspan;if((tmptd.offsetHeight>mx_tc_height)||(tmptd.offsetWidth>mx_tc_width))
{var xspan=document.getElementById(sid);for(fsz=fsz;fsz>=window.fsz_min;fsz)
{xspan['style']['fontSize']=fsz+'em';if((tmptd.offsetHeight<=mx_tc_height)&&(tmptd.offsetWidth<=mx_tc_width))
{ad_sucess_flag=true;break;}
else
{fsz-=0.5;}}
xspan=null;if(ad_sucess_flag)
{}
else
{{tmpdiv.removeChild(tmpdiv.lastChild);}}}
else
{}}}
function rmlarge(dir)
{if((tmptd.offsetWidth>mx_tc_width)||(tmptd.offsetHeight>mx_tc_height))
{if(dir)
{while(tmpdiv.firstChild)
{tmpdiv.removeChild(tmpdiv.firstChild);if((tmptd.offsetHeight<=mx_tc_height)&&(tmptd.offsetWidth<=mx_tc_width))
{return;}}}
else
{while(tmpdiv.lastChild)
{tmpdiv.removeChild(tmpdiv.lastChild);if((tmptd.offsetHeight<=mx_tc_height)&&(tmptd.offsetWidth<=mx_tc_width))
{return;}}}}}
function debug(str,tp)
{return;tp=tp||'d';if(console)
{switch(tp.toLowerCase())
{case'e':console.error(str);break;case'w':console.warn(str);break;case'i':console.info(str);break;default:console.debug(str);break;}}
else
{document.getElementById('debug').innerHTML+='<br>'+str;}}