
var TLH={};TLH.scriptsloaded=false;TLH.loading="<h2 class=\"smtxt\">Loading...</h2> <img src=\"images/loader.gif\" alt=\"Please wait\" style=\"width:32px;height:32px;\"/>";TLH.spcr=" <span class=\"dark\">&gt;&gt;</span> ";TLH.plrl=function(wrd,n){return(n==1)?wrd:wrd+'s';}
function gE(id){return document.getElementById(id);}
function chkDisp(thisId)
{return(gE(thisId)&&gE(thisId).style.display!='none');}
function chkVisi(thisId)
{return(gE(thisId).style.visibility!='hidden');}
var view={show:function(id,type)
{if(type=='visi')this.visiShow(id);else this.dispShow(id);},hide:function(id,type)
{if(type=='visi')this.visiHide(id);else this.dispHide(id);},dispShow:function(id)
{gE(id).style.display='block';},dispHide:function(id)
{gE(id).style.display='none';},visiShow:function(id)
{gE(id).style.visibility='visible';},visiHide:function(id)
{gE(id).style.visibility='hidden';}}
TLH.getWinXY=function()
{if(self.innerHeight)
{x=self.innerWidth;y=self.innerHeight;}
else if(document.documentElement&&document.documentElement.clientHeight)
{x=document.documentElement.clientWidth;y=document.documentElement.clientHeight;}
else if(document.body)
{x=document.body.clientWidth;y=document.body.clientHeight;}
return new Array(x,y);}
TLH.tagSoupDance=function(rel,container)
{if(!gE(container))return false;var rn=(rel.length>3)?rel.substr(3):"";var tgs=gE(container).getElementsByTagName("a");var ntgs=tgs.length;for(var i=0;i<ntgs;++i)
{if(tgs[i].className!='tagged')
tgs[i].className=(tgs[i].rel==rn)?'tag_cat_select':'tag';}
return false;}
TLH.tagSoupJig=function(tids,container)
{if(!gE(container))return false;var tgs=gE(container).getElementsByTagName("a");var ntgs=tgs.length;var curtids=[];curtids=tids.split(",");for(var i=0;i<ntgs;++i)
tgs[i].className=(curtids.indexOf(tgs[i].id)!=-1)?'tag_cat_select':'tag';return false;}
TLH.rate=function(val)
{var tst=gE('tstid').value;if(tst!="")
{$('curr-rat-txt').update("Casting vote...");TLH.ajax_get("async.php?c=rating&set="+val+"&tst="+tst,TLH.rate.rtn,1);}
return false;}
TLH.rate.rtn=function(xml)
{var rate=xml.documentElement;if(rate.getAttribute('error'))
{gE('curr-rat-txt').innerHTML=rate.getAttribute('error');return false;}
var score=rate.getAttribute('score');var num=rate.getAttribute('num');var us=rate.getAttribute('userscore');if(gE('curr-rat'))
gE('curr-rat').style.width=(score*20)+'%';if(gE('curr-rat-txt'))
gE('curr-rat-txt').innerHTML="Average rating: "+score+" stars with "+num+" vote(s).  You gave this Taste a "+us+".";}
TLH.getRatingStr=function(s,v){return(s!=null)?" <span title=\""+s+" average rating with "+v+" "+TLH.plrl('vote',v)+"\">"+TLH.spcr+s+"<img src=\"images/smallstar.gif\"></span>":"";}
TLH.tog={clkd_nav:0,clkd_home:0,home:function()
{if(this.clkd_home==0)
{this.clkd_home=1;this.fade('menuitems_open','menuitems_closed');setTimeout("searchMenu.resizefr()",500);setTimeout("TLH.tog.clkd_home=0",500);}
return false;},nav:function()
{if(this.clkd_nav==0)
{this.clkd_nav=1;this.fade('navmenu_open','navmenu_closed');setTimeout("TLH.tog.clkd_nav=0",500);}
return false;},fade:function(did1,did2)
{var i=new TLH.Fade();var o=new TLH.Fade();i.r(did1);o.r(did2);},gle:function(id,type)
{var togtype=(type=='visi')?eval(this.visi):eval(this.disp);togtype(id);},disp:function(id)
{gE(id).style.display=(gE(id).style.display=='none'||gE(id).style.display=='')?'block':'none';},visi:function(id)
{gE(id).style.visibility=(gE(id).style.visibility=='hidden')?'visible':'hidden';}}
TLH.Fade=Class.create();TLH.Fade.prototype={initialize:function(max,speed,type)
{this.max=(max==undefined)?100:max;this.min=0;this.step=10;this.speed=(speed==undefined)?4:speed;this.type=(type==undefined)?'disp':type;},r:function(id)
{var chkOpen=(this.type=='disp')?eval('chkDisp'):eval('chkVisi');if(chkOpen(id))this._out(id);else this._in(id);return false;},_in:function(id,start)
{TLH.divAlpha.reset(id,start);view.show(id,this.type);for(var i=0;i<=this.max;i+=this.step)
setTimeout("TLH.divAlpha.set('"+id+"','"+i+"')",i*this.speed);setTimeout("TLH.divAlpha.set('"+id+"','"+this.max+"')",i*this.speed);},_out:function(id,end)
{var cA=(end!=null)?end:0;var foffset=(end!=null)?end:this.max;for(var i=cA;i<=foffset;i+=this.step)
setTimeout("TLH.divAlpha.set('"+id+"',"+(this.max-i)+")",i*this.speed);if(foffset==this.max)
{setTimeout("TLH.divAlpha.set('"+id+"','"+this.min+"')",i*this.speed);setTimeout("view.hide('"+id+"','"+this.type+"')",i*this.speed);}}}
TLH.divAlpha={set:function(divId,percentage)
{var theElem=gE(divId);if(typeof theElem.style.opacity!='undefined')theElem.style.opacity=percentage/100;else if(typeof theElem.style.filter!='undefined')theElem.style.filter="alpha(opacity="+percentage+")";},get:function(divId)
{var theElem=gE(divId);if(typeof theElem.style.opacity!='undefined'||theElem.style.opacity=='')
return theElem.style.opacity*100;else if(typeof theElem.style.filter!='undefined'||theElem.style.filter=='')
{var opac=theElem.style.filter.substr(14);if(opac=='')return 0;var parenPos=opac.indexOf(")");return((parenPos==-1)?opac:opac.substr(0,parenPos));}
else return 0;},reset:function(divId,start)
{setTo=(start==undefined)?this.get(divId):start;this.set(divId,setTo);}}
TLH.chkEmptyVal=function(inputid){return(!gE(inputid)||gE(inputid).value=="");}
TLH.TextEffect=Class.create();TLH.TextEffect.prototype={initialize:function(id,type)
{this.id=id;this.maxsize=5;this.speed=60;if(type==1)
this.dospacewave();else
this.doshake();},dospacewave:function()
{var count=this.maxsize*2;for(var i=1;i<count;++i)
{var space=(i>5)?count-i:i;setTimeout("te1('"+this.id+"','"+space+"')",this.speed*i);}},doshake:function()
{var count=this.maxsize;for(var i=0;i<count;++i)
{var fs=(i%2)?'bolder':'normal';setTimeout("te2('"+this.id+"','"+fs+"')",this.speed*i);}}}
function te1(id,n){gE(id).style.letterSpacing=n+"px";}
function te2(id,s){gE(id).style.fontWeight=s;}
TLH.initNavEffects=function()
{var navitems=gE('navmenu_open').getElementsByTagName("a");for(var i=0;i<navitems.length;++i)
navitems[i].onmouseover=function(){var tmp=new TLH.TextEffect(this.id,1);};}
TLH.ajax_get=function(url,action,xml)
{var async_req_obj=new Ajax.Request(url,{method:'get',onSuccess:function(transport){var rtndata=(xml)?transport.responseXML:transport.responseText;try{callback=eval(action);if(typeof callback=="function")
callback(rtndata);else
$(action).update(rtndata);}catch(e){alert(e+": Could not eval "+action+rtndata);}},onFailure:function(){alert("Unable to process request "+url+"\nPlease try again a little later.");}});}
TLH.ajax_post=function(url,data,action)
{var async_req_obj=new Ajax.Request(url,{method:'post',parameters:data,onSuccess:function(transport){$(action).update(transport.responseText);},onFailure:function(){alert("Unable to process request "+url+"\nPlease try again a little later.");}});}
TLH.doComment={scorethis:0,url:"async.php?c=comment&tst=",add:function()
{var form=gE('comment_form');var tstid=gE('tstid').value;if(!form||tstid=="")
return false;TLH.ajax_post(this.url+tstid,$('comment_form').serialize(true),'newcomment');return false;},score:function(cmid,val)
{if(this.scorethis==cmid)
return false;var tstid=gE('tstid').value;this.scorethis=cmid;$('cmtvote'+cmid).update(" Vote cast!");TLH.ajax_post(this.url+tstid+"&cmt="+cmid,{'comm_id':cmid,'vote':(val=='+')?'1':'-1'},'score'+cmid);var fade=new TLH.Fade(100,4,'visi');fade._in('score'+cmid,0);fade._out('cmtvote'+cmid);}}
TLH.save=function()
{var tstid=(gE('tstid'))?gE('tstid').value:"";if(tstid=="")
return false;TLH.ajax_post("async.php?c=save",{'tst':tstid},'save');}
TLH.save.remove=function(obj)
{var tstid=obj.parentNode.id.substr(3);if(tstid=="")
return false;obj.parentNode.innerHTML="";TLH.ajax_post("async.php?c=save",{'tst':tstid,'opt':'remove'},'save');}
TLH.mousePos={x:function(evt)
{if(evt.pageX)return evt.pageX;else if(evt.clientX)
return evt.clientX+(document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft);else return null;},y:function(evt)
{if(evt.pageY)return evt.pageY;else if(evt.clientY)
return evt.clientY+(document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop);else return null;},get:function(evt)
{return new Array(this.x(evt),this.y(evt));}}
TLH.rtnEvt=function(e){return((e!=null)?e:window.event);}
TLH.footerfade=function(){var ff=new TLH.Fade(100,1);ff._out('footeritems',80);}
Event.observe(window,'load',function()
{if(gE('footeritems'))
{setTimeout('TLH.footerfade()',4000);setTimeout('view.visiHide("footeritems")',9000);}});TLH.scriptsloaded=true;