var menuItemHeight=27;
var delay=100;
var delayStart=250;
var start;
var hideFlag;
var hideTimer;
var showTimer;
var curMenu;
var activeMenu;
var activeIframe;
var onMenu=false;
var menusSize=0;
var hasSelect=false;
var popInfoIndex=-10;
var productInfoIndex=-10;
var popTimeout;
var popDir;
document.onmouseup=mouseUp;
function writeBanner(_1){
var _2=Math.random()+"";
var _3=_2.substring(2,_2.length);
document.writeln("<SCRIPT type=\"text/javascript\" LANGUAGE=\"JavaScript1.1\" SRC=\"http://ad.doubleclick.net/adj/"+_1+";dcopt=ist;tile=1;sz=468x60;ord="+_3+"?\"></SCRIPT>");
}
var img="/images/";
function reload(){
window.location.reload();
}
function ws(s){
window.status=s?s:"";
return true;
}
function pops(_5,w,h){
var _8=window.open(_5,"popup","screenX=0,screenY=0,resizable=yes,scrollbars=yes,height="+h+",width="+w);
_8.focus();
}
function popsCenter(_9,w,h){
var x=(screen.width-w)/2;
var y=(screen.height-h)/2;
var _e=window.open(_9,"popup","screenX="+x+",screenY="+y+",top="+y+",left="+x+",resizable=yes,scrollbars=yes,height="+h+",width="+w);
_e.focus();
}
function popsl(_f,w,h,x,y){
window.open(_f,"popup","screenX="+x+",screenY="+y+",top="+y+",left="+x+",resizable=yes,scrollbars=yes,height="+h+",width="+w);
}
function pop(url){
pops(url,520,300);
}
function fs(){
pops("/pop/featuredStore?js=0",520,330);
}
function fsp(){
pops("/pop/featuredStore?ct=cars&js=0",520,330);
}
function fp(){
pops("/pop/featuredProduct?js=0",550,380);
}
function ts(){
pops("/pop/trustedStore?js=0",520,470);
}
function sb(){
pops("/pop/smartBuy?js=0",520,450);
}
function wl(){
pops("/pop/whyStoresListed?js=0",520,500);
}
function ii(){
pops("/pop/informativeInterstitial?js=0",440,280);
}
var poppedWindow=null;
function popBottomRight(url,w,h){
var _18=screen.width,_19=screen.height;
var _1a=_18-w,_1b=_19-h;
_1a-=15;
_1b-=17;
if(_1a<0){
_1a=0;
}
if(_1b<0){
_1b=0;
}
if(poppedWindow==null||poppedWindow.closed){
poppedWindow=window.open(url,"popup","width="+w+",height="+h+",screenX="+_1a+",screenY="+_1b+",top="+_1b+",left="+_1a+",resizable=yes,scrollbars=yes");
}
poppedWindow.focus();
}
function dc(url,ct){
document.write("<a href="+url+"&CT="+ct+">");
}
function userStatusPopup(_1e){
if(_1e=="lead"){
pops("/pop/memberLead",500,200);
}else{
if(_1e=="advisor"){
pops("/pop/memberAdv",500,200);
}else{
pop("/pop/memberTopRev",500,200);
}
}
}
function bookmark(){
var _1f=window.location.href;
var _20=document.title;
if(window.sidebar){
window.sidebar.addPanel(_20,_1f,"");
}else{
if(document.all){
window.external.AddFavorite(_1f,_20);
}else{
if(window.opera&&window.print){
var _21=document.createElement("a");
_21.setAttribute("href",_1f);
_21.setAttribute("title",_20);
_21.setAttribute("rel","sidebar");
_21.click();
}
}
}
}
function sortReviews(prd,_23,z){
var _25=document.frmSort;
var i=_25.sortby.selectedIndex;
var _27=_25.sortby.options[i].value;
var n;
if(prd){
n="/xPR-"+prd+"~S-"+_27;
if(z==1){
n=n+"~ZD-"+z;
}
}else{
n="/xMR-"+_23+"~S-"+_27;
}
document.location.href=n;
}
linkName2Index=new Object();
function getLinkNamed(_29){
var d=document;
if(linkName2Index[_29]>=0){
return d.links[linkName2Index[_29]];
}
var n=d.links.length-1;
for(var i=n;i>=0;i--){
if(typeof d.links[i].name!="undefined"){
if(d.links[i].name==_29){
linkName2Index[d.links[i].name]=i;
return d.links[i];
}
}
}
return null;
}
function cpl(_2d,to,ct){
var _30=getLinkNamed(_2d);
var _31=getLinkNamed(to);
if(_30!=null&&_31!=null){
var _32=_31.innerHTML;
var _33=_30.href.lastIndexOf("&CT=");
if(_33!=-1){
_31.href=_30.href.substring(0,_33+4)+ct;
}else{
_31.href=_30.href;
}
_31.innerHTML=_32;
_31.target=_30.target;
_31.className="";
_31.onclick=_30.onclick;
}
}
function prodSel(){
var _34=document.getElementsByName("cmpbox");
var n=_34.length;
for(var i=0;i<n;i++){
var _37=document.getElementById("prdRow"+_34[i].value).childNodes;
var _38;
for(var j=0;j<_37.length;j++){
_38=_37[j];
if(_34[i].checked){
_38.style.backgroundColor="#f0f3e4";
_38.style.borderTop="1px #bbcb90 solid";
}else{
_38.style.backgroundColor="#fff";
_37[0].style.backgroundColor="#f7f5d7";
if(i==0){
_38.style.borderTop="1px #ccc solid";
}else{
if(_34[i-1].checked){
_38.style.borderTop="1px #bbcb90 solid";
}else{
_38.style.borderTop="1px #ccc solid";
}
}
}
}
}
}
function handlePrdLnk(_3a,_3b,_3c,_3d,_3e,_3f){
_3a=getPageLink(_3a);
if(_3b>1){
_3a+="~PG-"+_3b;
}else{
_3a=checkBeforeSbs(_3a);
}
if(_3a==-1){
displayPopup("/pop/sbs_oops","","sbs_oopsArea",_3d,_3e,_3f);
}else{
if(_3a==-2){
return;
}else{
document.location.href=_3a;
}
}
}
function checkBeforeSbs(_40){
var _41=_40;
if(_40.indexOf("xSBS")!=-1){
if(_40.indexOf("PRDLT-")==-1){
_41=-1;
}else{
var _42=_40.substring(_40.indexOf("PRDLT-"));
var _43=_42.split("-");
if(document.location.href.indexOf("dealtime")>-1&&_43.length>6){
alert("Please select only 5 products or less");
return -2;
}
}
}
return _41;
}
function getPageLink(_44){
var _45=document.getElementsByName("cmpbox");
var _46;
var _47="~PRDLT";
var pos=_44.indexOf("PRDLT");
if(pos!=-1){
_46=getProductsFromUrl(_44);
_47="";
}
var _49=0;
var _4a=0;
var n=_45.length;
for(var i=0;i<n;i++){
if(_45[i].checked&&!existsInArray(_45[i].value,_46)){
_47+="-"+_45[i].value;
_49=1;
}else{
if(!_45[i].checked&&existsInArray(_45[i].value,_46)){
_44=removePrdFromUrl(_44,_45[i].value);
_4a++;
}
}
}
if(_49){
_44+=_47;
}else{
if(_46&&_4a==(_46.length-1)){
_44=_44.replace("~PRDLT","");
}
}
return _44;
}
function getProductsFromUrl(_4d){
var _4e=_4d.split("~");
var _4f;
var n=_4e.length;
for(var i=0;i<n;i++){
if(_4e[i].indexOf("PRDLT")!=-1){
_4f=_4e[i].split("-");
break;
}
}
return _4f;
}
function existsInArray(val,_53){
var _54=0;
if(_53){
var n=_53.length;
for(var i=0;i<n;i++){
if(val==_53[i]){
_54=1;
break;
}
}
}
return _54;
}
function removePrdFromUrl(_57,val){
return _57.replace("-"+val,"");
}
function sortProducts(){
var _59=document.frmSort;
document.location.href="/xPP-"+_59.seoUrl.value+"~S-"+_59.sortDropDown.options[_59.sortDropDown.selectedIndex].value;
}
function chgl(_5a,_5b,_5c,_5d){
var _5e=_5b.split("|");
var n=_5e.length;
for(var j=0;j<n;j++){
changeLink(_5a,"PL"+_5d+_5e[j],_5e[j]);
}
changeLink(_5a,"PLP"+_5d,_5c-1);
changeLink(_5a,"PLN"+_5d,parseInt(_5c)+1);
}
function changeLink(_61,_62,_63){
var _64=getLinkNamed(_62);
if(_64!=null){
_64.href="javascript:handlePrdLnk('"+escape(_61)+"','"+_63+"')";
}
}
function changePrefDomain(_65,_66,_67){
var _68=new Date();
_68.setFullYear(_68.getFullYear()+1);
document.cookie="prefServer="+escape(_65)+";expires="+_68.toGMTString()+";path=/"+";domain="+_67;
_redirect("http://"+_65+"/?ncrd=1&pref=1&linkin_id="+_66);
}
function _redirect(url){
if(url){
opener.location.href=url;
}
window.close();
}
function selectPrefDomain(_6a,_6b){
var _6c=document.forms[_6a].elements["pref"];
var n=_6c.length;
for(var i=0;i<n;i++){
if(_6c[i].checked){
changePrefDomain(_6c[i].value,"",_6b);
}
}
}
function createCookie(_6f,_70,_71,_72){
if(_71){
var _73=new Date();
_73.setTime(_73.getTime()+(_71*86400000));
var _74="; expires="+_73.toGMTString();
}else{
var _74="";
}
document.cookie=_6f+"="+escape(_70)+_74+"; path=/"+(_72?"; domain="+_72:"");
}
function readCookie(_75){
var _76=_75+"=";
var ca=document.cookie.split(";");
var n=ca.length;
for(var i=0;i<n;i++){
var c=ca[i];
while(c.charAt(0)==" "){
c=c.substring(1,c.length);
}
if(c.indexOf(_76)==0){
return unescape(c.substring(_76.length,c.length));
}
}
return null;
}
function eraseCookie(_7b){
createCookie(_7b,"",-1,domain);
}
function lz(x){
var t=String(x);
return t.length==1?"0"+t:t;
}
var savedList=new Object();
var domain;
savedList.init=function(){
this.items=new Object();
this.name="list2";
this.domain=domain;
var _7e=readCookie(this.name);
if(_7e&&_7e!="empty"){
var _7f=_7e.split("^");
for(var i in _7f){
var _81=_7f[i].split("=");
this.items[unescape(_81[0])]=unescape(_81[1]);
}
}
};
savedList.init();
savedList.edit=function(add,id){
var _84=0;
if(readCookie(this.name)==null){
pops("/pop/savedList",470,420);
}
this.init();
if(add&&this.count()<50){
var d=new Date();
this.items[id]=""+d.getFullYear()+lz(d.getMonth()+1)+lz(d.getDate())+lz(d.getHours())+lz(d.getMinutes())+lz(d.getSeconds());
_84=1;
}else{
delete this.items[id];
_84=0;
}
createCookie(this.name,this.toString(),730,this.domain);
if(document.getElementById("savedListCount")){
var _86=this.count();
document.getElementById("savedListCount").childNodes[0].nodeValue=_86;
document.getElementById("savedListStatus").className=(_86>0?"saveBoxOn":"saveBoxOff");
}
var img=new Image(1,1);
img.src="/otf?type=sl&act="+(add?1:0)+"&id="+id;
return _84;
};
savedList.contains=function(id){
return typeof (this.items[id])!="undefined";
};
savedList.toString=function(){
var out="";
for(var id in this.items){
if(out!=""){
out+="^";
}
out+=escape(id)+"="+escape(this.items[id]);
}
if(out==""){
out="empty";
}
return out;
};
savedList.count=function(){
var sl=readCookie(this.name);
if(sl==null||sl.length==0||sl=="empty"){
return 0;
}
var _8c=sl.split("^");
if(_8c==null){
return 0;
}
return _8c.length;
};
savedList.saved="";
savedList.saveIt="";
savedList.over=function(_8d){
if(_8d.className=="save off"){
_8d.className="save hover";
}
};
savedList.over=function(_8e){
if(_8e.className=="save hover"){
_8e.className="save off";
}
};
savedList.click=function(_8f){
var _90=(_8f.className=="save hover"||_8f.className=="save off");
var _91=savedList.edit(_90,_8f.id);
_8f.className=(_91?"save on":"save off");
_8f.childNodes[1].childNodes[0].nodeValue=(_91?savedList.saved:savedList.saveIt);
};
function writeSaveBox(id){
document.write("<span class=\""+(savedList.contains(id)?"save on":"save off")+"\" id=\""+id+"\" onmouseover=\"savedList.over(this)\" onmouseout=\"savedList.over(this)\" onclick=\"savedList.click(this)\"><img width=\"17\" height=\"13\" src=\"http://img.shopping.com/sc/glb/spacer.gif\" alt=\"\" /><span class=\"msg\">"+(savedList.contains(id)?savedList.saved:savedList.saveIt)+"</span></span>");
}
function validateInput(_93){
if(document.forms[0].FD&&document.forms[0].FD.value<0){
document.forms[0].FD.value=0;
}
if(_93.value==""){
return false;
}
return true;
}
function toggle(_94){
if(document.getElementById(_94).style.display=="none"){
document.getElementById(_94).style.display="block";
}else{
document.getElementById(_94).style.display="none";
}
return true;
}
function on(_95){
if(document.getElementById(_95)!=null){
document.getElementById(_95).style.display="block";
}
return true;
}
function off(_96){
if(document.getElementById(_96)!=null){
document.getElementById(_96).style.display="none";
}
return true;
}
function byClass(_97,_98,_99){
var _9a=new Array();
_9a=document.getElementsByTagName("div");
var n=_9a.length;
for(var i=0;i<n;i++){
if(_98=="on"){
if(_9a[i].className==_97){
_9a[i].style.display="block";
}
}
if(_98=="off"){
if(_9a[i].className==_97){
_9a[i].style.display="none";
}
}
if(_98=="toggle"){
if(_9a[i].style.display=="none"){
_9a[i].style.display="block";
}else{
_9a[i].style.display="none";
}
}
}
}
function swap(id1,id2){
on(id1);
off(id2);
return true;
}
function WTBToggleOpen(){
on("wtb");
document.getElementById("close").style.display="inline";
document.getElementById("open").style.display="none";
return true;
}
function WTBToggleClose(){
off("wtb");
document.getElementById("open").style.display="inline";
document.getElementById("close").style.display="none";
return true;
}
function assembleSegments(_9f){
var _a0="";
var _a1=0;
var n=_9f.length;
for(var i=0;i<n;i++){
var _a4=_9f[i].split("_");
_a0+=_a1>0?";s"+"="+_a4[1]:";s"+"="+_a4[1];
_a1++;
}
return _a0;
}
function $(){
var _a5=new Array();
var n=arguments.length;
for(var i=0;i<n;i++){
var _a8=arguments[i];
if(typeof _a8=="string"){
_a8=document.getElementById(_a8);
}
if(arguments.length==1){
return _a8;
}
_a5.push(_a8);
}
return _a5;
}
function get(){
return $(arguments);
}
function multiPageSBS(_a9,_aa){
var _ab="";
var _ac=false;
var _ad="";
var _ae="0123456789";
if((_aa!=null)&&(_aa.length>0)){
_ab=_aa.substring(0,1);
if(_aa.length>1){
var _af=_aa.charAt(1);
if(_af!=null){
if(_ae.indexOf(_af)!=-1){
_ac=true;
}
}
}
if((_ab=="1")&&(!_ac)){
_ad=_aa.substring(1,_aa.length);
}else{
_ad="~PG-"+_aa;
}
}
document.location.href=getPageLink(_a9)+_ad;
}
function dealclick(_b0,_b1,ct){
var _b3=getLinkNamed(_b1).href;
var i=_b3.lastIndexOf("&CT=");
if(i!=-1){
_b0.href=_b3.substring(0,i+4)+ct;
}else{
_b0.href=_b3;
}
}
function getElementsByClassName(_b5,_b6,_b7){
_b6=_b6||"*";
_b7=_b7||document;
var _b8=(_b6=="*"&&document.all&&!window.opera)?document.all:_b7.getElementsByTagName(_b6);
var arr=new Array();
var _ba=_b5.indexOf("|")!=-1?"|":" ";
var _bb=_b5.split(_ba);
var j=_b8.length;
for(var i=0;i<j;i++){
var _be=_b8[i].className.split(" ");
if(_ba==" "&&_bb.length>_be.length){
continue;
}
var c=0;
var z=_be.length;
comparisonLoop:
for(var k=0;k<z;k++){
var n=_bb.length;
for(var m=0;m<n;m++){
if(_bb[m]==_be[k]){
c++;
}
if((_ba=="|"&&c==1)||(_ba==" "&&c==_bb.length)){
arr.push(_b8[i]);
break comparisonLoop;
}
}
}
}
return arr;
}
Array.prototype.push=function(_c4){
this[this.length]=_c4;
};
var max="11";
var addOptAlertMsg="Please select only 10 options or less.";
function add(){
var _c5=0;
var n=document.forms["multiselect"].length;
for(var i=0;i<n;i++){
var e=document.forms["multiselect"].elements[i];
if(e.type=="checkbox"&&e.checked){
_c5++;
}
}
if(_c5>=max){
alert(addOptAlertMsg);
return false;
}else{
return true;
}
}
function updateSurveyCookie(){
var c=getCookie("session");
var d=window.location.href;
if(c){
c=c.replace("FBS%3D0","FBS%3D1");
if(d.indexOf("doorone.com")>0){
document.cookie="session="+c+";path=/;domain=doorone.com;";
}else{
if(d.indexOf("shopping.com")>0){
document.cookie="session="+c+";path=/;domain=shopping.com;";
}
}
}
}
function getCookie(_cb){
if(document.cookie.length>0){
start=document.cookie.indexOf(_cb+"=");
if(start!=-1){
start=start+_cb.length+1;
end=document.cookie.indexOf(";",start);
if(end==-1){
end=document.cookie.length;
}
return document.cookie.substring(start,end);
}
}
return null;
}
function showGalleryDiv(_cc,_cd,_ce,_cf){
if(galleryImages!=null){
var _d0=document.getElementById(_ce+_cf);
_d0.src=galleryImages[_cf-1][0];
_d0.height=galleryImages[_cf-1][1];
_d0.width=galleryImages[_cf-1][2];
if(galleryImages.length>2&&_cf>1&&_cf<galleryImages.length){
_d0=document.getElementById(_ce+(_cf-1));
_d0.src=galleryImages[_cf-2][0];
_d0.height=galleryImages[_cf-2][1];
_d0.width=galleryImages[_cf-2][2];
_d0=document.getElementById(_ce+(_cf+1));
_d0.src=galleryImages[_cf][0];
_d0.height=galleryImages[_cf][1];
_d0.width=galleryImages[_cf][2];
}
}
document.getElementById(_cd).style.display="none";
document.getElementById(_cc).style.display="block";
}
function dl(url){
window.location.href=url;
return true;
}
function changeLocation(_d2){
var _d3=_d2.options[_d2.selectedIndex].value;
if(_d3!=""){
window.location=_d3;
}
}
function changeSortLocation(_d4){
var _d5=_d4.options[_d4.selectedIndex].value;
if(_d5!=""){
window.location=_d5+"#stt";
}
}
var debugAJAX=false;
function makeAJAHRequest(_d6,uri,_d8,_d9,_da){
var _db=null;
if(window.XMLHttpRequest){
_db=new XMLHttpRequest();
}else{
if(window.ActiveXObject){
_db=new ActiveXObject("Microsoft.XMLHTTP");
}
}
if(_db!=undefined){
_db.onreadystatechange=function(){
ajahRequestCompleted(_db,uri,_d8,_d9,_da);
};
_db.open(_d6,uri,true);
if(!_d6){
_d6="POST";
}
if(_d6=="POST"){
_db.setRequestHeader("Connection","close");
_db.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=UTF-8");
_db.setRequestHeader("Method","POST "+uri+"HTTP/1.1");
}
if(_d8){
_db.send(_d8);
}else{
_db.send("");
}
}
}
function ajahRequestCompleted(_dc,uri,_de,_df,_e0){
if(_dc.readyState==4){
if(_dc.status==200){
if(debugAJAX){
var _e1;
if(_de){
_e1=uri+"?"+_de;
}else{
_e1=uri;
}
_df.innerHTML="<div class=\"debugAJAXBox\"><div class=\"debugAJAXPath\">AJAX content: <a class=\"debugAJAXAnchor\" href=\""+_e1+"\">"+_e1+"</a></div><br />"+_dc.responseText+"</div>";
}else{
_df.innerHTML=_dc.responseText;
}
if(_e0!=null){
_e0(_dc);
}
}
}
}
function toggleAJAXBorders(){
if(debugAJAX){
debugAJAX=false;
document.getElementById("debugToggleAJAXSpan").innerHTML=" (Current state: Off)";
}else{
debugAJAX=true;
document.getElementById("debugToggleAJAXSpan").innerHTML=" (Current state: On)";
}
}
function setMenusSize(_e2){
menusSize=_e2;
}
function moveMenu(num,_e4){
var _e5=getObj("menu"+num);
var tab=getObj("tab"+num);
var _e7=getObj("ifr"+num);
_e5.style.left=findPosX(tab)+"px";
_e5.style.top=((findPosY(tab)-1)+menuItemHeight)+"px";
if(navigator.appName=="Microsoft Internet Explorer"){
_e7.style.left=findPosX(tab)+"px";
_e7.style.top=(findPosY(tab)+menuItemHeight-1)+"px";
if(!_e7.style.height){
_e7.style.height=(_e4*menuItemHeight)+"px";
}
}
}
function showMenus(_e8){
onMenu=true;
activeMenu="menu"+curMenu;
activeIframe="ifr"+curMenu;
moveMenu(curMenu,_e8);
closeSSD();
getObj(activeMenu).style.visibility="visible";
if(navigator.appName=="Microsoft Internet Explorer"){
getObj(activeIframe).style.display="block";
getObj(activeIframe).style.filter="progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)";
}
if(document.getElementById("searchTxtField")!=null){
document.getElementById("searchTxtField").blur();
}
}
function startShow(_e9,_ea){
if(informativeSurveyShow){
return;
}
moveMenu(_e9,_ea);
curMenu=_e9;
if(activeMenu){
getObj(activeMenu).style.visibility="hidden";
}
clearHideTimer();
if(!onMenu){
showTimer=setTimeout("showMenus()",delayStart);
}else{
showMenus(_ea);
}
}
function sMH(){
if(showTimer){
clearTimeout(showTimer);
}
start=new Date();
hideFlag=true;
hideTimer=setTimeout("hideMenus()",delay);
}
function clearHideTimer(){
if(hideTimer){
clearTimeout(hideTimer);
}
hideTimer=null;
hideFlag=false;
}
function hideMenus(){
if(!hideFlag){
return;
}
var _eb=new Date()-start;
if(_eb<delay){
hideTimer=setTimeout("hideMenus()",delay-_eb);
return;
}
hideFlag=false;
hideAllMenus();
}
function hideAllMenus(){
if(activeMenu){
getObj(activeMenu).style.visibility="hidden";
}
if(navigator.appName=="Microsoft Internet Explorer"&&activeIframe){
getObj(activeIframe).style.display="none";
}
for(var i=0;i<menusSize;i++){
var _ed=getObj("menu"+i);
var _ee=getObj("ifr"+i);
if(_ed){
_ed.style.visibility="hidden";
}
if(navigator.appName=="Microsoft Internet Explorer"&&_ee){
_ee.style.display="none";
}
}
onMenu=false;
if(document.getElementById("searchTxtField")!=null){
document.getElementById("searchTxtField").focus();
}
}
function hIfr(){
for(var i=0;i<menusSize;i++){
var _f0=getObj("ifr"+i);
if(navigator.appName=="Microsoft Internet Explorer"&&_f0){
_f0.style.display="none";
}
}
}
function getObj(_f1){
if(document.getElementById){
var _f2=document.getElementById(_f1);
}else{
if(document.all){
var _f2=document.all[_f1];
}
}
return _f2;
}
function findPosX(obj){
var _f4=0;
if(obj.offsetParent){
while(obj.offsetParent){
_f4+=obj.offsetLeft;
obj=obj.offsetParent;
}
}else{
if(obj.x){
_f4+=obj.x;
}
}
return _f4;
}
function findPosY(obj){
var _f6=0;
if(obj.offsetParent){
while(obj.offsetParent){
_f6+=obj.offsetTop;
obj=obj.offsetParent;
}
}else{
if(obj.y){
_f6+=obj.y;
}
}
return _f6;
}
if(document.addEventListener){
document.addEventListener("mouseup",mouseUp,false);
}
function mouseUp(){
return true;
}
var top5mpDelay=500;
var items;
var itemScores;
var itemImageURLs;
var itemPrices;
var itemUniqueNames;
var itemCompareStores;
var itemIds;
var numResults;
var urlLinks;
var numItems;
var opened=false;
var wipeInTop5MP=true;
var openedByDefault=false;
var waitingForSelectorLoad=false;
function selectorChange(){
var ind=$("selectorDropdown").selectedIndex;
if(ind!=0){
ind=ind-1;
if(selectors[ind][3]==null){
selectors[ind][3]="";
}
waitingForSelectorLoad=true;
dojo.io.bind({url:"/top5mpAjaxContent",content:{displayName:selectors[ind][0],formId:selectors[ind][1],formName:selectors[ind][2],type:selectors[ind][3],attributeValue:selectors[ind][4],searchTerm:selectors[ind][5],firstArgSearch:selectors[ind][6],multAtt:selectors[ind][7],searchType:selectors[ind][8],clickedLinkTypePage:cltPage},load:function(_f8,_f9,evt){
if(debugAJAX){
var _fb="/top5mpAjaxContent?displayName="+selectors[ind][0]+"&formId="+selectors[ind][1]+"&formName="+selectors[ind][2]+"&type="+selectors[ind][3]+"&attributeValue="+selectors[ind][4]+"&searchTerm="+selectors[ind][5]+"&firstArgSearch="+selectors[ind][6]+"&multAtt="+selectors[ind][7]+"&searchType="+selectors[ind][8]+"&clickedLinkTypePage="+cltPage;
dojo.byId("ccArea").innerHTML="<div class=\"debugAJAXBox\"><div class=\"debugAJAXPath\">AJAX content: <a class=\"debugAJAXAnchor\" href=\""+_fb+"\">"+_fb+"</a></div><br />"+dojo.byId("ccArea").innerHTML+"</div>";
}
response=dojo.dom.createDocumentFromText(_f9);
itemNodes=response.getElementsByTagName("Item");
items=new Array();
itemScoreNodes=response.getElementsByTagName("ItemScore");
itemScores=new Array();
if(structured){
itemImageURLNodes=response.getElementsByTagName("ItemImageURL");
itemImageURLs=new Array();
itemPriceNodes=response.getElementsByTagName("ItemPrice");
itemPrices=new Array();
itemUniqueNameNodes=response.getElementsByTagName("ItemUniqueName");
itemUniqueNames=new Array();
itemCompareStoresNodes=response.getElementsByTagName("ItemCompareStores");
itemCompareStores=new Array();
itemIdNodes=response.getElementsByTagName("ItemId");
itemIds=new Array();
formSEONameNodes=response.getElementsByTagName("FormSEOName");
if(formSEONameNodes.length==1&&formSEONameNodes[0].firstChild.data!=null){
formSEOName=formSEONameNodes[0].firstChild.data;
}
}else{
numResultNodes=response.getElementsByTagName("NumResults");
numResults=new Array();
urlLinkNodes=response.getElementsByTagName("URLLink");
urlLinks=new Array();
}
var _fc="";
numItems=itemNodes.length;
for(var i=0;i<numItems;i++){
items[i]=itemNodes[i].firstChild.data;
itemScores[i]=itemScoreNodes[i].firstChild.data;
if(structured){
itemImageURLs[i]=itemImageURLNodes[i].firstChild.data;
itemPrices[i]=itemPriceNodes[i].firstChild.data;
itemUniqueNames[i]=itemUniqueNameNodes[i].firstChild.data;
itemCompareStores[i]=itemCompareStoresNodes[i].firstChild.data;
itemIds[i]=itemIdNodes[i].firstChild.data;
_fc+="-"+itemIds[i];
}else{
urlLinks[i]=urlLinkNodes[i].firstChild.data;
numResults[i]=numResultNodes[i].firstChild.data;
}
}
itemsTableNodes=response.getElementsByTagName("ItemsTable");
if(itemsTableNodes.length>0){
dojo.byId("top5mpInnerTable").innerHTML=itemsTableNodes[0].firstChild.data;
}
waitingForSelectorLoad=false;
if(numItems>0){
instantMouseOverItem(0);
var n=items.length;
for(var i=0;i<n;i++){
var _ff=itemScores[i]*(77/100);
var _100="ccPopularity";
if(_ff>10&&_ff<48){
_100="ccPopularityMid";
}
if(_ff<10){
_100="ccPopularity1-10";
}
if(_ff<2){
_ff=2;
}
dojo.byId("rank"+i).innerHTML="#"+(i+1);
var _101;
var _102;
if(structured){
_101="/xPO-"+itemUniqueNames[i];
_102="<a href=\""+_101+"?CLT=T5"+cltPage+"1\"><img src=\""+itemImageURLs[i]+"\" width=\"30\" height=\"30\" class=\"pR5\" alt=\"\" onmouseover=\"insideMouseOver("+i+")\" onclick=\"s_objectID='T5MP_S_1';\"/></a>";
}else{
_101="/xDN-"+urlLinks[i];
_102="<div style=\"width:10px;height:30px\">";
}
dojo.byId("item"+i).innerHTML="<table cellpadding=\"0\" cellspacing=\"0\" summary=\"\"><tr><td>"+_102+"</td><td><a href=\""+_101+"?CLT=T5"+cltPage+"2\" onclick=\"s_objectID='T5MP_A_2';\">"+items[i]+"</a></td></tr></table>";
if(!structured){
dojo.byId("numResults"+i).innerHTML=numResults[i];
}
dojo.byId("itemScore"+i).innerHTML="&nbsp;<img src=\"http://img.shopping.com/jfe/bb/ratings/"+_100+".jpg\" width=\""+_ff+"\" height=\"13\" class=\"vMid\" onmouseover=\"insideMouseOver("+i+")\" alt=\"\" /><span class=\"vMid\">&nbsp;"+itemScores[i]+"</span>";
dojo.html.show("rank"+i);
dojo.html.show("item"+i);
dojo.html.show("itemScore"+i);
}
if(structured){
if(numItems==1){
dojo.html.hide("ct5Msg");
dojo.html.show("pdMsg");
dojo.byId("pdLink").href="/xPF-"+itemUniqueNames[0]+"?CLT=T5"+cltPage+"7";
}else{
dojo.html.hide("pdMsg");
dojo.html.show("ct5Msg");
if(differentFormNames){
var _103="/xSBS-"+formSEOName+"-~PRDLT";
}
dojo.byId("compareTopNLink").href=_103+_fc+"?CLT=T5"+cltPage+"7";
dojo.byId("numToCompare").innerHTML=numItems+" ";
}
}
}
if(!opened){
opened=true;
dojo.html.show("ccInnerDiv");
dojo.html.hide("ccBottom1");
if(!wipeInTop5MP){
wipeInTop5MP=true;
}else{
dojo.lfx.html.wipeIn("ccInnerDiv",500,null,null).play();
}
}
if(!openedByDefault){
var img=new Image(1,1);
img.src="/otf?type=t5&act="+cltPage+"&id="+ind;
}else{
openedByDefault=false;
}
if(numItems>0){
var n=items.length;
for(var i=n;i<numItems;i++){
dojo.html.hide("rank"+i);
dojo.html.hide("item"+i);
dojo.html.hide("itemScore"+i);
}
}
},mimetype:"text/plain",transport:"XMLHTTPTransport"});
}
}
function changeItemDetails(_105){
if(!structured){
return;
}
var _106;
var _107;
_106="/xPO-"+itemUniqueNames[_105];
_107="<a href=\""+_106+"?CLT=T5"+cltPage+"3\" onclick=\"s_objectID='T5MP_A_3';\"><img src=\""+itemImageURLs[_105]+"\" alt=\"\" /></a>";
if(document.getElementById("itemDetails")){
var _108="<div class=\"ccMainImg\">"+_107+"</div>";
_108+="<div style=\"height:40px\"><a href=\""+_106+"?CLT=T5"+cltPage+"4\" onclick=\"s_objectID='T5MP_A_4';\">"+items[_105]+"</a></div><div style=\"height:30px\">"+itemPrices[_105]+"</div>"+itemCompareStores[_105];
dojo.byId("itemDetails").innerHTML=_108;
}
}
var prevNextStep=-1;
var nextStep=-1;
function mouseOverItem(_109){
if(waitingForSelectorLoad){
return;
}
if(structured){
nextStep=_109;
prevNextStep=_109;
setTimeout("doMouseOverItem("+_109+")",top5mpDelay);
}else{
doMouseOverItem(_109);
}
}
function instantMouseOverItem(_10a){
if(waitingForSelectorLoad){
return;
}
if(structured){
nextStep=_10a;
prevNextStep=_10a;
}
doMouseOverItem(_10a);
}
function doMouseOverItem(_10b){
if(waitingForSelectorLoad){
return;
}
if(nextStep==_10b||!structured){
for(var i=0;i<numItems;i++){
if(i!=_10b){
if(numItems==maxItems&&i==numItems-1){
dojo.byId("rankTd"+i).className="itemRowUnselectedLast";
dojo.byId("itemTd"+i).className="itemRowUnselectedLast";
dojo.byId("itemScoreTd"+i).className="itemRowUnselectedLast";
if(!structured){
dojo.byId("numResultsTd"+i).className="itemRowUnselectedLast";
}
}else{
dojo.byId("rankTd"+i).className="itemRowUnselected";
dojo.byId("itemTd"+i).className="itemRowUnselected";
dojo.byId("itemScoreTd"+i).className="itemRowUnselected";
if(!structured){
dojo.byId("numResultsTd"+i).className="itemRowUnselected";
}
}
}
}
if(numItems==maxItems&&_10b==numItems-1){
dojo.byId("rankTd"+_10b).className="itemRowSelectedLast";
dojo.byId("itemTd"+_10b).className="itemRowSelectedLast";
dojo.byId("itemScoreTd"+_10b).className="itemRowSelectedLast";
if(!structured){
dojo.byId("numResultsTd"+_10b).className="itemRowSelectedLast";
}
}else{
dojo.byId("rankTd"+_10b).className="itemRowSelected";
dojo.byId("itemTd"+_10b).className="itemRowSelected";
dojo.byId("itemScoreTd"+_10b).className="itemRowSelected";
if(!structured){
dojo.byId("numResultsTd"+_10b).className="itemRowSelected";
}
}
changeItemDetails(_10b);
}
}
function mouseOutItem(_10d){
if(waitingForSelectorLoad){
return;
}
if(structured){
nextStep=-1;
}
}
function insideMouseOver(i){
if(waitingForSelectorLoad){
return;
}
if(structured){
nextStep=prevNextStep;
}
}
function openByDefault(){
if(top5mpIsEnabled){
openedByDefault=true;
wipeInTop5MP=false;
if(dojo.byId("selectorDropdown").options.length>1){
dojo.byId("selectorDropdown").selectedIndex=1;
selectorChange();
}
}
}
function closeT5MP(){
wipeOutCallback=function(){
off("ccInnerDiv");
on("ccBottom1");
dojo.byId("selectorDropdown").selectedIndex=0;
opened=false;
};
dojo.lfx.html.wipeOut("ccInnerDiv",500,null,wipeOutCallback).play();
}
function top5mpRestoreSession(){
if(document.getElementById("selectorDropdown").selectedIndex>0){
document.getElementById("selectorDropdown").selectedIndex=0;
}
}
var mouseVerticalPos;
var mouseHorizontalPos;
var popContent="popContent";
var popArea="popArea";
var popArrowLeft="popArrowLeft";
var popArrowRt="popArrowRt";
var popArrowTop="popArrowTop";
var popArrowBtm="popArrowBtm";
var lastTop;
var lastLeft;
var isShort;
function preloadPopupImages(){
var _10f=new Image();
_10f.src="/images/infoPopArrowLeft.gif";
_10f.src="/images/infoPopArrowRt.gif";
_10f.src="/images/infoCornerTopLeft.gif";
_10f.src="/images/infoCornerTopRt.gif";
_10f.src="/images/infoPopTopRepeat.gif";
_10f.src="/images/infoPopLeftRepeat.gif";
_10f.src="/images/infoPopRtRepeat.gif";
_10f.src="/images/infoCornerBtmLeft.gif";
_10f.src="/images/infoCornerBtmRt.gif";
_10f.src="/images/infoPopBtmRepeat.gif";
}
function detectClick(e){
var targ;
if(!e){
e=window.event;
}
if(e.target){
targ=e.target;
}else{
if(e.srcElement){
targ=e.srcElement;
}
}
if(targ.nodeType==3){
targ=targ.parentNode;
}
if(e.type=="mousedown"&&isOutsidePopup(targ)){
closeAllPopups();
}
}
function isOutsidePopup(targ){
if(targ&&targ.id!="popText"&&targ.id!="popTitle"&&targ.id!="popAction"&&targ.id!="popMidRt"&&targ.id.substring(0,9)!="okgnauhc."&&targ.id.substring(0,3)!="IN."&&targ.tagName!="HTML"){
return true;
}
return false;
}
function getPopupTopPos(e,_114){
if(navigator.appName=="Netscape"){
if((window.innerHeight-(e.pageY-window.pageYOffset))<_114){
mouseVerticalPos="bottom";
}else{
mouseVerticalPos="top";
}
return e.pageY;
}else{
if(navigator.appName=="Microsoft Internet Explorer"){
if((document.documentElement.clientHeight-window.event.y)<_114){
mouseVerticalPos="bottom";
}else{
mouseVerticalPos="top";
}
return window.event.y;
}
}
}
function getPopupLeftPos(e,_116){
if(navigator.appName=="Netscape"){
if((window.innerWidth-(e.pageX-window.pageXOffset))<_116){
mouseHorizontalPos="left";
}else{
mouseHorizontalPos="right";
}
return e.pageX;
}else{
if(navigator.appName=="Microsoft Internet Explorer"){
if((document.documentElement.clientWidth-window.event.x)<_116){
mouseHorizontalPos="left";
}else{
mouseHorizontalPos="right";
}
return window.event.x;
}
}
}
function closePopup(_117){
document.getElementById(_117).innerHTML="&nbsp;";
document.getElementById(_117).style.display="none";
if(navigator.appName=="Microsoft Internet Explorer"&&document.getElementById("popupIframe")!=null){
if(document.getElementById("popupIframe").style.display=="block"){
document.getElementById("popupIframe").style.display="none";
}
}
}
function closeAllPopups(){
var _118=new Array("currently_not_availableArea","trustedArea","deliveryOptionsPopArea","enterZipArea","featuredItemArea","featuredProductArea","top5mpPopArea","smartBuyArea","featuredStoreArea","trustedCriteriaArea","whatIsArea","sponsoredListingsArea","trustedStoreArea","smartBuyCriteriaArea","FAQArea","memberLeadArea","memberAdvArea","memberTopRevArea","no_longer_availableArea","not_yet_availableArea","sbs_oopsArea","whyStoresListedArea","whatsHotPopArea","freeMerchantArea","payPalArea","buyItNowArea","cookiePolicyArea","storeInfoPopArea","largerImageArea","largeImage","popIn","buyingGuideArea");
var n=_118.length;
for(var i=0;i<n;i++){
if(document.getElementById(_118[i])!=null){
closePopup(_118[i]);
}
}
document.onmousedown=null;
}
function displayPopup(url,_11c,_11d,_11e,_11f,_120){
if(useSimplePop){
pops(url,400,400);
}else{
topPos=getPopupTopPos(_11e,_120);
leftPos=getPopupLeftPos(_11e,_11f);
callback=function(){
showPopup(_11d,topPos,leftPos,_11f,_120);
document.onmousedown=detectClick;
};
if(_11d!="trustedCriteriaArea"&&_11d!="trustedStoreArea"&&_11d!="smartBuyCriteriaArea"||navigator.appName=="Microsoft Internet Explorer"||navigator.vendor.toLowerCase().indexOf("apple")>=0){
closeAllPopups();
}
makeAJAHRequest("POST",url,_11c,document.getElementById(_11d),callback);
}
}
function showPopup(_121,_122,_123,_124,_125){
var _126=document.getElementById(_121).style;
var _127=document.getElementById(popArea).style;
var _128=document.getElementById(popArrowLeft).style;
var _129=document.getElementById(popArrowRt).style;
_126.display="block";
var _12a=getOffset(_121,_125);
_126.display="none";
if(navigator.appName=="Netscape"){
if(mouseVerticalPos=="bottom"&&_121!="FAQArea"&&_121!="whatsHotPopArea"){
if(_121=="largerImageArea"){
_127.top=(_122-_12a+brandPop2ndOffset+216)+"px";
}else{
_127.top=(_122-_12a+brandPop2ndOffset+10)+"px";
}
}else{
_127.top=(_122-brandPop2ndOffset)+"px";
}
if(_121=="trustedCriteriaArea"){
_127.zIndex=10;
}else{
if(_121=="trustedStoreArea"||_121=="smartBuyCriteriaArea"){
_127.zIndex=5;
}else{
_127.zIndex=3;
}
}
if(mouseHorizontalPos=="left"){
_127.left=(_123-_124+30)+"px";
_128.display="none";
if(mouseVerticalPos=="bottom"&&_121!="FAQArea"&&_121!="whatsHotPopArea"){
_129.top=(_12a-brandBtmArrow2ndOffset-15)+"px";
}else{
_129.top=brandTopArrow2ndOffset+"px";
}
}else{
_127.left=(_123+12)+"px";
_129.display="none";
if(mouseVerticalPos=="bottom"&&_121!="FAQArea"&&_121!="whatsHotPopArea"){
if(_121=="largerImageArea"){
_128.top=(_12a-brandBtmArrow2ndOffset-216)+"px";
}else{
_128.top=(_12a-brandBtmArrow2ndOffset-10)+"px";
}
}else{
_128.top=brandTopArrow2ndOffset+"px";
}
}
}else{
if(navigator.appName=="Microsoft Internet Explorer"){
var _12b=document.getElementById("popupIframe");
if(mouseVerticalPos=="bottom"&&_121!="FAQArea"&&_121!="whatsHotPopArea"){
if(_121=="largerImageArea"){
_127.top=((_122+document.documentElement.scrollTop-_12a+brandPop2ndOffset)+206)+"px";
}else{
_127.top=(_122+document.documentElement.scrollTop-_12a+brandPop2ndOffset)+"px";
}
if(_12b!=null){
_12b.style.top=(_122+document.documentElement.scrollTop-_12a-10)+"px";
}
}else{
_127.top=(_122+document.documentElement.scrollTop-brandPop2ndOffset)+"px";
if(_12b!=null){
_12b.style.top=(_122+document.documentElement.scrollTop-brandPop2ndOffset)+"px";
}
}
_127.zIndex=_127.zIndex+10;
if(mouseHorizontalPos=="left"){
_127.left=(_123-_124+12)+"px";
if(_12b!=null){
_12b.style.left=(_123-_124+12)+"px";
}
_128.display="none";
if(mouseVerticalPos=="bottom"&&_121!="FAQArea"&&_121!="whatsHotPopArea"){
_129.top=(_12a-brandBtmArrow2ndOffset-10)+"px";
}else{
_129.top=brandTopArrow2ndOffset+"px";
}
}else{
_127.left=(_123+12)+"px";
if(_12b!=null){
_12b.style.left=(_123+12)+"px";
}
_129.display="none";
if(mouseVerticalPos=="bottom"&&_121!="FAQArea"&&_121!="whatsHotPopArea"){
if(_121=="largerImageArea"){
_128.top=(_12a-brandBtmArrow2ndOffset-206)+"px";
}else{
_128.top=(_12a-brandBtmArrow2ndOffset)+"px";
}
}else{
_128.top=brandTopArrow2ndOffset+"px";
}
}
}
}
if(navigator.appName=="Microsoft Internet Explorer"||navigator.vendor.toLowerCase().indexOf("apple")>=0){
var _12b=document.getElementById("popupIframe");
if(_121=="trustedArea"||_121=="featuredStoreArea"||_121=="smartBuyArea"||_121=="whyStoresListedArea"){
lastTop=_127.top;
lastLeft=_127.left;
}else{
if(_121=="trustedCriteriaArea"||_121=="trustedStoreArea"||_121=="smartBuyCriteriaArea"){
_128.display="none";
_129.display="none";
_127.top=lastTop;
_127.left=lastLeft;
if(_12b!=null){
_12b.style.left=lastLeft;
_12b.style.top=lastTop;
}
}
}
}
_127.width=_124+"px";
_126.display="block";
setPopupIFrame(_124,_125);
}
function displayPopupVertical(url,_12d,_12e,_12f,_130,_131,_132,_133){
if(useSimplePop==true){
pops(url,400,400);
}else{
topPos=getPopupTopPos(_12f,_133);
leftPos=getPopupLeftPos(_12f,_130);
callback=function(){
if(document.paymentForm.paymentField.value=="short"){
h=_133;
}else{
if(document.paymentForm.paymentField.value=="mid"){
h=_132;
}else{
h=_131;
}
}
showPopupVertical(_12e,topPos,leftPos,_130,h);
setWindowTop(_12e,h);
document.onmousedown=detectClick;
};
if(_12e!="trustedCriteriaArea"&&_12e!="trustedStoreArea"&&_12e!="smartBuyCriteriaArea"||navigator.appName=="Microsoft Internet Explorer"||navigator.vendor.toLowerCase().indexOf("apple")>=0){
closeAllPopups();
}
makeAJAHRequest("POST",url,_12d,document.getElementById(_12e),callback);
}
}
function showPopupVertical(_134,_135,_136,_137,_138){
if(navigator.appName=="Netscape"){
document.getElementById(popArea).style.zIndex=3;
}else{
if(navigator.appName=="Microsoft Internet Explorer"){
document.getElementById(popArea).style.zIndex=document.getElementById(popArea).style.zIndex+10;
if(document.getElementById("popupIframe")!=null){
document.getElementById("popupIframe").style.left=(_136-(_137/2))+"px";
}
}
}
document.getElementById(popArea).style.left=(_136-(_137/2))+"px";
document.getElementById(popArrowRt).style.display="none";
document.getElementById(popArrowLeft).style.display="none";
document.getElementById(popArea).style.width=_137+"px";
document.getElementById(_134).style.display="block";
setPopupIFrame(_137,_138);
}
function setWindowTop(_139,_13a){
if(navigator.appName=="Netscape"){
if(mouseVerticalPos=="bottom"){
document.getElementById(popArea).style.top=(topPos-_13a-30)+"px";
}else{
document.getElementById(popArea).style.top=(topPos+5)+"px";
}
}else{
if(navigator.appName=="Microsoft Internet Explorer"){
if(mouseVerticalPos=="bottom"){
document.getElementById(popArea).style.top=(topPos+document.documentElement.scrollTop-_13a-40)+"px";
if(document.getElementById("popupIframe")!=null){
document.getElementById("popupIframe").style.top=(topPos+document.documentElement.scrollTop-_13a-40)+"px";
}
}else{
document.getElementById(popArea).style.top=(topPos+document.documentElement.scrollTop+10)+"px";
if(document.getElementById("popupIframe")!=null){
document.getElementById("popupIframe").style.top=(topPos+document.documentElement.scrollTop+10)+"px";
}
}
}
}
if(mouseVerticalPos=="bottom"){
if(_139=="storeInfoPopArea"||_139=="deliveryOptionsPopArea"){
document.getElementById(popArrowTop).style.display="none";
}
}else{
if(_139=="storeInfoPopArea"||_139=="deliveryOptionsPopArea"){
document.getElementById(popArrowBtm).style.display="none";
}
}
}
function setPopupIFrame(_13b,_13c){
if(navigator.appName=="Microsoft Internet Explorer"&&document.getElementById("popupIframe")!=null){
document.getElementById("popupIframe").style.display="block";
document.getElementById("popupIframe").style.filter="progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)";
document.getElementById("popupIframe").style.zIndex=5;
document.getElementById("popupIframe").style.width=_13b+"px";
document.getElementById("popupIframe").style.height=(_13c*1)+"px";
}
}
function getOffset(_13d,_13e){
if(_13d!="whatIsArea"){
return _13e;
}else{
if(navigator.appName=="Netscape"){
return document.getElementById(popContent).offsetHeight;
}else{
var h;
}
if(navigator.appName=="Microsoft Internet Explorer"){
if(document.getElementById(popContent).offsetHeight<450){
h=document.getElementById(popContent).offsetHeight+200;
}else{
h=document.getElementById(popContent).offsetHeight;
}
h=(h-160)*0.23;
if(h>280){
h=280;
}
return h;
}
}
}
function clearTileBg(){
for(var _140=0;_140<90;_140++){
if(document.getElementById("productDealCell"+_140)){
document.getElementById("productDealCell"+_140).className="productDealCell productsTileBg";
}
}
}
var DM_CSID="A06544";
var DM_UIDS=3;
var DM_CHN=document.location.hostname;
var DM_PIX="pix01.revsci.net";
var DM_BPIX="pix01.revsci.net";
var DM_UIDD=document.location.hostname;
var DM_UIDP="/";
var DM_UIDC="";
var DM_UIDN="";
var DM_UIDE=0;
var DM_ADMG=1;
var DM_ANLY=1;
var DM_RTRY=0;
var DM_DREF=0;
var DM_LOAD_TIME=0;
var DM_TOUT_PIX_PATH="";
var DM_CSES=0;
var DM_CTST=0;
var DM_MULT=0;
var DM_FRAG=0;
var DM_RCRC=0;
var DM_BOOM_ON=0;
var DM_BOOM_DMN="";
var DM_BOOM_SRC="";
var DM_BOOM_DCN="";
var DM_TEST=0;
var DM_REQS=0;
var _DM_DTE=new Date();
var _DM_UNV=navigator;
var _DM_UDC=document;
var _DM_CHR=null;
var _DM_sImg=new Array();
var _DM_evts=new Array();
var _DM_hexc=new Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F");
var _DM_BCL1="?&=%.()";
var _DM_GCL2="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
var _DM_TGID="a"+_DM_hexc[(DM_TEST<<3|DM_REQS<<2|DM_ADMG<<1|DM_ANLY)];
var _DM_name=_DM_UDC.title;
for(_DM_CHR="",i=0;i<256;i++){
_DM_CHR+=String.fromCharCode(i);
}
var _DM_CRCTbl=new Array(0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918000,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117);
var _DM_UID=0;
var _DM_UTZ=(-1*_DM_DTE.getTimezoneOffset())+720;
var _DM_UCS=((DM_CTST)?(_DM_gc(_DM_sc("TC0",1,DM_CHN,"/",0,0))==1?1:0)+(_DM_gc(_DM_sc("TC1",1,DM_CHN,"/",1,0))==1?2:0):0);
var _DM_USID=((DM_CSES)?_DM_sessID():0);
var _DM_CNV="";
var _DM_LOC=_DM_UDC.location.toString();
var _DM_REF=_DM_UDC.referrer.toString();
var _DM_CLD=0;
function DM_tag(){
if(_DM_CLD==0||DM_MULT==1){
_DM_CLD=1;
switch(DM_UIDS){
case 1:
case 2:
case 5:
var cke=_DM_gc(DM_UIDC);
if(cke==null){
_DM_UID=-1;
}else{
if(cke.indexOf("/")>=0||cke.indexOf("?")>=0){
_DM_UID=-1;
}else{
_DM_UID="DMID"+DM_UIDS+"="+escape(cke);
}
}
break;
case 4:
if((_DM_UID=_DM_gc(DM_UIDN))==null){
_DM_UID=_DM_genID();
_DM_sc(DM_UIDN,_DM_UID,DM_UIDD,DM_UIDP,DM_UIDE,0);
}
_DM_UID="DMID4="+_DM_UID;
break;
}
for(var i=0;i<_DM_evts.length;i++){
_DM_addNV("DM_EVT."+_DM_evts[i].name,_DM_evts[i].props);
}
if(DM_DREF==1){
_DM_addNV("DM_LOC",_DM_encd(_DM_REF,_DM_BCL1,0));
}else{
_DM_addNV("DM_LOC",_DM_encd(_DM_LOC,_DM_BCL1,0));
}
_DM_addNV("DM_REF",_DM_encd(_DM_REF,_DM_BCL1,0));
(_DM_UID!=0&&_DM_UID!=-1?_DM_addNV("DM_HID",_DM_encd(_DM_UID,_DM_BCL1,0)):0);
_DM_addNV("DM_TIT",_DM_encd(_DM_UDC.title.toString(),_DM_BCL1,0));
_DM_CNV+="&DM_EOM=1";
if(_DM_pack(_DM_CNV)){
if(DM_BOOM_ON){
_DM_checkBoom();
}
}
_DM_rstReq();
}
}
function _DM_pack(d){
var rdte=new Date();
var rid=_DM_toHex(Math.floor(rdte));
var bse="",hdr="",dat="",seq=1;
var prt=location.protocol+"//";
var msl=(DM_PIX.length>DM_BPIX.length?DM_PIX.length:DM_BPIX.length);
var mrl=2000,usd=0;
d=_DM_encd(d,_DM_GCL2,1);
for(var shpd=0,f=1;((DM_FRAG)?(shpd<d.length):(f==1));shpd+=dat.length,f++){
hdr="/"+DM_CSID+"/"+_DM_TGID+"/"+_DM_UCS+"/"+DM_UIDS+"/"+_DM_UTZ+"/"+seq+"/"+_DM_USID+"/"+rid+"/"+_DM_UID+"/";
bse="/"+Math.floor(Math.random()*Math.pow(10,9))+".gif?D=";
lst=(shpd+(mrl-msl-(prt+hdr+bse).length-10)>d.length?1:0);
if(!DM_FRAG){
sts=0;
}else{
if(f==1&&lst==0){
sts=1;
}else{
if(f>1&&lst==0){
sts=2;
}else{
if(f>1&&lst==1){
sts=3;
}else{
sts=0;
}
}
}
}
hdr+=sts+"/";
usd=(prt+hdr+bse).length+msl+8;
dat=d.substr(shpd,(mrl-usd-(d.charAt(shpd+(mrl-usd-1))=="%"?1:(d.charAt(shpd+(mrl-usd-2))=="%"?2:0))));
hdr+=_DM_pad(((DM_RCRC)?_DM_toHex(_DM_crc32(dat)):0),8);
_DM_ship(_DM_toHex(Math.floor(Math.random()*Math.pow(10,9))),prt,DM_PIX,DM_BPIX,hdr+bse+dat,0);
seq++;
}
return 1;
}
function _DM_ship(srl,p,s1,s2,u,t){
if(_DM_sImg[srl]==null){
_DM_sImg[srl]=new Image(2,3);
}
if(t<2){
_DM_sImg[srl].src=p+s1+u;
}else{
if(t<4){
_DM_sImg[srl].src=p+s2+u;
}
}
if(DM_LOAD_TIME>0){
setTimeout("isPixLoaded(_DM_sImg['"+srl+"']);",parseInt(DM_LOAD_TIME)*1000);
}
if(DM_RTRY==1&&DM_LOAD_TIME==0){
_DM_sImg[srl].onerror=function(){
setTimeout("_DM_ship('"+srl+"','"+p+"','"+s1+"','"+s2+"','"+u+"',"+(t+1)+")",5000);
};
}
}
function isPixLoaded(pix){
var _157=new Image();
if(pix.complete){
return pix;
}else{
return pix.src=DM_TOUT_PIX_PATH;
}
}
function _DM_addNV(n,v){
_DM_CNV+=(_DM_CNV?"&":"")+n+"="+v;
}
function _DM_genID(){
return _DM_toHex(Math.floor(_DM_DTE))+"-"+_DM_toHex(Math.floor(Math.random()*Math.pow(10,16)))+"-"+_DM_toHex(_DM_crc32("".concat(_DM_UDC.referrer,_DM_UDC.cookie,_DM_UNV.userAgent,_DM_UTZ,screen.width,screen.height)));
}
function _DM_sessID(){
var sID=_DM_gc("DMSID");
if(sID==null){
sID=_DM_gc(_DM_sc("DMSID",_DM_genID(),DM_UIDD,DM_UIDP,0,0));
}
return (sID);
}
function _DM_sc(n,v,d,p,e,o){
var _161=new Date();
if((n!=""&&v!="")&&(_DM_gc(n)==null||o==1)){
_161.setDate(_DM_DTE.getDate()+e);
_DM_UDC.cookie=n+"="+v+(p!=""?";path="+p:"")+(d!=""?";domain="+d:"")+(e>0?";expires="+_161.toGMTString():"");
}
return n;
}
function _DM_gc(n){
var co=_DM_UDC.cookie;
var pos=co.indexOf(n+"=");
return pos!=-1?co.substring(pos+n.length+1,(co.indexOf("; ",pos)!=-1?co.indexOf("; ",pos):co.length)):null;
}
function _DM_encd(s,chrs,b){
for(var i=0,ns="",c="";i<s.length;i++){
if((b==1?chrs.indexOf(s.charAt(i))>=0:chrs.indexOf(s.charAt(i))<0)){
ns+=s.charAt(i);
}else{
if((c=_DM_CHR.indexOf(s.charAt(i)))>0){
ns+="%"+_DM_pad(_DM_toHex(c),2);
}
}
}
return ns;
}
function _DM_crc32(buf){
i=0;
cnt=buf.length;
crc=4294967295;
while(cnt--!=0){
crc=_DM_CRCTbl[(crc^_DM_CHR.indexOf(buf.charAt(i++)))&255]^(crc>>>8);
}
crc^=4294967295;
crc=(crc&2147483647)+((crc<0)?2147483648:0);
return crc;
}
function _DM_appendToUrl(u,n,v){
return u+((u.indexOf("?")==-1)?"?":"&")+n+"="+v;
}
function _DM_toHex(n){
var rmd=0,quo=0,hex="";
if(n<16){
return _DM_hexc[n];
}else{
rmd=(n%16);
quo=Math.floor((n-rmd)/16);
return (_DM_toHex(quo)+_DM_toHex(rmd));
}
}
function _DM_pad(d,p){
d+="";
while(d.length<p){
d="0"+d;
}
return d;
}
function _DM_checkBoom(){
var segC="",bomc="",scrc=0,bcrc=0;
if((segC=_DM_gc("DMSEG"))!=null){
if((bomc=_DM_gc("DMBOM"))!=null){
scrc=_DM_pad(_DM_toHex(_DM_crc32(segC)),8);
bcrc=bomc.substr(0,bomc.indexOf("&"));
if(scrc!=bcrc){
_DM_sendBoom(segC,scrc,DM_BOOM_DMN,DM_BOOM_SRC,DM_BOOM_DCN);
}
}else{
_DM_sendBoom(segC,_DM_pad(_DM_toHex(_DM_crc32(segC)),8),DM_BOOM_DMN,DM_BOOM_SRC,DM_BOOM_DCN);
}
}
}
function _DM_sendBoom(segC,crc,dmn,src,dcn){
var aTok,segs,rid=0,i=0,bl="",u="";
segC=unescape(segC);
aTok=segC.split("&");
if(aTok.length>=6){
if(aTok[5].length>0){
segs=aTok[5].split(",");
while(i<segs.length){
bl+="boom="+segs[i]+";";
i++;
}
rid=Math.floor(Math.random()*Math.pow(10,9));
u="/src="+src+";dcnet="+dcn+";"+bl+"sz=1x1;ord="+rid+"?";
_DM_ship(rid,location.protocol+"//",dmn,dmn,u,0);
_DM_setBoom(crc,1);
}else{
_DM_setBoom(crc,0);
}
}else{
_DM_setBoom(crc,0);
}
}
function _DM_setBoom(crc,snt){
_DM_sc("DMBOM",crc+"&"+_DM_toHex(Math.floor(_DM_DTE))+"&"+snt,DM_CHN,"/",0,1);
}
function _DM_rstReq(){
_DM_CNV="";
_DM_LOC=_DM_UDC.location.toString();
_DM_REF=_DM_UDC.referrer.toString();
_DM_UID=0;
}
function DM_event(e,n,v){
for(var i=0;i<_DM_evts.length;i++){
if(_DM_evts[i].name==e){
if(_DM_evts[i].props.indexOf("("+_DM_encd(n,_DM_BCL1,0)+".")<0){
_DM_evts[i].props+="("+_DM_encd(n,_DM_BCL1,0)+"."+_DM_encd(v,_DM_BCL1,0)+")";
return 1;
}else{
return 0;
}
}
}
_DM_evts[_DM_evts.length]={name:_DM_encd(e,_DM_BCL1,0),props:"("+_DM_encd(n,_DM_BCL1,0)+"."+_DM_encd(v,_DM_BCL1,0)+")"};
return 1;
}
function DM_cat(cat){
_DM_addNV("DM_CAT",_DM_encd(cat,_DM_BCL1,0));
}
function DM_name(f){
_DM_addNV("DM_NAM",_DM_encd(f,_DM_BCL1,0));
}
function DM_keywords(k){
_DM_addNV("DM_KYW",_DM_encd(k,_DM_BCL1,0));
}
function DM_segments(s){
_DM_addNV("DM_SEG",_DM_encd(s,_DM_BCL1,0));
}
function DM_addToLoc(n,v){
_DM_LOC=_DM_appendToUrl(_DM_LOC,n,v);
if(DM_DREF==1){
_DM_REF=_DM_appendToUrl(_DM_REF,n,v);
}
}
var informativeSurveyShow=false;
function showInformativeSurvey(){
dojo.lfx.html.wipeIn("popIn",800,null,null).play();
document.getElementById("searchTxtField").blur();
informativeSurveyShow=true;
}
function hideInformativeSurvey(){
informativeSurveyShow=false;
off("popIn");
}
var searchAssistantTrayOpen=false;
var recentSearchTrayOpen=false;
var clickedInsideSSD=false;
var clickedInsideSurvey=false;
var clickedInsidePPIPop=false;
var lastKeywordTyped=null;
var curHighlightPosY=-1,curHighlightPosX=0;
var maxHighlightPosY=0,maxHighlightPosX=0;
var keyPressFlag=2;
function updateHighlight(){
for(var i=0;i<=maxHighlightPosY;i++){
for(var j=0;j<=maxHighlightPosX;j++){
if(dojo.byId("saiTxt"+i+","+j)!=null){
dojo.byId("saiTxt"+i+","+j).className="saiTxt";
}
}
}
if(curHighlightPosY!=-1){
dojo.byId("saiTxt"+curHighlightPosY+","+curHighlightPosX).className="saiTxtHover";
}
}
function searchSuggestionsKeyDown(_192){
var _193=_192;
if(!_193){
_193=window.event;
}
if(_193&&!saHidden){
switch(_193.keyCode){
case 37:
if(curHighlightPosY!=-1){
if(curHighlightPosX==0){
curHighlightPosX=1;
}else{
curHighlightPosX=0;
}
if(dojo.byId("saiTxt"+curHighlightPosY+","+curHighlightPosX)==null){
curHighlightPosY--;
}
updateHighlight();
return false;
}
break;
case 38:
if(searchAssistantTrayOpen||recentSearchTrayOpen){
if(curHighlightPosY!=-1&&((keyPressFlag%2==0&&dojo.render.html["safari"])||!dojo.render.html["safari"])){
if(curHighlightPosY==0){
if(curHighlightPosX==1){
curHighlightPosY=maxHighlightPosY;
curHighlightPosX=0;
}else{
curHighlightPosY=-1;
}
}else{
curHighlightPosY--;
}
updateHighlight();
}
keyPressFlag++;
}
break;
case 39:
if(curHighlightPosY!=-1){
if(curHighlightPosX==1){
curHighlightPosX=0;
}else{
curHighlightPosX=1;
}
if(dojo.byId("saiTxt"+curHighlightPosY+","+curHighlightPosX)==null){
curHighlightPosY--;
}
updateHighlight();
return false;
}
break;
case 40:
if(!searchAssistantTrayOpen&&!recentSearchTrayOpen){
document.getElementById("searchTxtField").blur();
}else{
if((keyPressFlag%2==0&&dojo.render.html["safari"])||!dojo.render.html["safari"]){
if(curHighlightPosY!=-1){
if(curHighlightPosY==maxHighlightPosY){
if(curHighlightPosX==1){
curHighlightPosY=-1;
curHighlightPosX=0;
}else{
if(maxHighlightPosX==1){
curHighlightPosY=0;
curHighlightPosX=1;
}else{
curHighlightPosY=-1;
}
}
}else{
curHighlightPosY++;
}
if(dojo.byId("saiTxt"+curHighlightPosY+","+curHighlightPosX)==null){
curHighlightPosY=-1;
curHighlightPosX=0;
}
}else{
curHighlightPosY=0;
}
updateHighlight();
}
keyPressFlag++;
}
break;
case 13:
if(curHighlightPosY!=-1){
document.location.href=dojo.byId("saiTxtLink"+curHighlightPosY+","+curHighlightPosX).href;
return false;
}
break;
case 33:
case 34:
if(!searchAssistantTrayOpen&&!recentSearchTrayOpen){
document.getElementById("searchTxtField").blur();
}
default:
}
}
return true;
}
function searchSuggestionsKeyPress(_194){
var _195=_194;
if(!_195){
_195=window.event;
}
if(_195&&!saHidden){
switch(_195.keyCode){
case 37:
if(curHighlightPosY!=-1){
return false;
}
break;
case 38:
break;
case 39:
if(curHighlightPosY!=-1){
return false;
}
break;
case 40:
break;
case 13:
if(curHighlightPosY!=-1){
return false;
}
break;
default:
}
}
return true;
}
function showSearchSuggestions(_196,_197,_198,_199,_19a,_19b){
var _19c="/ajaxSearchAssistant";
var _19d=saiTxtSearchSuggest;
if(_19b=="recentSearches"){
_19c="/ajaxRecentSearches";
_19d=saiTxtYourRecent;
}
var _19e=_196;
if(!_19e){
_19e=window.event;
}
var _19f=false;
if((_19e&&!saHidden)||(_19e&&_19b=="recentSearches")){
switch(_19e.keyCode){
case 37:
break;
case 38:
break;
case 39:
break;
case 40:
break;
case 13:
break;
default:
lastKeywordTyped=_19a;
_19f=true;
}
}else{
lastKeywordTyped=_19a;
_19f=true;
}
if(_19f&&(_19b=="recentSearches"||(_19a!=null&&_19a.length>0))){
dojo.io.bind({url:_19c,content:{q:_19a},load:function(type,data,evt){
if(lastKeywordTyped!=_19a){
return;
}
curHighlightPosY=-1;
curHighlightPosX=0;
maxHighlightPosY=0;
maxHighlightPosX=0;
response=dojo.dom.createDocumentFromText(data);
suggestNodes=response.getElementsByTagName("S");
if(suggestNodes.length==0&&_19b!="recentSearches"){
if(searchAssistantTrayOpen){
dojo.lfx.html.fadeHide(_199,100,null,function(){
hideSaiIframe(_198);
hideSaiDiv(_197);
}).play();
searchAssistantTrayOpen=false;
}
}else{
if(saHidden&&_19b!="recentSearches"){
dojo.byId(_199).innerHTML="<div class=\"saiCell smallTxt\"><a class=\"gArrowDown\" href=\"javascript:void(0);\" onClick=\"openSai();showSearchSuggestions(event,'"+_197+"','"+_198+"','"+_199+"','"+_19a+"','"+_19b+"');\">"+saiTxtShowSuggest+"</a></div>";
}else{
var _1a3="<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" summary=\"\"><tr><td valign=\"top\" class=\"saiCell pB0\"><div class=\"saiContain\"><span class=\"saiTtl\">";
_1a3+=_19d+"</span></div></td><td align=\"right\" class=\"pT5 pR5 pB0\"><div class=\"saiContain\">";
_1a3+="<a href=\"#\" onclick=\"closeSai('"+_197+"','"+_198+"','"+_199+"','"+_19a+"','"+_19b+"');return false;\" class=\"gArrowUp\">"+saiTxtHd+"</a>";
_1a3+="</div></td></tr>";
if(suggestNodes.length==0&&_19b=="recentSearches"){
_1a3+="</table><div class=\"noRS\">"+saiHaveNo+"</div>";
}else{
_1a3+="<tr><td valign=\"top\" class=\"saiCell\"><div class=\"saiContain\">";
var posX=0;
var posY=0;
var n=suggestNodes.length;
for(var i=0;i<n;i++){
var _1a8=decodeURIComponent(suggestNodes[i].firstChild.data);
var _1a9=escape(_1a8.replace(/\s/g,"+"))+"&CLT="+(_19b=="recentSearches"?"RSH":"SAS");
if(_1a8.length>50){
var _1aa=_1a8.substring(0,49);
while(_1aa.match(/[\w]$/)){
_1aa=_1aa.replace(/[\w]$/,"");
}
_1aa=_1aa.replace(/[\s]$/,"")+"...";
}else{
var _1aa=_1a8;
}
if(suggestNodes.length>1&&(i==(suggestNodes.length/2)||i==((suggestNodes.length+1)/2))){
_1a3+="</div></td><td valign=\"top\" class=\"saiCell\"><div class=\"saiContain\">";
maxHighlightPosY=i-1;
maxHighlightPosX=1;
posX=1;
posY=0;
}
_1a3+="<div id=\"saiTxt"+posY+","+posX+"\" class=\"saiTxt\" onMouseOver=\"curHighlightPosY="+posY+";curHighlightPosX="+posX+";updateHighlight();\"><a id=\"saiTxtLink"+posY+","+posX+"\" href=\"/xFS?KW="+_1a9+"\">"+_1aa+"</a></div>";
posY++;
}
if(maxHighlightPosX==0){
maxHighlightPosY=suggestNodes.length-1;
}
if(suggestNodes.length==1){
_1a3+="</div></td><td class=\"saiCell\"><div class=\"saiContain\">&nbsp;";
}
_1a3+="</div></td></tr></table>";
if(_19b=="recentSearches"){
_1a3+="<div class=\"clearRS\"><a href=\"#\" class=\"linkClr2\" ";
_1a3+="onclick=\"clearRS('"+_197+"','"+_198+"');return false;\">"+saiClearRecent+"</a></div>";
}
}
dojo.byId(_199).innerHTML=_1a3;
}
showSaiIframe(_198);
showSaiDiv(_197);
dojo.html.show(_199);
dojo.html.setOpacity(_199,1);
}
},useCache:false,mimetype:"text/plain"});
}
if(_19b=="recentSearches"){
rsImgOn("rsImg");
rsImgOn("rsImgFoot");
searchAssistantTrayOpen=false;
recentSearchTrayOpen=true;
var _1ab=_197=="saiArea"?"frmGSRequest":"frmGSRequestFoot";
document.forms[_1ab].KW.focus();
}else{
if(dojo.byId("rsImg")!=null){
rsImgOff("rsImg");
}
if(dojo.byId("rsImgFoot")!=null){
rsImgOff("rsImgFoot");
}
searchAssistantTrayOpen=true;
recentSearchTrayOpen=false;
}
}
function hideSaiDiv(_1ac){
document.getElementById(_1ac).style.visibility="hidden";
}
function showSaiDiv(_1ad){
document.getElementById(_1ad).style.visibility="visible";
}
function showSaiIframe(_1ae){
if(navigator.appName=="Microsoft Internet Explorer"){
document.getElementById(_1ae).style.filter="progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)";
document.getElementById(_1ae).style.display="block";
}
}
function rsImgOff(_1af){
if(dojo.byId(_1af)!=null){
dojo.byId(_1af).src="/images/recentSearchDown.gif";
}
}
function rsImgOn(_1b0){
if(dojo.byId(_1b0)!=null){
dojo.byId(_1b0).src="/images/recentSearchUp.gif";
}
}
function swapTheImg(_1b1,_1b2){
if(dojo.byId(_1b1)!=null){
dojo.byId(_1b1).src=_1b2;
}
}
function hideSaiIframe(_1b3){
if(navigator.appName=="Microsoft Internet Explorer"){
document.getElementById(_1b3).style.display="none";
}
}
function closeSai(_1b4,_1b5,_1b6,_1b7,_1b8){
hideSaiDiv(_1b4);
hideSaiIframe(_1b5);
if(_1b8=="recentSearches"){
if(_1b4=="saiArea"){
rsImgOff("rsImg");
}else{
rsImgOff("rsImgFoot");
}
recentSearchTrayOpen=false;
}else{
saHidden=true;
dojo.byId(_1b6).innerHTML="<div class=\"saiCell smallTxt\"><a class=\"gArrowDown\" href=\"javascript:void(0);\" onClick=\"openSai();showSearchSuggestions(event,'"+_1b4+"','"+_1b5+"','"+_1b6+"','"+_1b7+"','"+_1b8+"');\">"+saiTxtShowSuggest+"</a></div>";
dojo.io.bind({url:"/ajaxWC",content:{c:"SAF",v:"1"},load:function(type,data,evt){
},mimetype:"text/plain"});
}
}
function openSai(){
saHidden=false;
dojo.io.bind({url:"/ajaxWC",content:{c:"SAF",v:"0"},load:function(type,data,evt){
},mimetype:"text/plain"});
}
function bodyOnClick(){
if(!clickedInsideSSD){
closeSSD();
}else{
clickedInsideSSD=false;
}
if(!clickedInsideSurvey){
hideInformativeSurvey();
}else{
clickedInsideSurvey=false;
}
}
function bodyClckPops(){
if(!clickedInsidePPIPop){
if(document.getElementById("popPos")!=null){
document.getElementById("popPos").style.display="none";
}
clearTileBg();
}else{
clickedInsidePPIPop=false;
}
}
function clickInPPI(){
clickedInsidePPIPop=true;
}
function closeSSD(){
if(searchAssistantTrayOpen||recentSearchTrayOpen){
if(dojo.byId("saiArea")!=null){
hideSaiDiv("saiArea");
}
if(dojo.byId("saiIframe")!=null){
hideSaiIframe("saiIframe");
}
if(dojo.byId("saiAreaFoot")!=null){
hideSaiDiv("saiAreaFoot");
}
if(dojo.byId("saiIframeFoot")!=null){
hideSaiIframe("saiIframeFoot");
}
if(dojo.byId("rsImg")!=null){
rsImgOff("rsImg");
}
if(dojo.byId("rsImgFoot")!=null){
rsImgOff("rsImgFoot");
}
searchAssistantTrayOpen=false;
recentSearchTrayOpen=false;
}
}
function clickInsideSSD(){
clickedInsideSSD=true;
}
function clickInsideSurvey(){
clickedInsideSurvey=true;
}
function getY(_1bf){
var _1c0=0;
while(_1bf!=null){
_1c0+=_1bf.offsetTop;
_1bf=_1bf.offsetParent;
}
return _1c0;
}
function getX(_1c1){
var _1c2=0;
while(_1c1!=null){
_1c2+=_1c1.offsetLeft;
_1c1=_1c1.offsetParent;
}
return _1c2;
}
function preLoadRS(){
var _1c3=new Image();
_1c3.src="/images/recentSearchDown.gif";
_1c3.src="/images/recentSearchUp.gif";
}
function clearRS(_1c4,_1c5){
hideSaiDiv(_1c4);
hideSaiIframe(_1c5);
recentSearchTrayOpen=false;
if(_1c4=="saiArea"){
rsImgOff("rsImg");
}else{
rsImgOff("rsImgFoot");
}
dojo.io.bind({url:"/ajaxWC?cc=RS",content:{c:"SAF",v:"1"},load:function(type,data,evt){
},mimetype:"text/plain"});
}
function googleAdClick(_1c9,_1ca){
var s=s_gi(_1ca);
s.linkTrackVars="eVar10,events,prop20";
s.linkTrackEvents="event6";
s.eVar10="GoogleAd:"+_1c9;
s.events="event6";
s.prop20="GoogleAd:"+_1c9;
s.tl(this,"o","GoogleAD");
}
function narrowByClick(_1cc,_1cd,_1ce){
var s=s_gi(_1ce);
s.linkTrackVars="prop5";
s.prop5="NarrowByPosition:"+_1cc+","+_1cd;
s.tl(this,"o","NarrowByPosition");
}
function soi(arg){
}
function scrollElementIntoView(_1d1,_1d2){
if(navigator.appName=="Microsoft Internet Explorer"){
if(document.getElementById(_1d1)){
document.getElementById(_1d1).scrollIntoView(_1d2);
}
}
}
function focusSort(){
}
var ourInterval;
var scrollSpeed=30;
var scrollDistance=5;
function scrollStart(_1d3,_1d4){
ourInterval=setInterval("scroll"+_1d3+"('"+_1d4+"')",scrollSpeed);
}
function scrollEnd(_1d5){
clearInterval(ourInterval);
}
function scrollUp(_1d6){
document.getElementById(_1d6).scrollTop=document.getElementById(_1d6).scrollTop-scrollDistance;
}
function scrollDown(_1d7){
document.getElementById(_1d7).scrollTop=document.getElementById(_1d7).scrollTop+scrollDistance;
}
function scrollLeft(_1d8){
document.getElementById(_1d8).scrollLeft=document.getElementById(_1d8).scrollLeft-scrollDistance;
}
function scrollRight(_1d9){
document.getElementById(_1d9).scrollLeft=document.getElementById(_1d9).scrollLeft+scrollDistance;
}
var prevElementID="elementID0";
function showHide(_1da){
swap(_1da,prevElementID);
prevElementID=_1da;
}
function toggleRelatedSearchWords(_1db,_1dc,_1dd){
document.getElementById(_1db+"showMoreWordsItem").style.display=_1dd?"none":(_1dc?"inline":"block");
document.getElementById(_1db+"moreTopWords").style.display=_1dd?(_1dc?"inline":"block"):"none";
return false;
}
function scrollStorefrontsLeft(_1de){
scrollLeft(_1de);
toggleStorefrontArrowStatus("left");
}
function toggleStorefrontArrowStatus(_1df){
var _1e0="vMid p1 disabled";
var _1e1="vMid p1";
var _1e2=document.getElementById("storefrontContentFull")!=null;
var _1e3;
var _1e4;
var _1e5;
if(_1e2){
_1e3=document.getElementById("storefrontContentFull");
_1e4=document.getElementById("arrowImgLeftFull");
_1e5=document.getElementById("arrowImgRightFull");
}else{
_1e3=document.getElementById("storefrontContent");
_1e4=document.getElementById("arrowImgLeft");
_1e5=document.getElementById("arrowImgRight");
}
var _1e6=document.getElementById("storefrontGallery");
var _1e7=_1e3.scrollLeft==0;
var _1e8=false;
var _1e9=_1e6.offsetWidth-_1e3.offsetWidth;
if(!_1e7&&_1e9+1>=_1e3.scrollLeft&&_1e9-1<=_1e3.scrollLeft){
_1e8=true;
}
_1e4.className=_1e7?_1e0:_1e1;
_1e5.className=_1e8?_1e0:_1e1;
}
function scrollStorefrontsRight(_1ea){
scrollRight(_1ea);
toggleStorefrontArrowStatus("right");
}
function validateZip(s){
if(s==""){
return true;
}
zip1=new RegExp(/(^\d{5}$)|(^\d{5}-\d{4}$)/);
if(!zip1.test(s)||s=="00000"){
zipAlert(s);
return false;
}
return true;
}
function zipAlert(s){
alert(s+" is not a valid zip code.");
}
function showTab(tab){
hideAllTabs();
document.getElementById(tab+"Body").style.display="block";
switch(tab){
case "deals":
document.getElementById("dealsTab").className="f1TabOn";
document.getElementById("specsTab").className="fMid1TabOff";
document.getElementById("reviewsTab").className="fLast2TabOff";
document.getElementById("reviewCount").className="";
toggleDealSpotlight(false);
break;
case "specs":
document.getElementById("dealsTab").className="f1TabOff";
document.getElementById("specsTab").className="fMidTabOn";
document.getElementById("reviewsTab").className="fLast1TabOff";
document.getElementById("reviewCount").className="";
toggleDealSpotlight(true);
break;
case "reviews":
document.getElementById("dealsTab").className="f1TabOff";
document.getElementById("specsTab").className="fMid2TabOff";
document.getElementById("reviewsTab").className="fLastTabOn";
document.getElementById("reviewCount").className="hideLink";
toggleDealSpotlight(true);
break;
default:
}
}
function hideAllTabs(){
var tabs=new Array("dealsBody","specsBody","reviewsBody");
for(var i=0;i<tabs.length;i++){
document.getElementById(tabs[i]).style.display="none";
}
}
var menuItemHeightDtr=24;
var delayDtr=250;
var delayStartDtr=250;
var startTimerDtr;
var startDtr;
var hideFlagDtr;
var hideTimerDtr;
var curMenuDtr;
var activeMenuDtr;
var activeMenuItemDtr;
var activeMenuLitDtr;
var activeMenuItemLitDtr;
var onMenuDtr=false;
var menuToggler=false;
var onMenuNumber=-1;
var insideMenuClick=false;
function clearHideTimerDtr(){
if(hideTimerDtr){
clearTimeout(hideTimerDtr);
}
hideTimerDtr=null;
hideFlagDtr=false;
}
function hideMenusDealtime(){
if(!hideFlagDtr){
return;
}
var _1f0=new Date()-startDtr;
if(_1f0<delayDtr){
hideTimerDtr=setTimeout("hideMenusDealtime()",delayDtr-_1f0);
return;
}
hideFlagDtr=false;
hideMainMenuDealtime();
hideAllMenusDealtime();
}
function hideMainMenuDealtime(){
var _1f1=getObj(activeMenuDtr);
if(_1f1){
_1f1.style.visibility="hidden";
}
activeMenuDtr=null;
}
function hideAllMenusDealtime(){
var _1f2=getObj(activeMenuItemDtr);
if(_1f2){
_1f2.style.visibility="hidden";
}
onMenuDtr=false;
}
function moveMenuDealtime(num){
var menu=getObj("menu"+num);
var tab=getObj("tab"+num);
if(menu){
menu.style.left=(findPosX(tab)-18)+"px";
menu.style.top=((findPosY(tab)-1)+menuItemHeightDtr)+"px";
}
}
function showMenusDealtime(){
onMenuDtr=true;
closeSSD();
activeMenuDtr="menu"+curMenuDtr;
var _1f6=getObj(activeMenuDtr);
if(_1f6){
_1f6.style.visibility="visible";
}
}
function menuDelayStart(menu){
var _1f8="menuOnClick("+menu+")";
if(onMenuDtr){
menuOnClick(menu);
}else{
startTimerDtr=setTimeout(_1f8,delayStartDtr);
}
}
function menuOnClick(menu){
var _1fa=(menu==onMenuNumber);
if(_1fa){
startShowDealtime(menu);
highLightTopMenu(menu);
onMenuNumber=menu;
}else{
hideMainMenuDealtime();
hideAllMenusDealtime();
removeHighLightTopMenu(onMenuNumber);
if(menu!=-2){
startShowDealtime(menu);
highLightTopMenu(menu);
onMenuNumber=menu;
}
}
}
function startShowDealtime(menu){
moveMenuDealtime(menu);
curMenuDtr=menu;
clearHideTimerDtr();
showMenusDealtime();
}
function moveMenuDealtimeItem(num,item){
var menu=getObj("menu"+num+"item"+item);
var tab=getObj("tab"+num+"menu"+item);
var _200=getObj("ifr"+num);
menu.style.left=(findPosX(tab)+201)+"px";
menu.style.top=(findPosY(tab)-1)+"px";
}
function showMenusDealtimeItem(menu,item){
hideAllMenusDealtime();
showMenusDealtime();
var _203="menu"+menu+"item"+item;
activeMenuItemDtr=_203;
getObj(_203).style.visibility="visible";
}
function startShowDealtimeItem(menu,item){
startShowDealtime(menu);
moveMenuDealtimeItem(menu,item);
showMenusDealtimeItem(menu,item);
}
function startShowDealtimeItemI(menu,item){
startShowDealtime(menu);
}
function sMHDealtime(){
startDtr=new Date();
hideFlagDtr=true;
clearTimeout(startTimerDtr);
hideTimerDtr=setTimeout("hideMenusDealtime()",delayDtr);
}
function checkedTopMenuMouseOutDealtime(e){
if(!e){
var e=window.event;
}
var _209=e.relatedTarget||e.toElement;
if((_209!=null)&&(_209.id!=null)){
var _20a=_209.id;
if((_20a.indexOf("nav2tab"))==-1){
if(activeMenuLitDtr){
activeMenuLitDtr.style.color="#06666b";
activeMenuLitDtr.style.backgroundImage="url(/images/dtrNavArrowDn.gif)";
activeMenuLitDtr.style.backgroundRepeat="no-repeat";
activeMenuLitDtr.style.backgroundPosition="right 5px";
activeMenuLitDtr=null;
}
sMHDealtime();
}
}
}
function hightLightMouseOut(tab){
if(onMenuNumber!=tab){
removeHighLightTopMenu(tab);
}
}
function highLightTopMenu(tab){
if(activeMenuLitDtr){
activeMenuLitDtr.style.color="#06666b";
activeMenuLitDtr.style.backgroundImage="url(/images/dtrNavArrowDn.gif)";
activeMenuLitDtr.style.backgroundRepeat="no-repeat";
activeMenuLitDtr.style.backgroundPosition="right 5px";
activeMenuLitDtr=null;
}
var _20d=getObj("tab"+tab);
if(_20d&&(menuSizes[tab]>0)){
_20d.style.color="#FFFFFF";
_20d.style.backgroundImage="url(/images/dtrNavArrowDnOn.gif)";
_20d.style.backgroundRepeat="no-repeat";
_20d.style.backgroundPosition="right 5px";
}
activeMenuLitDtr=_20d;
}
function removeHighLightTopMenu(tab){
var _20f=getObj("tab"+tab);
if(_20f&&(menuSizes[tab]>0)){
_20f.style.color="#06666b";
_20f.style.backgroundImage="url(/images/dtrNavArrowDn.gif)";
_20f.style.backgroundRepeat="no-repeat";
_20f.style.backgroundPosition="right 5px";
}
activeMenuLitDtr=null;
}
function highLightDynMenuArea(tab,menu){
var _212=getObj("atab"+tab+"amenu"+menu);
if(_212){
_212.style.color="#FFFFFF";
_212.style.background="#86A33D";
_212.style.backgroundImage="url(/images/dtrNavArrowRtOn.gif)";
_212.style.backgroundRepeat="no-repeat";
_212.style.backgroundPosition="180px 5px";
}
highLightTopMenu(tab);
activeMenuItemLitDtr=_212;
}
function removeHighLightDynMenuArea(tab,menu){
if(activeMenuItemLitDtr){
activeMenuItemLitDtr.style.color="#04818E";
activeMenuItemLitDtr.style.background="none";
activeMenuItemLitDtr.style.backgroundImage="url(/images/dtrNavArrowRt.gif)";
activeMenuItemLitDtr.style.backgroundRepeat="no-repeat";
activeMenuItemLitDtr.style.backgroundPosition="180px 5px";
}
activeMenuItemLitDtr=null;
}
function mouseOverSubmenuWithChild(tab,menu){
startShowDealtimeItem(tab,menu);
highLightDynMenuArea(tab,menu);
}
function mouseOutSubmenuWithChild(_217){
removeHighLightDynMenuArea(-1,-1);
checkedTopMenuMouseOutDealtime(_217);
}
function mouseOverSubMenuWithoutChild(tab){
startShowDealtime(tab);
highLightTopMenu(tab);
hideAllMenusDealtime();
}
function mouseOverChild(tab,menu){
highLightDynMenuArea(tab,menu);
startShowDealtimeItemI(tab,-1);
}
function mouseOutChild(tab){
removeHighLightDynMenuArea(-1,-1);
removeHighLightTopMenu(tab);
sMHDealtime();
}
function focusStoreSearch(){
try{
document.frmStoreDir.SS.focus();
}
catch(e){
}
}
function toggleDealSpotlight(show){
var _21d=document.getElementById("bottomDealSpotlight");
if(_21d){
_21d.style.display=show?"block":"none";
}
}

function convertWord(type, content){
    switch (type) {
       case "before":
           break;
       case "after":
           /* Case insensitive */
           content = content.replace( /<a name\=\"?.*?\"?><\/a>/ig,   '' );
           content = content.replace( /<!(?:--[\s\S]*?--\s*)?>\s*/ig, '' );
       break;
    }
    return content;
}

function countWords(id, value, message){
	_var = value;
	_var = _var.replace(/\./g, " ");
	_var = _var.replace(/\,/g, " ");
	_var = _var.replace(/\<\/p>/g, "");
	_var = _var.replace(/\<p>/g, "");
	_var = _var.replace (/^\s+/, "").replace (/\s+$/, "");
	
	var _res   = new Array();
	var _parts = _var.split(" "); 
	var _count = _parts.length;
	
	for (var i = 0; i < _count; ++i) { if (_parts[i] != "" && _parts[i] != " ") { _res.push(_parts[i]); } }   
	var _count = _res.length;  
	
	if (_count > 0) { 
		document.getElementById(id).innerHTML = message.replace(/\%count\%/, _count);
	}
}


