//Copyright 2003-2006 A9.com or its affiliates
var a9search=new Object;
a9search.defText="Give it a try, go ahead kick our tires.";
a9search.defText2="Go ahead, test drive the A9 Product Search.";
a9search.blur=function(elemName){
if(!elemName)
elemName="q";
var t=document.getElementById(elemName);
var inputDefText=t.defText;
if(!t.defText&&t.getAttribute("defText"))
inputDefText=t.getAttribute("defText");
if(t.value==""||t.value==a9search.defText||
(t.value==inputDefText)){
t.style.color="#aaa";
if( inputDefText )
t.value=inputDefText;
else
t.value=a9search.defText;
}
if(t.value==""||t.value==a9search.defText2){
t.style.color="#aaa";
t.value=a9search.defText2;
}
}
a9search.focus=function(elemName){
if(!elemName)
elemName="q";
var t=document.getElementById(elemName);
var inputDefText=t.defText;
if(!t.defText&&t.getAttribute("defText"))
inputDefText=t.getAttribute("defText");
a9search.noInitBlur=true;
if(t.value==a9search.defText)
t.value="";
if(t.value==a9search.defText2)
t.value="";
if(t.value==inputDefText)
t.value="";
t.style.color="black";
}
function getSearchUrl(base,val){
val=a9Trim(val);
if(val=="robots.txt"||val=="favicon.ico"||val=="siteinfo.xml"){
val='"'+val+'"';
}
if( /.*field-keywords=$/.test(base) )
return base+a9Encode(val);
else
return base.replace(/(?:q=|([?]|$))/,a9Encode(val)+"$1");
}
function checkSearchAction(formName,selectName,booksOnly){
if(!formName)
formName="sf";
if(!selectName)
selectName="searchSelect";
var form=document.getElementById(formName);
var searchSelect=document.getElementById(selectName);
if( searchSelect&&!searchSelect.checked ){
form.action=a9productSearchUrl;
}
else
form.action=a9searchUrl.replace(/http:\/\/[^\/]+\//,"http://"+document.location.host+"/");
if( booksOnly )
form.action=a9bookSearchUrl;
}
function submitProductSearch(val){
if(val==null){
val="";
}
var u=getSearchUrl(a9productSearchUrl,val);
u=fixUrl(u);
location.href=u;
return false;
}
function submitSearch(elemName,formName,selectName,booksOnly){
if(!elemName)
elemName="q";
if(!formName)
formName="sf";
var form=document.getElementById(formName);
var q=document.getElementById(elemName);
var val=q.value;
var defValue=q.defValue;
if(!q.defValue&&q.getAttribute("defValue"))
defValue=q.getAttribute("defValue");
if(!defValue )
defValue=a9search.defText;
var defText=q.defText;
if(!q.defText&&q.getAttribute("defText"))
defText=q.getAttribute("defText");
checkSearchAction(formName,selectName,booksOnly);
if(val==null){
val="";
}
else if((val==defText)||(val=="")){
val=defValue;
}
var u=getSearchUrl(form.action,val);
u=fixUrl(u);
location.href=u;
return false;
}
function fixUrl(u){return u;}
function ferr(s){
}
function a9SetAttribute(obj,attr,value){
try{
if(a9IsSafari){
obj[attr]=""+value;
}else{
obj.setAttribute(attr,value);
}
}catch (e){}
}
function a9GetAttribute(obj,attr){
try{
if(a9IsSafari){
return obj[attr];
}else{
return obj.getAttribute?obj.getAttribute(attr):null;
}
}catch (e){
return null;
}
}
function a9Encode(s){
if(typeof(encodeURIComponent)!="undefined"){
return encodeURIComponent(s);
}
return escape(s);
}
function a9Decode(s){
if(typeof(decodeURIComponent)!="undefined"){
return decodeURIComponent(s);
}
return unescape(s);
}
function a9PopupWin(url,name,options){
var win=window.open(url,name,options);
win.opener=this;
win.focus();
}
function a9GetElText(el){
var tt=a9GetAttribute(el, "textTitle");
if(tt){
if(tt==1){
if(el.title){
return el.title;
}
}else{
return tt;
}
}
if(el.innerText){
return el.innerText;
}
function getElTextInt(el){
var text="";
var children=el.childNodes;
for(var i=0;i<children.length;i++){
if(children[i].nodeType==3){
text+=children[i].nodeValue;
}else{
text+=getElTextInt(children[i]);
}
}
return text;
}
return getElTextInt(el).replace(/^\s+/,"").replace(/\s+$/,"");
}
function a9Image(name,ext){
return A9IMAGES+"/"+name+"."+(ext?ext:"gif");
}
function a9Png(name){return a9Image(name,"png");}
function getOffsetLeft(el){
var l=0;
while(el){
l+=el.offsetLeft-el.scrollLeft;
el=el.offsetParent;
}
return l;
}
function getOffsetTop(el){
var t=0;
while(el){
t+=el.offsetTop-el.scrollTop;
el=el.offsetParent;
}
return t;
}
function a9Trim(s){
return s.replace(/^\s+/,"").replace(/\s+$/,"")
}
function cloneNoId(n,iehack){
function removeIds(n){
if(n.id) n.id="";
for(var i=0;i<n.childNodes.length;i++) removeIds(n.childNodes[i]);
}
var c;
if(a9IsIE&&iehack&&n.getElementsByTagName("style").length){
c=document.createElement(n.tagName);
c.innerHTML=n.innerHTML;
c.className=n.className;
}else{
c=n.cloneNode(true);
}
removeIds(c);
return c;
}
function getStyle(el,attr){
if(window.getComputedStyle){
return window.getComputedStyle(el, "")[attr];
}
if(document.defaultView&&document.defaultView.getComputedStyle){
return document.defaultView.getComputedStyle(el, "")[attr];
}
if(el.currentStyle){
return el.currentStyle[attr];
}
return null;
}
function getPxStyle(el,attr){
var sz=getStyle(el,attr);
if(sz){
return parseInt(sz.replace("px", ""));
}
return 0;
}
/* cookies.js
Based on Example File From "JavaScript and DHTML Cookbook"
Published by O'Reilly&Associates
Copyright 2003 Danny Goodman
*/
function cookieGetExpDate(days,hours,minutes){
var expDate=new Date();
if(typeof days=="number"&&typeof hours=="number"&&typeof hours=="number"){
expDate.setDate(expDate.getDate()+parseInt(days));
expDate.setHours(expDate.getHours()+parseInt(hours));
expDate.setMinutes(expDate.getMinutes()+parseInt(minutes));
return expDate.toGMTString();
}
}
function _getCookieVal(offset){
var endstr=document.cookie.indexOf (";", offset);
if(endstr==-1){
endstr=document.cookie.length;
}
return a9Decode(document.cookie.substring(offset,endstr));
}
function getCookie(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 _getCookieVal(j);
}
i=document.cookie.indexOf(" ", i)+1;
if(i==0) break;
}
return null;
}
function cookieEncode(v){
return a9Encode(v).replace(/%7B/g,"{").replace(/%7D/g,"}").
replace(/%5B/g,"[").replace(/%5D/g,"]").
replace(/%22/g, "\"").replace(/%3A/g,":");
}
function setCookie(name,value,expires,path,domain,secure){
document.cookie=name+"="+cookieEncode (value)+
((expires) ? ";expires="+expires : "")+
((path) ? ";path="+path : "")+
((domain) ? ";domain="+domain : "")+
((secure) ? ";secure" : "");
}
function deleteCookie(name,path,domain){
if(getCookie(name)){
document.cookie=name+"="+
((path) ? ";path="+path : "")+
((domain) ? ";domain="+domain : "")+
";expires=Thu, 01-Jan-70 00:00:01 GMT";
}
}
var COL_COOKIE_EXPIRE_DAYS=365;
var COL_COOKIE="col";
function getColCookie(){
return getJSONCookie(COL_COOKIE, COL_COOKIE_EXPIRE_DAYS, 0, 0, "/", ".a9.com");
}
function startXmlHttpRequest(url,func,arg,postData,ts){
try{
var xmlhttp;
if(a9IsIE){
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}else{
xmlhttp=new XMLHttpRequest();
}
xmlhttp.onreadystatechange=function(){
if(xmlhttp.readyState==4){
func(xmlhttp.responseXML,arg,xmlhttp.responseText,xmlhttp.status);
}
}
if(a9IsSafari&&postData&&a9VersionMajor<312){
url+="?"+postData;
postData=null;
}
if(ts){
ts+="="+(new Date).getTime();
if(postData){
postData+="&"+ts;
}else{
url+=(url.indexOf("?")<0?"?":"&")+ts;
}
}
xmlhttp.open(postData?"POST":"GET", url, true);
if(postData){
xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
}
xmlhttp.send(postData);
return true;
}catch (e){}
return false;
}
var _cbList;
function cbAdd(name,f,data){
if(!_cbList){
_cbList=new Object;
}
var a=_cbList[name];
if(!a){
a=_cbList[name]=new Array;
}
var o=new Object;
o.f=f;
o.data=data;
a[a.length]=o;
}
function cbCall(name,arg){
if(_cbList){
var a=_cbList[name];
if(a){
for(var i=0;i<a.length;i++){
try{
a[i].f(arg,a[i].data);
}catch (e){}
}
}
}
}
function cbCheck(name){
return _cbList&&_cbList[name];
}
function JSONObject(string){
if(string){
eval ("this.o="+string);
if(!this.o||typeof this.o!="object"){
this.o=new Object;
}
}else{
this.o=new Object;
}
}
JSONObject.prototype.put=function(key,value){
this.o[key]=value;
}
JSONObject.prototype.opt=function(key){
return this.o[key];
}
JSONObject.prototype.remove=function(key){
delete this.o[key];
}
JSONObject.prototype.toString=function(){
function stringify(arg){
function isUndefined(a){
return typeof a=='undefined';
}
function quote(s){
return '"'+s.replace(/(["\\])/g, '\\$1')+'"';
}
var i,o,v;
switch (typeof arg){
case 'object':
if(arg){
if(arg.constructor==Array){
o='[';
for(i=0;i<arg.length;++i){
v=stringify(arg[i]);
if(v!='function'&&!isUndefined(v)){
o+=(o!='[' ? ',' : '')+v;
}else{
o+=',';
}
}
return o+']';
}else if(typeof arg.toString!='undefined'){
o='{';
for(i in arg){
v=stringify(arg[i]);
if(v!='function'&&!isUndefined(v)){
o+=(o!='{' ? ',' : '')+
quote(i)+':'+v;
}
}
return o+'}';
}else{
return;
}
}
return 'null';
case 'unknown':
case 'undefined':
return;
case 'string':
return quote(arg);
case 'function':
return 'function';
default:
return String(arg);
}
}
return stringify(this.o);
}
function getJSONCookie(name,expDays,expHours,expMinutes,path,domain,secure){
var nm="_CK"+name;
if(!top[nm]){
top[nm]=new JSONCookie(name,expDays,expHours,expMinutes,path,domain,secure);
}
return top[nm];
}
function JSONCookie(name,expDays,expHours,expMinutes,path,domain,secure){
this.name=name;
this.expDays=expDays;
this.expHours=expHours;
this.expMinutes=expMinutes;
this.path=path;
this.domain=domain;
this.secure=secure;
this.jo=new JSONObject(getCookie(name));
}
JSONCookie.prototype.getObject=function(){
return this.jo;
}
JSONCookie.prototype.save=function(){
var s=this.jo.toString();
var exp=null;
if(this.expDays||this.expHours||this.expMinutes){
exp=cookieGetExpDate(this.expDays,this.expHours,this.expMinutes);
}
setCookie(this.name,s,exp,this.path,this.domain,this.secure);
}
function GroupInfo(){
this.cookie=getColCookie();
this.obj=this.cookie.getObject();
}
GroupInfo.prototype.save=function(){
this.cookie.save();
}
GroupInfo.prototype.getGroup=function(gn){
var g=this.obj.opt("g");
if(g){
for(var i=0;i<g.length;i++){
if(g[i].n==gn){
return g[i];
}
}
}
return null;
}
GroupInfo.prototype.moveGrp=function(src,tgt,b4){
var g=this.obj.opt("g");
var sg=this.getGroup(src);
var tg=this.getGroup(tgt);
if(sg&&tg){
var ng=new Array;
for(var i=0;i<g.length;i++){
if(g[i]==sg) continue;
if(g[i]==tg){
if(b4){
ng.push(sg);
ng.push(tg);
}else{
ng.push(tg);
ng.push(sg);
}
}else{
ng.push(g[i]);
}
}
this.obj.put("g", ng);
}
}
GroupInfo.prototype.setHeight=function(h){
this.obj.put("h", h);
}//Copyright 2003-2006 A9.com or its affiliates
var GRP_PUP_TO=50;
var GRP_PDN_TO=50;
var grpHl;
var grpPupTo,grpPdnTo;
var grpPupDiv;
var grpOldCls;
function grpOvr(e,s,h){
function showPup(){
grpPupTo=null;
if(grpPdnTo){
clearTimeout(grpPdnTo);
grpPdnTo=null;
}
if(!grpPupDiv){
grpPupDiv=document.createElement("div");
grpPupDiv.className="navLeftExpanded";
grpPupDiv.style.display="none";
document.body.appendChild(grpPupDiv);
if(grpPupDiv.addEventListener){
grpPupDiv.addEventListener("mouseover", grpPupOvr, false);
grpPupDiv.addEventListener("mouseout", grpOut, false);
}else{
grpPupDiv.onmouseover=grpPupOvr;
grpPupDiv.onmouseout=grpOut;
}
}
grpPupDiv.innerHTML="<span class='navLeftExpandedHead'>"+"Search :"+"</span>"+s;
if(h){
grpPupDiv.style.top=getOffsetTop(e)+e.offsetHeight+"px";
grpPupDiv.style.left=getOffsetLeft(e)+"px";
}else{
grpPupDiv.style.top=getOffsetTop(e)+"px";
grpPupDiv.style.left=getOffsetLeft(e)+e.offsetWidth+"px";
}
grpPupDiv.style.display="";
if(grpHl&&grpHl!=e){
grpHl.className=grpOldCls;
}
grpOldCls=e.className;
e.className=h?"navPrimaryOver":"navLeftOn";
grpHl=e;
}
if(grpPupTo){
clearTimeout(grpPupTo);
}
grpPupTo=setTimeout(showPup,GRP_PUP_TO);
}
function grpPupOvr(){
if(grpPupTo){
clearTimeout(grpPupTo);
grpPupTo=null;
}
if(grpPdnTo){
clearTimeout(grpPdnTo);
grpPdnTo=null;
}
}
function grpOut(){
function hidePup(){
grpPdnTo=null;
if(grpHl){
grpHl.className=grpOldCls;;
grpHl=null;
}
if(grpPupDiv){
grpPupDiv.style.display="none";
}
}
if(grpPupTo){
clearTimeout(grpPupTo);
grpPupTo=null;
}
if(!grpPdnTo){
grpPdnTo=setTimeout(hidePup,GRP_PDN_TO);
}
}
function grpCBDrag(el,purpose,arg1){
switch (purpose){
case DND_DRAG_START:
return true;
case DND_DRAG_GET_DATA:
return grpCBGetData(el,arg1);
case DND_DRAG_MOVING:
return grpCBMoving(el);
case DND_DRAG_CANCEL:
return grpCBCancel(el);
}
}
function grpCBGetData(el,type){
if(type=="grpCB"){
return true;
}
return null;
}
function grpCBMoving(el){
el.style.visibility="hidden";
}
function grpCBCancel(el){
el.style.visibility="";
}
function grpCBTgt(el,purpose,arg1,arg2,arg3,arg4,arg5,arg6){
switch (purpose){
case DND_DROP_GET_TYPES:
return "grpCB";
case DND_DROP_DRAG_ENTER:
return grpCBEnter(el,arg1);
case DND_DROP_DRAG_LEAVE:
return grpCBLeave(el);
case DND_DROP_DRAG_DROP:
return grpCBDrop(el,arg1,arg2,arg3,arg4,arg5,arg6);
}
return null;
}
function grpCBEnter(tgt,src){
tgt.className+=" droppable-"+(getOffsetTop(src)<getOffsetTop(tgt)?"below":"above");
}
function grpCBLeave(tgt){
tgt.className=tgt.className.replace(/ *droppable-\w*/g, "");
}
function grpCBDrop(tgt,src,type,data,dx,dy,sprite){
grpCBLeave(tgt);
moveTile(a9GetAttribute(src, "a9x:t"), a9GetAttribute(tgt, "a9x:t"),
sprite,1);
}
function grpDrag(el,purpose,arg1){
switch (purpose){
case DND_DRAG_START:
return true;
case DND_DRAG_GET_DATA:
return grpGetData(el,arg1);
case DND_DRAG_MOVING:
return grpMoving(el);
case DND_DRAG_CANCEL:
return grpCancel(el);
}
}
function grpGetData(el,type){
if(type=="grp"){
return true;
}
return null;
}
function grpMoving(el){
el.style.visibility="hidden";
}
function grpCancel(el){
el.style.visibility="";
}
function grpTgt(el,purpose,arg1,arg2,arg3,arg4,arg5,arg6){
switch (purpose){
case DND_DROP_GET_TYPES:
return "grpCB,tile,tilex,grp";
case DND_DROP_DRAG_ENTER:
return grpEnter(el,arg1,arg2);
case DND_DROP_DRAG_LEAVE:
return grpLeave(el);
case DND_DROP_DRAG_DROP:
return grpDrop(el,arg1,arg2,arg3,arg4,arg5,arg6);
}
return null;
}
function curGrpTgt(el,purpose,arg1,arg2,arg3,arg4,arg5,arg6){
if(purpose==DND_DROP_GET_TYPES){
return "grp";
}
return grpTgt(el,purpose,arg1,arg2,arg3,arg4,arg5,arg6);
}
function grpEnter(tgt,src,type){
switch (type){
case "grpCB":
case "tile":
case "tilex":
tgt.className+=" droppable-grp";
break;
case "grp":
if(a9GetAttribute(src, "a9x:g")==a9GetAttribute(tgt, "a9x:g")){
return;
}
tgt.className+=" droppable-"+(getOffsetTop(src)<getOffsetTop(tgt)?"below":"above");
break;
}
}
function grpLeave(tgt){
tgt.className=tgt.className.replace(/ *droppable-\w*/g, "");
}
function curTabLab(){return a9GetAttribute(document.getElementById("curGrpLab"), "a9x:lab");}
function grpDrop2(st,dg){}
function findGroup(n){
while(n&&n.className!="navLeftOff"&&n.className!="navLeftSel") n=n.parentNode;
return n;
}
function grpDrop(tgt,src,type,data,dx,dy,sprite){
grpLeave(tgt);
src.style.visibility="";
src.className=src.className.replace(/ *macMozHide/g, "");
switch (type){
case "grpCB":
case "tile":
case "tilex":
var st=a9GetAttribute(src, "a9x:t");
var dg=a9GetAttribute(tgt, "a9x:g");
if(st&&dg){
var gi=new GroupInfo;
var pi=gi.getGroup(dg);
if(pi&&pi.t){
var f=false;
for(var i=0;i<pi.t.length;i++){
if(pi.t[i].n==st){
f=true;
}
}
if(!f){
var o=new Object;
o.n=st;
pi.t[i]=o;
gi.save();
}
grpDrop2(st,dg);
var anim=new Anim;
anim.addNode(sprite,Anim.CLOSE,tgt);
anim.go();
var msg;
if(type=="tilex"){
msg="%1 has been added to %2.";
}else{
msg="%1 has been copied to %2.  Do you also wish to remove it from %3?";
}
msg=msg.replace("%1", a9GetAttribute(src, "a9x:lab")).
replace("%2", a9GetAttribute(tgt, "a9x:lab")).
replace("%3", curTabLab());
function checkDel(){
if(type=="tilex"){
alert(msg);
}else{
if(confirm(msg)){
delTile(st);
}
}
}
setTimeout(checkDel,0);
}
}
break;
case "grp":
var sg=a9GetAttribute(src, "a9x:g");
var tg=a9GetAttribute(tgt, "a9x:g");
if(sg==tg) return;
var gi=new GroupInfo;
if(sg&&tg){
src=findGroup(src);
tgt=findGroup(tgt);
if(src&&tgt){
var anim=new Anim;
anim.addNode(src,Anim.OPEN,sprite);
if(getOffsetTop(src)<getOffsetTop(tgt)){
tgt.parentNode.insertBefore(src,tgt.nextSibling);
gi.moveGrp(sg,tg,false);
}else{
tgt.parentNode.insertBefore(src,tgt);
gi.moveGrp(sg,tg,true);
}
anim.go();
gi.save();
}
}
break;
}
}
function Anim(){
this.a=new Array;
this.time=300;
this.steps=8;
}
Anim.MOVE=0;
Anim.CLOSE=1;
Anim.OPEN=2;
Anim.prototype.addNode=function(n,m,s){
if(a9IsIE&&a9VersionMajor==5&&a9VersionMinor<5){
return;
}
if(!n) return;
var c=cloneNoId(n,true);
var r=m==Anim.OPEN?s:n;
var ai={n:n,c:c,m:m,s:s,sl:getOffsetLeft(r),st:getOffsetTop(r),sw:r.offsetWidth,sh:r.offsetHeight}
c.style.position="absolute";
c.style.overflow="hidden";
c.style.top=ai.st+"px";
c.style.left=ai.sl+"px";
c.style.width=ai.sw+"px";
c.style.height=ai.sh+"px";
c.style.zIndex=1000+this.a.length;
document.body.appendChild(c);
n.style.visibility="hidden";
c.style.visibility="";
if(a9IsMac&&a9IsMoz){
n.className+=" macMozHide";
}
this.a.push(ai);
}
Anim.prototype.go=function(){
var th=this;
function step(){
if(++th.step==th.steps){
th.clean();
if(th.doneCB) th.doneCB(th.doneArg);
}else{
for(var i=0;i<th.a.length;i++){
var ai=th.a[i];
if(ai.jump) continue;
var steps=th.steps;
if(ai.m==Anim.CLOSE)--steps;
var c=ai.c;
c.style.top=(ai.st+(ai.et-ai.st) * th.step / steps)+"px";
c.style.left=(ai.sl+(ai.el-ai.sl) * th.step / steps)+"px";
if(ai.sw!=ai.ew||ai.sh!=ai.eh){
c.style.clip="rect(0 "+(ai.sw+(ai.ew-ai.sw) * th.step / steps)+"px "+(ai.sh+(ai.eh-ai.sh) * th.step / steps)+"px 0)";
}
}
setTimeout(step,th.time/th.steps);
}
}
if(a9IsIE&&a9VersionMajor==5&&a9VersionMinor<5){
return;
}
for(var i=0;i<this.a.length;i++){
var ai=this.a[i];
if(!ai.jump) ai.c.className=ai.c.className+" animate"
ai.c.style.display="";
var n=ai.m==Anim.CLOSE?ai.s:ai.n;
if(!n||n.style.display=="none"||n.offsetParent==null){
ai.el=ai.sl;
ai.et=ai.et;
ai.ew=ai.eh=0;
}else{
ai.el=getOffsetLeft(n);
ai.et=getOffsetTop(n);
ai.ew=n.offsetWidth;
ai.eh=n.offsetHeight;
}
ai.c.style.width=(ai.sw>ai.ew ? ai.sw : ai.ew)+"px";
ai.c.style.height=(ai.sh>ai.eh ? ai.sh : ai.eh)+"px";
}
this.step=0;
step();
}
Anim.prototype.clean=function(){
for(var i=0;i<this.a.length;i++){
var ai=this.a[i];
ai.n.style.visibility="";
if(a9IsMac&&a9IsMoz){
ai.n.className=ai.n.className.replace(/ *macMozHide/g, "");
}
document.body.removeChild(ai.c);
}
this.a.length=0;
}
Anim.prototype.setZ=function(n,z){
var ai=this.findAi(n);
if(ai&&ai.c){
ai.c.style.zIndex=z;
}
}
Anim.prototype.setJump=function(n){
this.findAi(n).jump=true;
}
Anim.prototype.findAi=function(n){
for(var i=0;i<this.a.length;i++){
if(this.a[i].n==n){
this.lastN=n;
this.lastAi=this.a[i];
return this.lastAi;
}
}
return null;
}
Anim.prototype.setDoneCB=function(f,arg){
this.doneCB=f;
this.doneArg=arg;
}
var grpDlg;
function showGrpDlg(force){
if(force&&grpDlg){
try{
document.body.removeChild(grpDlg);
}catch (e){}
grpDlg=null;
}
if(grpDlg){
grpDlg.style.display="";
if(a9IsMoz&&a9IsMac){
var main=document.getElementById("main");
if(main){
main.className="nosb";
}
}
}else{
if(!startXmlHttpRequest(A9NOSEARCH+"/opensearch/addGroup.jsp", showGrpLd, null, null, "_t")){
showGrpErr();
}
}
}
function showGrpErr(){
if(confirm("There was an error contacting the server.  Try again?")){
showGrpDlg();
}
}
function showGrpLd(xml,arg,txt,status){
if(!grpDlg){
if(status!=200){
showGrpErr();
}else{
grpDlg=document.createElement("div");
grpDlg.innerHTML=txt;
grpDlg.style.visibility="hidden";
document.body.appendChild(grpDlg);
cbAdd("resize", grpSize);
grpSize();
grpDlg.style.visibility="";
if(a9IsMoz&&a9IsMac){
var main=document.getElementById("main");
if(main){
main.className="nosb";
}
}
}
}
}
function hideGrpDlg(){
if(a9IsMoz&&a9IsMac){
var main=document.getElementById("main");
if(main){
main.className="";
}
}
grpDlg.style.display="none";
}
function grpSize(){
var foot=document.getElementById("botRight");
if(!foot) foot=document.getElementById("footer");
var h=getOffsetTop(foot)+foot.offsetHeight;
var w=document.body.clientWidth;
if(!w){
w=document.body.parentNode.clientWidth;
}
var base=document.getElementById("dialogBase");
var dlg=document.getElementById("dialogAddGroup");
var shdow=document.getElementById("dialogAddGroupShadow");
base.style.height=h+"px";
base.style.width=w+"px";
var dh=h-getPxStyle(dlg, "top") * 2;
var dw=w-getPxStyle(dlg, "left") * 2;
var dc=document.getElementById("dialogContent");
dc.style.height=dh-
document.getElementById("dialogHead").offsetHeight-
document.getElementById("dialogSubHead").offsetHeight-
document.getElementById("dialogFooter").offsetHeight-
getPxStyle(dc, "paddingTop")-getPxStyle(dc, "paddingBottom")-
getPxStyle(dc.parentNode, "paddingTop")-getPxStyle(dc.parentNode, "paddingBottom")+"px";
dlg.style.height=shdow.style.height=dh+"px";
dlg.style.width=shdow.style.width=dw+"px";
}//Copyright 2003-2006 A9.com or its affiliates
function a9loaded(){
document.getElementById("q").focus();
}
function getTileInfo(t){
for(var i=0;i<tileInfo.length;i++){
if(tileInfo[i].t==t){
return tileInfo[i];
}
}
return null;
}
function getTileIndex(t){
for(var i=0;i<tileInfo.length;i++){
if(tileInfo[i].t==t){
return i;
}
}
return-1;
}
function tileToggle(tn){
var cb=document.getElementById("cb"+tn);
var ti=getTileInfo(tn);
if(ti&&cb){
if(top.singleColumn){
if(!ti.o){
for(var i=0;i<tileInfo.length;i++){
if(tileInfo[i].o){
tileInfo[i].o=false;
document.getElementById("cb"+tileInfo[i].t).src=a9Image("hm_radio_off");
}
ti.o=true;
cb.src=a9Image("hm_radio_on");
}
}
}else{
ti.o=!ti.o;
cb.src=a9Image("hm_check_"+(ti.o?"on":"off"));
}
}
saveTiles();
}
tileOpen=tileToggle;
function saveTiles()
{
var gi=new GroupInfo;
var pi=gi.getGroup(pageName);
if(!pi) return;
var olist=pi.t;
var list=new Array;
pi.t=list;
for(var i=0;i<tileInfo.length;i++){
var ti=tileInfo[i];
var o;
if(olist){
for(var j=0;j<olist.length;j++){
if(olist[j].n==ti.t){
o=olist[j];
delete o.f;
if(ti.o){
o.o=1;
}else{
delete o.o;
}
break;
}
}
if(!o){
o=new Object;
o.n=ti.t;
if(ti.o){
o.o=1;
}
}
list[i]=o;
}
}
gi.save();
}
function grpQuery(url){
if(url){
location.href=url;
}
}
function moveTile(st,dt,sprite){
if(st&&dt&&st!=dt){
var src=document.getElementById("cbd"+st);
var dst=document.getElementById("cbd"+dt);
var si=getTileIndex(st);
var di=getTileIndex(dt);
if(si>=0&&di>=0){
var anim=new Anim;
var tmp=tileInfo[si];
if(si<di){
for(var i=si+1;i<=di;i++){
anim.addNode(document.getElementById("cbd"+tileInfo[i].t));
tileInfo[i-1]=tileInfo[i];
}
anim.addNode(src,Anim.OPEN,sprite);
src.parentNode.insertBefore(src,dst.nextSibling);
}else{
for(var i=si-1;i>=di;i--){
anim.addNode(document.getElementById("cbd"+tileInfo[i].t));
tileInfo[i+1]=tileInfo[i];
}
anim.addNode(src,Anim.OPEN,sprite);
src.parentNode.insertBefore(src,dst);
}
tileInfo[di]=tmp;
anim.go();
saveTiles();
}
}
}
function delTile(tn){
var anim=new Anim;
var ix=getTileIndex(tn);
for(var i=ix+1;i<tileInfo.length;i++){
anim.addNode(document.getElementById("cbd"+tileInfo[i].t));
}
var n=document.getElementById("cbd"+tn);
n.parentNode.removeChild(n);
for(i=ix+1;i<tileInfo.length;i++){
tileInfo[i-1]=tileInfo[i];
}
--tileInfo.length;
anim.go();
saveTiles();
}
function addGroup(grp){
location.href=A9HOME+"?ag=1&grp="+grp;
}
function custGrp(){
var grp=prompt("Enter a name for the new group");
if(grp){
location.href=A9NOSEARCH+"/opensearch/searches.jsp?ng="+a9Encode(grp);
}
}
function editGrps(){
location.href=A9NOSEARCH+"/opensearch/searches.jsp?grp="+pageName;
}
function a9resize(){
cbCall("resize");
}

