function EbayHTMLLayer(pParent,pName,pDisabled,pCfg)
{if(!this.objType)
this.objType="EbayHTMLLayer";this.base=EbayHTML;this.base(pParent,pName,pName,pDisabled,pCfg);this.aBindEvents=new Array;this.getElem=ebHTMLLayerGetElem;this.getValue=ebHTMLLayerGetValue;this.setValue=ebHTMLLayerSetValue;}
function ebHTMLLayerGetElem(pName)
{var s=pName,d=this.oDocument.doc;if(d.getElementById)
return d.getElementById(s);else if(d.all)
return d.all(s);this.throwWarning("Not supported","getElem");}
function ebHTMLLayerGetValue(pIsText)
{if(this.eElem)
{if(pIsText)
{if(this.oDocument.oGlobals.oClient.bFirefox)
return this.eElem.textContent;else
return this.eElem.innerText;}
else
return this.eElem.innerHTML;}
else
return"";}
function ebHTMLLayerSetValue(pVal,pIsText)
{if(this.eElem)
{if(pIsText)
{if(this.oDocument.oGlobals.oClient.bFirefox)
this.eElem.textContent=pVal;else
this.eElem.innerText=pVal;}
else
this.eElem.innerHTML=pVal;}}
//21@@m7
function myclose()
{
document.getElementById('SuperGalleryDialog').style.display="none";
}
function EbayHTMLImage(pParent,pName,pDisabled,pSource,pDisabledSource,pCfg)
{if(!this.objType)
this.objType="EbayHTMLImage";this.base=EbayHTML;this.base(pParent,pName,pName,pDisabled,pCfg);this.sEnabledSource=this.sDisabledSource=pSource;if(pDisabledSource)
this.sDisabledSource=pDisabledSource;this.getElem=ebHTMLImageGetElem;this.source=ebHTMLImageSource;this.enableBase=this.enable;this.enable=ebHTMLImageEnable;this.subscribeEvents("onclick","onmouseover","onmouseout");}
function ebHTMLImageGetElem(pName)
{return this.getDocElem(pName,'images');}
function ebHTMLImageSource(pSrc,pText)
{var im=this.eElem;if(typeof(im)=='undefined')
return;if(typeof(pSrc)=="undefined")
return(im)?im.src:"";else
{im.src=pSrc;if(pText!=null)
im.alt=pText;}}
function ebHTMLImageEnable(pEnable)
{with(this)
{enableBase(pEnable);if(sDisabledSource&&eElem)
eElem.src=(pEnable)?sEnabledSource:sDisabledSource;}}
//22@@m6
window.toPixels=function(number)
{
return number+"px";
};
window.metaInfo=function(name,value){var tags=document.getElementsByTagName("meta");for(var idx=0;(idx=0)this.openLeft();else if(widthRight>=0)this.openRight();else if(widthRight>widthLeft)this.openRight();else this.openLeft();if(!this.config.isIEQuirksMode&&!this.config.isFirefoxQuirksMode){this.frameHeight=Math.min(this.body.offsetHeight+(this.frame.clientHeight?(this.frame.offsetHeight-this.frame.clientHeight):this.borderHeight),this.clientHeight,this.height);this.frame.style.height=window.toPixels(this.frameHeight-this.borderHeight);}
this.offsetTop=Math.max(Math.min(this.top-this.origin,this.clientBottom-this.frame.offsetHeight-this.shadow.offsetTop),this.scrollTop);this.arrowTop=Math.min(this.top-this.offsetTop,this.frame.offsetHeight-27);this.frame.scrollTop=0;this.shadow.style.width=window.toPixels(this.frame.offsetWidth);this.shadow.style.height=window.toPixels(this.frame.offsetHeight);this.dialog.style.top=window.toPixels(this.offsetTop);this.dialog.style.left=window.toPixels(this.offsetLeft);this.backing.style.width=window.toPixels(this.content.offsetWidth);this.backing.style.height=window.toPixels(this.content.offsetHeight);this.arrow.style.top=window.toPixels(this.arrowTop);var element=(document.documentElement)?document.documentElement:document.body;DHTMLEvent.removeEventListener(this.listener,"mousemove",this.onmousemove);DHTMLEvent.addEventListener(this.listener,"mousemove",this.onmousemove);if(this.resizes--)this.resizer=window.setTimeout(this.onresize,100);else this.setTimeout(this.config.timeout,true);
};
BalloonDialog.prototype.openLeft=function(){this.arrow=this.arrowLeft;this.arrow.style.display="block";this.arrowRight.style.display="none";this.offsetLeft=Math.max(this.left,this.scrollLeft);if(this.config.isIEQuirksMode){this.IEQuirksAdjust(this.clientRight-this.arrowLeft.offsetWidth-this.offsetLeft);}else if(this.config.isFirefoxQuirksMode){this.FirefoxQuirksAdjust(this.clientRight-this.arrowLeft.offsetWidth-this.offsetLeft);}else{this.frameWidth=Math.min(this.body.offsetWidth+(this.frame.clientWidth?(this.frame.offsetWidth-this.frame.clientWidth):this.borderWidth),this.clientRight-this.arrowLeft.offsetWidth-this.offsetLeft-this.shadow.offsetLeft,this.width);this.frame.style.width=window.toPixels(this.frameWidth-this.borderWidth);}};BalloonDialog.prototype.openRight=function(){this.arrow=this.arrowRight;this.arrow.style.display="block";this.arrowLeft.style.display="none";this.offsetRight=Math.min(this.left,this.clientRight);if(this.config.isIEQuirksMode){this.IEQuirksAdjust(this.offsetRight-this.arrowRight.offsetWidth-this.scrollLeft);}else if(this.config.isFirefoxQuirksMode){this.FirefoxQuirksAdjust(this.offsetRight-this.arrowRight.offsetWidth-this.scrollLeft);}else{this.frameWidth=Math.min(this.body.offsetWidth+(this.frame.clientWidth?(this.frame.offsetWidth-this.frame.clientWidth):this.borderWidth),this.offsetRight-this.arrowRight.offsetWidth-this.scrollLeft,this.width);this.frame.style.width=window.toPixels(this.frameWidth-this.borderWidth);}
this.offsetLeft=Math.max(this.offsetRight-this.dialog.offsetWidth,0);};BalloonDialog.prototype.IEQuirksAdjust=function(Hoffset){var Voffset=this.clientHeight;var hasHScrollBar=Hoffset0)
this.frame.style.height=window.toPixels(Voffset-16);else
this.frame.style.height=window.toPixels(Voffset);}
else if(hasVScrollBar&&hasHScrollBar){this.frame.style.width=window.toPixels(Hoffset);this.frame.style.height=window.toPixels(Voffset-16);}
else{this.frame.style.width=window.toPixels(this.body.offsetWidth);}};BalloonDialog.prototype.close=function(){this.active=false;this.dialog.style.display="none";window.clearTimeout(this.timer);window.clearTimeout(this.resizer);DHTMLEvent.removeEventListener(this.listener,"mousemove",this.onmousemove);if(this.onclose)this.onclose();};BalloonDialog.prototype.setTimeout=function(timeout,active){this.active=active;window.clearTimeout(this.timer);this.timer=(timeout)?window.setTimeout(this.ontimeout,timeout):null;return false;};BalloonDialog.prototype.onTimeout=function(event){this.close();};BalloonDialog.prototype.onMouseMove=function(event){var eventTarget=DHTMLEvent.target(event);if(window.containsElement(this.link,eventTarget))return this.setTimeout(this.timeout,true);else if(window.containsElement(this.frame,eventTarget))return this.setTimeout(this.timeout,true);else if(window.containsElement(this.arrow,eventTarget))return this.setTimeout(this.timeout,true);var xorg=window.offsetLeft(this.arrow)-window.eventLeft(event);var yorg=window.offsetTop(this.arrow)-window.eventTop(event);if((Math.abs(xorg)<25)&&(Math.abs(yorg)<25))return this.setTimeout(this.timeout,true);else if(this.active)return this.setTimeout(this.config.mouseout,false);};BalloonDialog.prototype.hideSelects=function(){this.selects=new Array();var dialogTop=window.offsetTop(this.dialog);var dialogLeft=window.offsetLeft(this.dialog);var dialogBottom=dialogTop+this.dialog.offsetHeight;var dialogRight=dialogLeft+this.dialog.offsetWidth;var selects=document.getElementsByTagName("select");for(var idx=0;(idxdialogBottom)||(selectBottomdialogRight)||(selectRight1))?504:420);
// }
// else
{
//alert (this.config.host+this.gallery.id)
// myImage = new Image();
// myImage.src = this.config.host+this.gallery.id;
//alert('t')
//img_resize(iHeight,iWidth)
var myheight = iHeight;
var mywidth = iWidth;
//alert (myheight +','+ mywidth);
var i = img_resize(iHeight,iWidth);
i = i.split('_');
if (i[0] != 0)
{
myheight = i[0];
}
if (i[1] != 0)
{
mywidth = i[1];
}
mywidth = eval(mywidth+"+15");
myheight = eval(myheight+"+25");
//alert ('test == '+i[1]+'=='+mywidth)
this.dialog.body.style.width=window.toPixels((this.gallery.enableThumbs=="true"&&(this.gallery.nImgs>1))?510:mywidth);
//this.dialog.body.style.height=window.toPixels(myheight);
//alert (this.dialog.body.style.width+' --test');
}
document.getElementById('SuperGalleryDialogImage').style.height = myheight+'px';
document.getElementById('SuperGalleryDialogImage').style.width = mywidth+'px';
this.dialog.open(this.top,this.left,this.config.width,this.config.height,this.config.origin);
this.slider.style.top=window.toPixels(0);
DHTMLEvent.removeEventListener(this.link,"mouseout",this.onmouseout);
this.loader=new Object();
this.loader.index=0;
this.loader.elapsed=0;
this.preCache();
};
SuperGallery.prototype.preCache=function()
{
this.loaded=false;
this.loader.image=new Image();
this.loader.start=new Date().getTime();
var index=this.loader.index+1;
//this.gallery.id='../mdc_best/pcat-ts/products-large1/s_product_sample_1-blowup-1.jpg';
//var bigImgUrl=this.config.host+this.gallery.id+"_"+index+"_"+this.gallery.version+"../_1.jpg";
var bigImgUrl=this.config.host+this.gallery.id;
this.loader.tick=Math.max(Math.round(this.loader.elapsed/16),250);
this.loader.timeout=window.setTimeout(this.onloaderror,Math.max(32*this.loader.tick,30000));
this.loader.image.onload=this.onloadimage;
this.loader.image.onerror=this.onloaderror;
this.loader.image.onabort=this.onloaderror;
if(this.gallery.nImgs>1&&this.gallery.enableThumbs=="true")
this.showProgress();
//alert (bigImgUrl);
//bigImgUrl = 'http://bhptemp.mypcat.com/mdc_best/pcat-ts/products-large1/s_product_sample_1-blowup-1.jpg';
this.loader.image.src=bigImgUrl;
//this.loader.image.height = 300;
//alert (this.loader.image.height);
/*
this.loader.image.height ="200px";
this.loader.image.width ="200px"; */
};
SuperGallery.prototype.showProgress=function()
{
if(this.loader.index10)
oProgressLyr.style.height=window.toPixels(oProgressLyr.offsetHeight-10);
if(oProgressLyr.offsetHeight>4)
this.loader.ticker=window.setTimeout(this.onloadticker,this.loader.tick);
}
};
SuperGallery.prototype.onLoadImage=function(event)
{
this.loaded=true;
window.clearTimeout(this.loader.ticker);
window.clearTimeout(this.loader.timeout);
if(this.loader.index==0&&(this.gallery.nImgs==1||this.gallery.enableThumbs!="true"))
{
var imgId=document.getElementById("imgBig");
imgId.src=this.loader.image.src;
// if (imgId.width > 500 )
// {
// imgId.width = 500;
// }
// else if (imgId.height > 500 )
// {
// imgId.height = 500;
// }
//alert (this.gallery.iHeight +'======'+this.gallery.iWidth);
var i = img_resize(this.gallery.iHeight, this.gallery.iWidth);
i = i.split('_');
var myheight = i[0];
var mywidth = i[1];
imgId.width = mywidth ;
imgId.height = myheight;
this.onBigImgload();
}
else
{
if(this.loader.index1)){var str="progressLyr"+this.loader.index;var oProgressLyr=document.getElementById(str);oProgressLyr.style.display="block";oProgressLyr.style.top=window.toPixels(0);oProgressLyr.style.left=window.toPixels(0);oProgressLyr.style.height=window.toPixels(64);}
this.onLoadDone();};SuperGallery.prototype.onClose=function(){var oSurvey=ebay.oDocument.oPage._getControl("KeyFlow.Exit.Survey");if(oSurvey)
oSurvey.enable();};
SuperGallery.prototype.SGContent=function()
{
this.setBigImgTxt(this.config.loading);
if(this.gallery.enableThumbs=="true"&&this.gallery.nImgs>1)
{
this.thumbs.style.display="";
this.slider.innerHTML=this.getThumbLayerContent();
//alert (this.slider.innerHTML);
if(this.config.isIEQuirksMode)
this.thumblayer.style.width=window.toPixels(79);
if(this.gallery.nImgs<=4)
{
this.paginationUp.style.display="none";
this.paginationDown.style.display="none";
this.thumblayer.style.marginTop=window.toPixels(41);
}
else
{
this.paginationUp.style.display="block";
this.paginationDown.style.display="block";
this.thumblayer.style.marginTop=window.toPixels(19);
}
this.images=this.slider.getElementsByTagName("div");
this.images[0].className="outerThumbDiv selected";
var setThumbOpacity="";
var opacity=0.7;
for(var i=0;i=this.gallery.nImgs);
this.sliderDown.src=(this.sliderDown.disabled)?this.config.coreImgHost+"../buttons/btnnextNA.gif":this.config.coreImgHost+"../buttons/btnnext.gif";
this.paginationDown.style.cursor=(this.sliderDown.disabled)?"default":"pointer";
this.sliderTop=-this.images[scrollIndex*3].offsetTop;
};
SuperGallery.prototype.dialogHandlers=function()
{this.oDivThumbObj=new Array();for(var i=0;i=imgH)&&(imgW>400))
scale=400/imgW;else if((imgH>400)&&(imgH>=imgW))
scale=400/imgH;bImg.style.width=window.toPixels(scale*imgW);bImg.style.height=window.toPixels(scale*imgH);bImgDiv.className="imgvisible";bImgTxt.style.display="none";bImgDiv.style.display="block";if(this.selected==0)
this.onLoadDone();}
SuperGallery.prototype.onBigImgloadError=function(){var bImgTxt=document.getElementById("bImgTxt");var bImgDiv=document.getElementById("bImgDiv");bImgTxt.innerHTML="Error loading the image";bImgTxt.style.display="none";bImgDiv.style.display="block";};
SuperGallery.prototype.showViewItem=function(){
//alert (this.parent.gallery.vItemlnk)
if (this.parent.gallery.vItemlnk)
{
window.open(this.parent.gallery.vItemlnk, 'blowup', 'toolbar=no,location=yes,directories=yes,status=no,scrollbars=yes,resizable=yes,width="300",height="300",copyhistory=no');
}
//document.location.href=this.parent.gallery.vItemlnk;
};
SuperGallery.prototype.getThumbLayerContent=function()
{
var outPut="";
var id=0;
var thumbImg;
for(var i=0;i";
}
return outPut;
};
SuperGallery.prototype.onSlideNext=function(event){var i=Math.min(((this.scrollIndex)+4),(Math.max(this.gallery.nImgs-4,0)));this.scrollEnable(i);window.setTimeout(this.onscrolldown,this.config.timer);};SuperGallery.prototype.onScrollDown=function(){this.slider.style.top=window.toPixels(Math.max(this.slider.offsetTop-this.config.pixels,this.sliderTop));if((this.slider.offsetTop-this.sliderTop)>this.config.pixels)window.setTimeout(this.onscrolldown,this.config.timer);else this.slider.style.top=window.toPixels(this.sliderTop);};SuperGallery.prototype.onSlidePrev=function(){this.scrollEnable(Math.max(this.scrollIndex-4,0));window.setTimeout(this.onscrollup,this.config.timer);};SuperGallery.prototype.onScrollUp=function(){this.slider.style.top=window.toPixels(Math.min(this.slider.offsetTop+this.config.pixels,this.sliderTop));if((this.sliderTop-this.slider.offsetTop)>this.config.pixels)window.setTimeout(this.onscrollup,this.config.timer);else this.slider.style.top=window.toPixels(this.sliderTop);};
function onSlidePrev(event){
var control=ebay.oDocument._getControl("SuperGallery");
return(control)?control.onSlidePrev(event):false;
};
function onSlideNext(event){
var control=ebay.oDocument._getControl("SuperGallery");
return(control)?control.onSlideNext(event):false;
};
//function onGalleryPlus(event,itemId,nImgs,isSuperSz,version,enableThumbs,vItemlnk)
function onGalleryPlus(event,itemId, iHeight, iWidth)
{
//var img_path = itemId.split("../Wc75be53a2ef1.htm");
var iHeight = iHeight;
var iWidth = iWidth;
myImage = new Image();
myImage.src = itemId;
var myheight = myImage.height;
var mywidth = myImage.width;
var img_path = itemId.replace('http://','');
img_path = img_path.split(/\//);
var img_host = 'http://'+img_path[0];
var img_url = '';
for(i=1; i < img_path.length; i++)
{
img_url = img_url+'/'+img_path[i];
}
/*
img_path[0] = img_path[0]+'.com';
img_path[1] = '/'+img_path[1];*/
//alert (itemId) get image size and do next step
var vItemlnk = '';
document.getElementById('imgBig').style.cursor ='default';
if ((myheight > 500) || (mywidth >500))
{
vItemlnk = itemId;
document.getElementById('imgBig').style.cursor ='pointer';
}
var oSurvey=ebay.oDocument.oPage._getControl("KeyFlow.Exit.Survey");
if(oSurvey)
oSurvey.disable();
event.cancelBubble=true;
var control=ebay.oDocument._getControl("SuperGallery");
if((control==null)||(control.dialog.active))
return false;
var link=DHTMLEvent.currentTarget(event);
while(link&&(link.onmouseover==null))
link=link.parentNode;
if(link==null)
return false;
if(link.active)return false;
var control=ebay.oDocument._getControl("SuperGallery");
if(control==null)return false;
control.config.host = img_host;
//alert (vItemlnk +' Amit Pratap')
var nImgs = 1;
var version =0;
var gallery=new Array();
gallery.id=img_url;
gallery.nImgs=1;
gallery.isSuperSz='';
gallery.enableThumbs='false';
gallery.version=0;
gallery.iHeight =iHeight;
gallery.iWidth =iWidth;
if(version=="")gallery.version=1;
if(gallery.version>500)gallery.nImgs=parseInt(nImgs)+1;
gallery.vItemlnk=vItemlnk;
if(link.className=="galleryplus")
control.setDelay(event,link,gallery,(link.height/2),(link.width/2));
else
control.setDelay(event,link,gallery,5,10);return false;
};
function onSuperGalleryThumb(idx){var image=document.getElementById("imgThumb"+idx);if(image==null)return;if((image.width>64)&&(image.width>=image.height))image.width=(64/image.width)*image.width;else if((image.height>64)&&(image.height>=image.width))image.height=(64/image.height)*image.height;image.onload=null;image.style.position="relative";image.style.top=window.toPixels(Math.floor((64-image.height)/2));image.style.left=window.toPixels(Math.floor((64-image.width)/2));};var cfg=ebay.oDocument.getConfig("SuperGallery");if(document.compatMode=="BackCompat"){if(ebay.oGlobals.oClient.bIE)
cfg.isIEQuirksMode=true;else if(ebay.oGlobals.oClient.bFirefox)
cfg.isFirefoxQuirksMode=true;}
if(cfg)new SuperGallery(ebay.oDocument.oPage,cfg);
function img_resize (iHeight,iWidth)
{
//alert ('test' + iHeight+','+iWidth)
var myheight = iHeight;
var mywidth = iWidth;
var _dheight = 500;
var _dwidth = 500;
if(myheight > _dheight || mywidth > _dwidth)
{
if(myheight > mywidth)
{
var temp = myheight/_dheight;
var new_width = mywidth / temp;
new_width = parseInt(new_width);
myheight = _dheight;
mywidth = new_width;
}
else
{
var temp = mywidth/_dwidth;
var new_height = myheight / temp;
new_height = parseInt(new_height);
myheight = new_height;
mywidth = _dwidth;
}
}
return (myheight+'_'+mywidth);
}