//<!--
//\include\js\search\LVM_01.js@@\main\1

function getDomain(domain)
{if(domain.indexOf(".qa")>0)
{return domain.substring(domain.indexOf("."));}
else
{if(domain.indexOf(".es.")>0)
{return domain.substring(domain.indexOf(".es"));}
else if(domain.indexOf(".tw.")>0)
{return domain.substring(domain.indexOf(".tw"));}
else
{return domain.substring(domain.indexOf(".ebay"));}}}
function replaceSubstring(inputString,fromString,toString){var temp=inputString;if(fromString==""){return inputString;}
if(toString.indexOf(fromString)==-1){while(temp.indexOf(fromString)!=-1){var toTheLeft=temp.substring(0,temp.indexOf(fromString));var toTheRight=temp.substring(temp.indexOf(fromString)+fromString.length,temp.length);temp=toTheLeft+toString+toTheRight;}}else{var midStrings=new Array("~","`","_","^","#");var midStringLen=1;var midString="";while(midString==""){for(var i=0;i<midStrings.length;i++){var tempMidString="";for(var j=0;j<midStringLen;j++){tempMidString+=midStrings[i];}
if(fromString.indexOf(tempMidString)==-1){midString=tempMidString;i=midStrings.length+1;}}}
while(temp.indexOf(fromString)!=-1){var toTheLeft=temp.substring(0,temp.indexOf(fromString));var toTheRight=temp.substring(temp.indexOf(fromString)+fromString.length,temp.length);temp=toTheLeft+midString+toTheRight;}
while(temp.indexOf(midString)!=-1){var toTheLeft=temp.substring(0,temp.indexOf(midString));var toTheRight=temp.substring(temp.indexOf(midString)+midString.length,temp.length);temp=toTheLeft+toString+toTheRight;}}
return temp;}
function drawFrame(val)
{var valArr=val.split("|");var topBottomBarHeight=60;var itemRowHeight=75;if(valArr[0]==0)
{return 0;}
var numOfItems=valArr[0];var lvmHost=thisHost;var domainIndex=lvmHost.indexOf(".ebay");var httpIndex=lvmHost.indexOf("//");var startStr="http://";var subDomain=".ebay.com";var htValue=1;if(typeof(ebSelCBObj)!="undefined")
{if(ebSelCBObj!=null)
{if(ebSelCBObj.ht!=1)
{htValue=ebSelCBObj.ht;var cobrandStr=ebSelCBObj.name+".";var toStr="";lvmHost=replaceSubstring(lvmHost,cobrandStr,toStr);}}}
if(domainIndex>0)
{subDomain=getDomain(lvmHost);}
if(httpIndex>0)
{startStr=lvmHost.substring(0,httpIndex+2);}
var host=startStr+"search"+subDomain;var htParam="&ht="+htValue;var randomNumber=Math.round(Math.random()*1000);var t=escape(new Date());var randomParam="&cb"+randomNumber+"="+t;lvmSrc=host+"/ws/eBayISAPI.dll?LastViewedMerchandising"+htParam+randomParam;var lvmHeight=0;lvmHeight=topBottomBarHeight+(itemRowHeight*numOfItems);document.write('<table width="100%" height="'+lvmHeight+'" border="0" cellPadding="6" cellSpacing="1" bgColor="#FFFFFF">');document.write('<tr align="left" bgColor="#FFFFFF" vAlign="middle"><td height="'+lvmHeight+'" vAlign="top" width="100%">');document.write('<iframe NAME="LVMFrame" width="100%" bgcolor="#FFCC00" border="0" frameBorder="0" height="'+lvmHeight+'" marginHeight="0" marginWidth="0" scrolling="no" ');document.write('>');document.write('<ilayer id="layerLVM" width="100%" bgcolor="#FFCC00" height="'+lvmHeight+'" border="1" src="'+lvmSrc+'">');document.write('<NOLAYER><NOFRAME></NOFRAME></NOLAYER></ilayer></iframe>');document.write('</td><td bgColor="#ffffff" vAlign="top"/></tr></table>');return 1;}
var lvmSrc="";function displayLVMWidget()
{var agt=navigator.userAgent.toLowerCase();var is_opera=(agt.indexOf("opera")!=-1);var is_NS62=(agt.indexOf("netscape6/6.2")!=-1);if(document.layers||is_opera){return 0;}
var val=ReadCookie("LVM");if(val!=null)
{var visible=drawFrame(val);if(visible)
{if(is_NS62)
{setTimeout('updateForNS62()',2000);}
else
{parent.frames['LVMFrame'].location.replace(lvmSrc);}}
return visible;}
else
{return 0;}}
function updateForNS62()
{parent.frames['LVMFrame'].location.replace(lvmSrc);}
function clearLVM()
{DeleteCookie("LVM",CookieDomain,"/");location.reload();}
var cookieDom="ebay.com";var machineHost=location.hostname.toLowerCase();if(machineHost.indexOf(".ebay")>0){cookieDom=machineHost.substring(machineHost.indexOf("ebay"));}
document.domain=cookieDom;var lvm=1;
// -->
