if(typeof(Lycos)=="undefined")Lycos=new Object();if(typeof(Lycos.util)=="undefined")Lycos.util=new Object();Lycos.util.isFF=(navigator.appName=="Netscape");Lycos.util.isIE=(navigator.appName=="Microsoft Internet Explorer");Lycos.util.isSafari=(navigator.userAgent.match(/Safari/));Lycos.util.findPosition=function(obj){if(typeof(obj.offsetParent)!='undefined'){var borderX=0;var borderY=0;for(var posX=0,posY=0;obj;obj=(typeof(obj.offsetParent)=="unknown"?null:obj.offsetParent)){if(obj.tagName!='A'){posX+=obj.offsetLeft-obj.scrollLeft;posY+=obj.offsetTop-obj.scrollTop;var ss=Lycos.effects.getStyle(obj);if(ss){if(ss['borderTopWidth']&&!isNaN(parseInt(ss['borderTopWidth']))){borderY+=parseInt(ss['borderTopWidth']);}
if(ss['borderLeftWidth']&&!isNaN(parseInt(ss['borderLeftWidth']))){borderX+=parseInt(ss['borderLeftWidth']);}}}}
if(Lycos.util.isFF&&!Lycos.util.isSafari){return[posX+(parseInt(borderX*2)),posY+(parseInt(borderY*2))];}
else if(Lycos.util.isIE){return[posX+(parseInt(borderX/2)),posY+(parseInt(borderY/2))];}
else{return[posX,posY];}}
else{return[obj.x,obj.y];}}
Lycos.util.findAbsPosition=function(oElement){if(typeof(oElement.offsetParent)!='undefined'){for(var posX=0,posY=0;oElement;oElement=oElement.offsetParent){posX+=oElement.offsetLeft;posY+=oElement.offsetTop;}
return[posX,posY];}else{return[oElement.x,oElement.y];}}
Lycos.util.imageNaturalDimensions=function(oElement){if(oElement.naturalWidth&&oElement.naturalHeight){return[oElement.naturalWidth,oElement.naturalHeight];}else{img=new Image();img.src=oElement.src;return[img.width,img.height];}}
Lycos.util.addDocListener=function(event,listener){if(document.addEventListener){window.addEventListener(event,listener,false);}else{document.attachEvent("on"+event,listener);}}
Lycos.util.addListener=function(el,evt,listener){if(document.addEventListener){el.addEventListener(evt,listener,false);if(evt=="mousewheel"||evt=="DOMMouseScroll")
el.addEventListener((evt=="mousewheel"?"DOMMouseScroll":"mousewheel"),listener,false);}else{if(evt=="DOMMouseScroll")evt="mousewheel";if(evt=="scroll"){el.onscroll=listener;}else
el.attachEvent("on"+evt,listener);}}
Lycos.util.loadListenerList=new Object;Lycos.util.loadListenerList.main=[];Lycos.util.addLoadListener=function(listener,subframe){if(Lycos.finished&&typeof(subframe)=="undefined")
listener();else{if(!subframe||subframe=="")
subframe="main";eval("if (!Lycos.util.loadListenerList."+subframe+") Lycos.util.loadListenerList."+subframe+" = [];");var listStr="Lycos.util.loadListenerList."+subframe;eval(listStr+"["+listStr+".length] = listener;");if(subframe=="main"){if(Lycos.util.loadListenerList.main.length<=1){if(window.addEventListener){window.addEventListener("load",Lycos.util.onLoad,false);}else{window.attachEvent("onload",Lycos.util.onLoad);}}}}}
Lycos.util.onLoad=function(evt,optFrame){optFrame=(optFrame&&optFrame!=""?optFrame:"main");var list=eval("Lycos.util.loadListenerList."+optFrame);if(!list)return;var func;for(var i=0;i<list.length;i++){try{func=list[i];func();}catch(e){}}}
Lycos.util.freeOnLoad=function(subframe){if(subframe!=""&&subframe!="main"){var list;eval("list = Lycos.util.loadListenerList."+subframe);delete list;}}
Lycos.util.addUnloadListener=function(listener){if(window.addEventListener){window.addEventListener("unload",listener,false);}else{window.attachEvent("onunload",listener);}}
Lycos.util.getAttribute=function(el,attribute){try{return el.getAttribute("ly:"+attribute);}catch(e){return null;}}
Lycos.util.cookies={getVal:function(offset){var endstr=document.cookie.indexOf(";",offset);if(endstr==-1)
endstr=document.cookie.length;return unescape(document.cookie.substring(offset,endstr));},fixDate:function(date){var base=new Date(0);var skew=base.getTime();if(skew>0)
date.setTime(date.getTime()-skew);},get:function(name){var arg=name+"=";var alen=arg.length;var clen=document.cookie.length;var i=0;while(i<clen){var j=i+alen;if(document.cookie.substring(i,j)==arg)
return this.getVal(j);i=document.cookie.indexOf(" ",i)+1;if(i==0)break;}
return null;},set:function(name,value,expires,path,domain,secure){document.cookie=name+"="+escape(value)+
(expires?"; expires="+expires.toGMTString():"")+
(path?"; path="+path:"")+
(domain?"; domain="+domain:"")+
(secure?"; secure":"");},unset:function(name,path,domain){if(this.get(name)){document.cookie=name+"="+((path)?"; path="+path:"")+((domain)?"; domain="+domain:"")+"; expires=Thu, 01-Jan-70 00:00:01 GMT";}}}
Lycos.util.centerSlider=function(selected,total,innerPage){var skew=parseInt(innerPage/2)+2;if(selected<1||selected>total)
return null;var center=(selected<skew+1?skew+1:(selected>total-skew?total-skew:selected));var pgs=new Array();if(total<=10){for(var i=0;i<total;i++){pgs[i]=i+1;}}
else{pgs[0]=1;pgs[1]=(selected>skew+1?"...left":2);for(var i=0;i<=innerPage;i++){pgs[i+2]=(center-skew+(i+2));}
pgs[9]=(selected<total-skew?"...right":(total-1));pgs[10]=total;}
return[selected,center,pgs];}
Lycos.util.linkInfoToggle=function(aid,eid,sT,hT){var a=document.getElementById(aid);var e=document.getElementById(eid);var i=a.firstChild.data.indexOf(sT);if(i!=-1){a.firstChild.data=hT;e.style.display="";}else{a.firstChild.data=sT;e.style.display="none";}
return;}
Lycos.util.toggleInfoLinkGroup=function(gid,aid){var eles=document.getElementsByName(gid);if(eles.length<=0)return;for(var i=0;i<eles.length;i++){if(eles[i].id==aid)continue;var a=document.getElementById(eles[i].id);var e=document.getElementById(eles[i].id+"_d");a.firstChild.data="more info";e.style.display="none";}
Lycos.util.linkInfoToggle(aid,aid+"_d","more info","hide info");}
Lycos.util.hasFramePermission=function(f){try{var m=f.contentWindow.location.href;return(m!=""&&typeof(m)!="undefined");}catch(e){return false;}}
Lycos.lifecycle={triggerEvent:function(id){var evts=Lycos.util.cookies.get("lfce");Lycos.util.cookies.set("lfce",(evts?evts:"")+id+";");}}
