                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                

if(!window.__td){window.__MT=100;window.__ti=0;window.__td=[];window.__td.length=__MT;window.__noTrace=false;}
if(typeof vp=="undefined")
{var vp={};}
vp.gallery=function gallery(){if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}};vp.gallery.ATTRIBUTE_FOIL_ID=3;vp.gallery.ATTRIBUTE_MATCHING_SET_ID=4;vp.gallery.ATTRIBUTE_LOGO_PHOTO_AREA=8;vp.gallery.ATTRIBUTE_EXPRESS_CONTENT_ID=16;vp.gallery.ATTRIBUTE_BOOKMARK_ID=19;vp.gallery.ATTRIBUTE_ACCENT_IMAGE_ID=69;vp.gallery.ATTRIBUTE_SCENE_DESIGNS_ID=70;vp.gallery.ATTRIBUTE_COLOR_VARIATIONS_ID=73;vp.gallery.ATTRIBUTE_THEME_PREVIEW_ID=74;vp.gallery.ATTRIBUTE_BACKSIDE_OPTIONS=89;vp.gallery.ATTRIBUTE_DESIGNER_HOLIDAY_ID=201;vp.gallery.ATTRIBUTE_DESIGNER_FLAT5X7_HOLIDAY_ID=206;vp.gallery.notificationTimeout=7000;vp.gallery.viewLargerComboId=null;vp.gallery.viewLargerIsFoilSelected=false;vp.gallery.bookmarkEnableAttempts=0;vp.gallery.bookmarkEnableMaxAttempts=5;vp.gallery.bookmarkQueue=new Array();vp.gallery.bookmarkQueueBusy=false;vp.gallery.initialCalloutTimeout=45000;vp.gallery.notifications=new Array();vp.gallery.NOTIFICATION_SEARCH_BOX_ID=0;vp.gallery.NOTIFICATION_BOOKMARK_BOX_ID=1;vp.gallery.NOTIFICATION_SEARCH_TIPS_ID=3;vp.gallery.NOTIFICATION_NAVIGATION_TIPS_ID=4;vp.gallery.NOTIFICATION_INACTIVE_ROOTS_ID=5;vp.gallery.NOTIFICATION_PERM_LINK_BOX_ID=6;vp.gallery.topListRendered=new Array();vp.gallery.topListVisibleRoot=-1;vp.gallery.topListColumnCount=-1;vp.gallery.topListMinimumRowCount=3;vp.gallery.cancelEvents=true;vp.gallery.cancelDOMEvents=function gallery_cancelDOMEvents()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
vp.gallery.cancelEvents=true;};vp.gallery.changeFilter=function gallery_changeFilter(sNewAttributeValue)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
vp.gallery.redirect(GalleryData.FilterDictionary.getValue(sNewAttributeValue));};vp.gallery.changePageSize=function gallery_changePageSize(iNewPageSize)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
vp.gallery.redirect(GalleryData.PagingOptions.getValue(iNewPageSize));};vp.gallery.changeVendorServer=function gallery_changeVendorServer(iNewVendorServerId)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
vp.gallery.redirect(GalleryData.VendorServers.getValue(iNewVendorServerId));};vp.gallery.changeSort=function gallery_changeSort(sNewSortKey)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
vp.gallery.redirect(GalleryData.SortingOptions.getValue(sNewSortKey));};vp.gallery.redirect=function gallery_redirect(sNewUrl)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
if(sNewUrl)
{vp.gallery.addMask(document.getElementById("trGallerySearch"));window.location=sNewUrl;}};vp.gallery.getComboIdFromComboSequence=function gallery_getComboIdFromComboSequence(iSeq)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
return GalleryData.Combos.getKeyByPropertyValue("SequenceNumber",iSeq);};vp.gallery.selectBacksideCombo=function gallery_selectBacksideCombo(sOriginalComboHash)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var oCombo=GalleryData.Combos.getValue(sOriginalComboHash);var sComboHash=oCombo.ComboHash;var iComboId=oCombo.ComboId;var sSelectedColor=vp.web.getQueryString("color_options");var iDocumentPage=vp.web.getQueryString("document_page");if(!iDocumentPage)
{iDocumentPage=1;}
var sColor="color";if(sSelectedColor)
{sSelectedColor=sSelectedColor.toLowerCase();}
if(sSelectedColor=="fullColor")
{sColor="color";}
else if(sSelectedColor=="grayscale")
{sColor="gray";}
else if(sSelectedColor=="blank")
{sColor="blank";sComboHash=null;iComboId=null;}
var iSubstrateColor=vp.web.getQueryString("ssc");if(iSubstrateColor===null||typeof(iSubstrateColor)=="undefined"||!oCombo.ViewStandardPreviewUrls[iSubstrateColor])
{iSubstrateColor=1;}
if(vp.SelectBacksidePage&&vp.SelectBacksidePage.nextURL)
{vp.studio.StudioBacksideGallery.changeBacksideColor(sColor);if(sColor=="blank")
{vp.SelectBacksidePage.changeComboAndGoNext("","",vp.SelectBacksidePage.nextURL);}
else
{vp.SelectBacksidePage.changeComboAndGoNext(iComboId,sComboHash,vp.SelectBacksidePage.nextURL);}}
else
{vp.dialog.getParent().SelectBackside(sComboHash,iComboId,oCombo.ViewStandardPreviewUrls[iSubstrateColor][0],sColor,iDocumentPage);vp.dialog.getCurrent().close();}};vp.gallery.hideSearchDefaultText=function gallery_hideSearchDefaultText()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var oSearchBox=(vp.ui.get("txtSearchPop")&&vp.gallery.getCategoryPop().isVisible())?vp.ui.get("txtSearchPop"):vp.ui.get("txtSearch");var currentText=oSearchBox.value;if(GalleryData.LangMap.DefaultSearchKeyword===null||currentText===GalleryData.LangMap.DefaultSearchKeyword)
{GalleryData.LangMap.DefaultSearchKeyword=currentText;oSearchBox.value="";}};vp.gallery.showSearchDefaultText=function gallery_showSearchDefaultText()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var oSearchBox=(vp.ui.get("txtSearchPop")&&vp.gallery.getCategoryPop().isVisible())?vp.ui.get("txtSearchPop"):vp.ui.get("txtSearch");var currentText=oSearchBox.value;if(currentText.length===0)
{oSearchBox.value=GalleryData.LangMap.DefaultSearchKeyword;}};vp.gallery.searchByKeyword=function gallery_searchByKeyword()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var currentText=document.getElementById("txtSearch").value;var newUrl=GalleryData.Features.KeywordSearchUrl;if(document.getElementById("txtSearchPop")&&vp.gallery.getCategoryPop().isVisible()&&(currentText===null||currentText.length===0||currentText===GalleryData.LangMap.DefaultSearchKeyword))
{currentText=document.getElementById("txtSearchPop").value;vp.gallery.setCategoryPopCookie();newUrl=newUrl.replace("xnav=search","xnav=popsearch");}
if(GalleryData.LangMap.DefaultSearchKeyword===null||currentText===null||currentText.length===0||currentText===GalleryData.LangMap.DefaultSearchKeyword)
{vp.gallery.showSearchTextBoxNotification(GalleryData.LangMap.ErrorNoSearchTerm,5000);return;}
currentText=currentText.replace(/,/g," ");currentText=currentText.replace(/\s+/g," ");currentText=escape(currentText);newUrl=unescape(newUrl);newUrl=newUrl.format(currentText);var oSelMode=document.getElementById("selMode");if(oSelMode)
{newUrl=newUrl.replace(/&*matchmode=\d*/,"");newUrl+="&matchmode="+oSelMode.options[oSelMode.selectedIndex].value;}
vp.gallery.redirect(newUrl);};vp.gallery.textKeywordSearch_OnKeyDown=function gallery_textKeywordSearch_OnKeyDown(e)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
if(e.keyCode===13)
{vp.gallery.searchByKeyword();vp.events.cancelEvent(e);vp.events.cancelBubble(e);}};vp.gallery.bookmarkCombo=function gallery_bookmarkCombo(sComboId,bRemoveBookmark)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
vp.gallery.bookmarkQueue.push({comboId:sComboId,remove:bRemoveBookmark});if(!vp.gallery.bookmarkQueueBusy)
{vp.gallery.processNextBookmarkedCombo();}
if(bRemoveBookmark&&vp.gallery.getViewLargerPop().isVisible())
{vp.gallery.getViewLargerPop().close();}
return false;};vp.gallery.processNextBookmarkedCombo=function gallery_processNextBookmarkedCombo()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
vp.gallery.bookmarkQueueBusy=true;var oCurrentCombo=vp.gallery.bookmarkQueue.shift();if(!oCurrentCombo)
{vp.gallery.bookmarkQueueBusy=false;return false;}
var sComboId=oCurrentCombo.comboId;var bRemoveBookmark=oCurrentCombo.remove;var oRequest=new vp.gallery.WebRequest();var oCombo=GalleryData.Combos.getValue(sComboId);oRequest.addParameter("request_type",1);oRequest.addParameter("combo_hash",oCombo.ComboHash);oRequest.addParameter("pf_id",oCombo.PfId);oRequest.addParameter("pg",GalleryData.Features.ProductGroupId);var bHasBookmark;if(oCombo.BookmarkId)
{bHasBookmark=true;}
else
{bHasBookmark=false;}
if(bRemoveBookmark)
{if(!bHasBookmark)
{oCombo.BookmarkId=null;vp.gallery.removePreview(oCombo.SequenceNumber);vp.gallery.processNextBookmarkedCombo();return false;}
oRequest.addParameter("action","remove");oRequest.addParameter("bookmark_id",oCombo.BookmarkId);}
else
{if(bHasBookmark)
{vp.gallery.showBookmarkInfoNotification(GalleryData.LangMap.Bookmarks.AlreadyBookmarked+" "+GalleryData.LangMap.Bookmarks.ClickHereToSee,GalleryData.LangMap.Bookmarks.AlreadyBookmarked,sComboId);vp.gallery.processNextBookmarkedCombo();return false;}
oRequest.addParameter("action","add");if(isNaN(sComboId))
{oRequest.addParameter("combo_id",0);}
else
{oRequest.addParameter("combo_id",sComboId);}}
var fnSuccessHandler=function pv_fnSuccessHandler(oContent)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var iReturnedBookmarkId=oContent.bookmark_id;var success=iReturnedBookmarkId>0;if(bRemoveBookmark)
{if(success)
{var fnTrackRemove=function pv_fnTrackRemove()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
vp.gallery.trackBookmark("remove",oCombo);};setTimeout(fnTrackRemove,400);oCombo.BookmarkId=null;vp.gallery.removePreview(oCombo.SequenceNumber);vp.gallery.hideViewLargerPop();}
else
{vp.gallery.showBookmarkInfoNotification(null,GalleryData.LangMap.Bookmarks.ErrorRemove,sComboId);}}
else
{if(success)
{var fnTrackAdd=function pv_fnTrackAdd()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
vp.gallery.trackBookmark("add",oCombo);};setTimeout(fnTrackAdd,400);vp.gallery.showBookmarkInfoNotification(GalleryData.LangMap.Bookmarks.SuccessBookmarkFilter+" "+GalleryData.LangMap.Bookmarks.ClickHereToSee,GalleryData.LangMap.Bookmarks.SuccessBookmarkLink,sComboId);oCombo.BookmarkId=iReturnedBookmarkId;}
else
{vp.gallery.showBookmarkInfoNotification(null,GalleryData.LangMap.Bookmarks.ErrorAdd,sComboId);}}
if(success)
{var oAllBookmarks=oContent["all_bookmarks"];if(oAllBookmarks.length>0)
{GalleryData.Features.UserHasBookmarks="true";}
else
{GalleryData.Features.UserHasBookmarks="false";}
vp.gallery.enableBookmarks();}
vp.gallery.processNextBookmarkedCombo();return false;};var fnErrorHandler=function pv_fnErrorHandler(oContent)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
vp.gallery.showBookmarkInfoNotification(null,GalleryData.LangMap.Bookmarks.GenericError,sComboId);vp.gallery.processNextBookmarkedCombo();return false;};oRequest.callbackFunction=fnSuccessHandler;oRequest.errorHandlerFunction=fnErrorHandler;try
{oRequest.executeAsync();}
catch(e)
{fnErrorHandler(e);}
return false;};vp.gallery.performAttributeAction=function gallery_performAttributeAction(iAttributeId,sComboId)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
switch(iAttributeId)
{case vp.gallery.ATTRIBUTE_FOIL_ID:vp.gallery.showFoilAccents(sComboId);break;case vp.gallery.ATTRIBUTE_MATCHING_SET_ID:vp.gallery.showMatchingSet(sComboId);break;case vp.gallery.ATTRIBUTE_EXPRESS_CONTENT_ID:vp.gallery.showExpressContent(sComboId);break;case vp.gallery.ATTRIBUTE_ACCENT_IMAGE_ID:vp.gallery.showAccentImage(sComboId);break;case vp.gallery.ATTRIBUTE_SCENE_DESIGNS_ID:vp.gallery.showSceneDesigns(sComboId);break;case vp.gallery.ATTRIBUTE_COLOR_VARIATIONS_ID:vp.gallery.showColorVariations(sComboId);break;case vp.gallery.ATTRIBUTE_THEME_PREVIEW_ID:vp.gallery.showThemePreview(sComboId);break;case vp.gallery.ATTRIBUTE_DESIGNER_HOLIDAY_ID:vp.gallery.showHolidayDesignerCollection(sComboId);break;case vp.gallery.ATTRIBUTE_DESIGNER_FLAT5X7_HOLIDAY_ID:vp.gallery.showFlat5x7HolidayDesignerCollection(sComboId);break;default:break;}
return false;};vp.gallery.getAttributeValue=function gallery_getAttributeValue(oAttributeKey,sComboId)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var oItemAttributes=GalleryData.Combos.getValue(sComboId).Attributes;for(var i=0;i<oItemAttributes.length;i++)
{if(oItemAttributes[i].name==oAttributeKey)
{return oItemAttributes[i].value;}}
return null;};vp.gallery.showResellerPricingPop=function gallery_showResellerPricingPop(sUrl)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var oDialog=vp.dialog.IFrameDialog.open("pricingPop","",sUrl,vp.dialog.chrome.Primary,720,530,{scrollType:DIALOG_SCROLL_TYPE_BOTH});oDialog.open();return false;};vp.gallery.showKitViewLarger=function gallery_showKitViewLarger(sComboId)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var oCombo=GalleryData.Combos.getValue(sComboId);var viewLargerUrl;if(oCombo.PrimaryComboId>0)
{viewLargerUrl="/kits/view-larger-pop.aspx?combo_id={0}&pf_id={1}&kit_id={2}";viewLargerUrl=viewLargerUrl.format(oCombo.PrimaryComboId,oCombo.PfId,GalleryData.Features.KitId);}
else
{viewLargerUrl="/kits/view-larger-pop.aspx?combo_hash={0}&pf_id={1}&kit_id={2}";viewLargerUrl=viewLargerUrl.format(oCombo.PrimaryComboHash,oCombo.PfId,GalleryData.Features.KitId);}
if(GalleryData.Features.MatchingSetPfIds)
{viewLargerUrl+="&kit_pfids="+GalleryData.Features.MatchingSetPfIds;}
var iWidth=Math.min(600,vp.ui.getClientWidth()*0.80);var iHeight=Math.min(700,vp.ui.getClientHeight()*0.90);var oDialog=vp.dialog.IFrameDialog.open("kitsViewLarger",GalleryData.LangMap.KitsViewLargerTitle,viewLargerUrl,vp.dialog.chrome.Primary,iWidth,iHeight,{scrollType:DIALOG_SCROLL_TYPE_BOTH});vp.gallery.trackPop("view_larger_kits",oCombo);oDialog.open();return false;};vp.gallery.showMatchingSet=function gallery_showMatchingSet(sComboId)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var isPop=GalleryData.Features.MatchingSetType=="1";var oCombo=GalleryData.Combos.getValue(sComboId);var matchingUrl=null;if(isPop)
{matchingUrl="/matching-set-choose-products-pop.aspx?combo_id={0}&match_to={1}";matchingUrl=matchingUrl.format(sComboId,oCombo.PfId);var oViewPortSize=vp.ui.getViewportSize();oViewPortSize.height=Math.max(oViewPortSize.height,500);oViewPortSize.width=Math.max(oViewPortSize.width,800);var oRect={width:760,left:(oViewPortSize.width-760)/2,top:20+vp.ui.getScrollOffset().top,height:oViewPortSize.height-40};var oDialog=new vp.dialog.IFrameDialog("MatchingSetDialog",oRect,matchingUrl);oDialog.scrollType=DIALOG_SCROLL_TYPE_VERTICAL;oDialog.chrome=vp.dialog.chrome.Primary;oDialog.options.title=GalleryData.LangMap.MatchingSetTitle;vp.gallery.trackPop("view_matchingset",oCombo);oDialog.open();}
else
{if(GalleryData.Features.MatchingSetType=="2")
{matchingUrl="/matching-sets/select-matching-kit.aspx?combo_id={0}&pfid={1}&xnav=Gallery";}
else
{matchingUrl="/vp/ns/matching_set_choose_products.aspx?combo_id={0}&match_to={1}";}
matchingUrl=matchingUrl.format(sComboId,oCombo.PfId);vp.gallery.redirect(matchingUrl);}};vp.gallery.createMatchingSetDialog=function gallery_createMatchingSetDialog(sUrl,bModal)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var oViewPortSize=vp.ui.getViewportSize();oViewPortSize.height=Math.max(oViewPortSize.height,500);oViewPortSize.width=Math.max(oViewPortSize.width,800);var oRect={width:760,left:(oViewPortSize.width-760)/2,top:20,height:oViewPortSize.height-40};var oDialog=new vp.dialog.IFrameDialog("MatchingSetDialog",oRect,sUrl);if(!bModal)
{oDialog.options.veilOpacity=0;oDialog.options.closeOnClickOutside=true;}
oDialog.scrollType=DIALOG_SCROLL_TYPE_VERTICAL;oDialog.chrome=vp.dialog.chrome.Primary;oDialog.options.title="Matching Set";return oDialog;};vp.gallery.showExpressContent=function gallery_showExpressContent(sComboId)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var iComboSeq=GalleryData.Combos.getValue(sComboId).SequenceNumber;var headerMessage=GalleryData.LangMap.ExpressDesignsHeader;var bodyMessage=GalleryData.LangMap.ExpressDesignsBody;var oLink;oLink=document.getElementById("aAttributeLink_"+iComboSeq+"_"+vp.gallery.ATTRIBUTE_EXPRESS_CONTENT_ID);vp.gallery.showAttributeGenericNotification(headerMessage,bodyMessage,oLink,15);};vp.gallery.showHolidayDesignerCollection=function gallery_showHolidayDesignerCollection(sComboId)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var iComboSeq=GalleryData.Combos.getValue(sComboId).SequenceNumber;var headerMessage=GalleryData.LangMap.DesignerCollectionHeader;var bodyMessage=GalleryData.LangMap.DesignerCollectionBody;var oLink;oLink=document.getElementById("aAttributeLink_"+iComboSeq+"_"+vp.gallery.ATTRIBUTE_DESIGNER_HOLIDAY_ID);vp.gallery.showAttributeGenericNotification(headerMessage,bodyMessage,oLink,-20);};vp.gallery.showFlat5x7HolidayDesignerCollection=function gallery_showFlat5x7HolidayDesignerCollection(sComboId)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var iComboSeq=GalleryData.Combos.getValue(sComboId).SequenceNumber;var headerMessage=GalleryData.LangMap.DesignerCollectionHeader;var bodyMessage=GalleryData.LangMap.Flat5x7DesignerCollectionBody;var oLink;oLink=document.getElementById("aAttributeLink_"+iComboSeq+"_"+vp.gallery.ATTRIBUTE_DESIGNER_FLAT5X7_HOLIDAY_ID);vp.gallery.showAttributeGenericNotification(headerMessage,bodyMessage,oLink,-20);};vp.gallery.showAttributeGenericNotification=function gallery_showAttributeGenericNotification(sHeader,sBody,oLink,iLeftOffset)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
if(!oLink)
{return false;}
var oContent=document.createElement("TABLE");var oRowHeader=oContent.insertRow(0);var oCellHeader=oRowHeader.insertCell(0);var oRowBody=oContent.insertRow(1);var oCellBody=oRowBody.insertCell(0);oCellHeader.className="attribute-notification-generic-header";oCellBody.className="attribute-notification-generic-body";oCellHeader.appendChild(document.createTextNode(sHeader));oCellBody.appendChild(document.createTextNode(sBody));var oNotification=vp.widget.showNotification(oContent,oLink,CALLOUT_BALLOON_ARROW_STYLE_ARROW_BELOW,iLeftOffset,null,370,vp.gallery.notificationTimeout*2);return false;};vp.gallery.showSceneDesigns=function gallery_showSceneDesigns(sComboId)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var oCombo=GalleryData.Combos.getValue(sComboId);vp.gallery.showMultiPreviewPop(vp.gallery.getCheckScenesPop(),sComboId,"aPreview"+oCombo.SequenceNumber+"0","tdPreviewArea",oCombo.PfId,GalleryData.Features.ProductGroupId,oCombo,2,"tblCheckScenesPreviews","backside-preview-container","divViewCheckScenesPlaceHolder");return false;};vp.gallery.hideCheckScenesPop=function gallery_hideCheckScenesPop(sComboId)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
document.getElementById("divViewCheckScenesPlaceHolder").style.display="block";var oTable=document.getElementById("tblCheckScenesPreviews");oTable.style.display="none";vp.ui.removeChildren(oTable);};vp.gallery.showAccentImage=function gallery_showAccentImage(sComboId)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var pop=vp.gallery.getCheckAccentImagePop();var oCombo=GalleryData.Combos.getValue(sComboId);var comboSeq=oCombo.SequenceNumber;var pfId=oCombo.PfId;var pgId=GalleryData.Features.ProductGroupId;var oPreviewRect=vp.ui.getRect(document.getElementById("aPreview"+comboSeq+"0"));var oOuterRect=vp.ui.getRect(document.getElementById("tdPreviewArea"));var oContainerRect=vp.ui.getRect(vp.ui.get(".page-content-inner-container"));pop.open();pop.resizeToFitContent(true);var oRequest=new vp.gallery.WebRequest();oRequest.addParameter("request_type",4);if(isNaN(sComboId))
{oRequest.addParameter("combo_hash",sComboId);}
else
{oRequest.addParameter("combo_id",sComboId);}
oRequest.addParameter("pf_id",pfId);oRequest.addParameter("pg",pgId);var fnErrorHandler=function pv_fnErrorHandler(oResponse)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
alert(GalleryData.LangMap.GenericErrorMessage);vp.gallery.hideCheckAccentImagePop();};var fnCallback=function pv_fnCallback(oResponse)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
if(oResponse.rc<0)
{fnErrorHandler(oResponse);return;}
var oInfo=oResponse.check_info;var property;var loadedImageCount=0;for(property in oResponse.check_info)
{loadedImageCount++;}
var fnImageLoadedHandler=function pv_fnImageLoadedHandler()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
loadedImageCount--;if(loadedImageCount<=0)
{pop.resizeToFitContent(true);}};for(property in oResponse.check_info)
{var oPreviewContainer=document.getElementById("divCheckPreview_"+property);var oAnchor=document.getElementById("aSelectCheckPreview_"+property);oAnchor.href=oResponse.check_info[property].EditUrl;vp.ui.removeChildren(oPreviewContainer);var oImg=document.createElement("IMG");vp.events.add(oImg,"load",fnImageLoadedHandler);oImg.src=oResponse.check_info[property].PreviewUrl;oPreviewContainer.appendChild(oImg);}};oRequest.callbackFunction=fnCallback;oRequest.errorHandlerFunction=fnErrorHandler;try
{oRequest.executeAsync();}
catch(e)
{fnErrorHandler(e);}
return false;};vp.gallery.hideCheckAccentImagePop=function gallery_hideCheckAccentImagePop()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
vp.ui.removeChildren(document.getElementById("divCheckPreview_Monograms"));vp.ui.removeChildren(document.getElementById("divCheckPreview_AccentImage"));};vp.gallery.showVariationsPop=function gallery_showVariationsPop(oCombo,sBaseUrl,sTrackName)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var width=GalleryData.Features.StandardPreviewImageSize.Width;var height=GalleryData.Features.StandardPreviewImageSize.Height;var aspectRatio=width/height;if(width>160)
{height=parseInt(160/aspectRatio);width=160;}
if(height>101)
{width=parseInt(aspectRatio*101);height=101;}
var sComboInfo;if(oCombo.ComboId<=0)
{sComboInfo="combo="+oCombo.ComboHash;}
else
{sComboInfo="combo_id="+oCombo.ComboId;}
var sUrl=sBaseUrl+"?pf_id={0}&{1}&width={2}&page=1&uei={3}&gallery=true&m_pf_id={4}";var oDialog=vp.dialog.IFrameDialog.open("backsidesGalleryPop",GalleryData.LangMap.BacksideGalleryTitle,sUrl.format(GalleryData.Features.PfId,sComboInfo,width,oCombo.UniqueEntityId,GalleryData.Features.MPfId),vp.dialog.chrome.Primary,500,640,{scrollType:DIALOG_SCROLL_TYPE_NO});vp.gallery.trackPop(sTrackName,oCombo);};vp.gallery.showLayoutVariations=function gallery_showLayoutVariations(sComboId)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var oCombo=GalleryData.Combos.getValue(sComboId);vp.gallery.showVariationsPop(oCombo,"/studio/combo-layout-selector.aspx","view_layoutvariations");};vp.gallery.showColorVariations=function gallery_showColorVariations(sComboId)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var oCombo=GalleryData.Combos.getValue(sComboId);if(GalleryData.Features.ProductGroupId=='39')
{vp.gallery.showMultiPreviewPop(vp.gallery.getColorVariationsPop(),sComboId,"aPreview"+oCombo.SequenceNumber+"0","tdPreviewArea",oCombo.PfId,GalleryData.Features.ProductGroupId,oCombo,3,"tblColorVariationsPreviews","color-variation-container","divViewColorVariationsPlaceHolder");}
else
{vp.gallery.showVariationsPop(oCombo,"/studio/color-variation-selector.aspx","view_colorvariations");}
return false;};vp.gallery.selectColorVariation=function gallery_selectColorVariation(iUeId,sEditUrl)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var oQueryString=new vp.web.QueryString();oQueryString.setItem("uei",iUeId);oQueryString.setItem("destURL",sEditUrl);vp.gallery.redirect("/gallery_proxy.aspx?"+oQueryString.toString());};vp.gallery.hideColorVariationsPop=function gallery_hideColorVariationsPop()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
document.getElementById("divViewColorVariationsPlaceHolder").style.display="block";var oTable=document.getElementById("tblColorVariationsPreviews");oTable.style.display="none";var oDiv=vp.ui.get("divViewColorVariationsContent");oDiv.style.width="200px";oDiv.parentNode.style.width="200px";oTable.style.width="200px";vp.ui.removeChildren(oTable);};vp.gallery.showThemePreview=function gallery_showThemePreview(sComboId)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var oCombo=GalleryData.Combos.getValue(sComboId);vp.gallery.showMultiPreviewPop(vp.gallery.getThemePreviewPop(),sComboId,"aPreview"+oCombo.SequenceNumber+"0","tdPreviewArea",oCombo.PfId,GalleryData.Features.ProductGroupId,oCombo,4,"tblThemePreviewPreviews","theme-preview-container","divViewThemePreviewPlaceHolder");return false;};vp.gallery.hideThemePreviewPop=function gallery_hideThemePreviewPop()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
document.getElementById("divViewThemePreviewPlaceHolder").style.display="block";var oTable=document.getElementById("tblThemePreviewPreviews");oTable.style.display="none";vp.ui.removeChildren(oTable);};vp.gallery.showFoilAccents=function gallery_showFoilAccents(sComboId)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var largerPreviewImage=document.getElementById("imgViewLargerPreview_0");var foilSrc=GalleryData.Combos.getValue(sComboId).ViewLargerFoilPreviewUrl;if(foilSrc!==null)
{largerPreviewImage.src=foilSrc;if(!vp.gallery.isFoilSelected()&&!vp.gallery.viewLargerIsFoilSelected)
{var viewLargerEditUrl=document.getElementById("aViewLargerPreview");viewLargerEditUrl=viewLargerEditUrl+escape("&"+GalleryData.Features.AddFoilToDocumentParam);document.getElementById("aViewLargerPreview").href=viewLargerEditUrl;document.getElementById("aViewLargerPreviewButton").href=viewLargerEditUrl;}
vp.gallery.viewLargerIsFoilSelected=true;}
else
{alert("No foil is available for this document");}};vp.gallery.isFoilSelected=function gallery_isFoilSelected()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var chkFoil=document.getElementById("chkFilter_"+vp.gallery.ATTRIBUTE_FOIL_ID);if(chkFoil)
{return chkFoil.checked;}
return false;};vp.gallery.showInsideLayouts=function gallery_showInsideLayouts(sComboId)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var oCombo=GalleryData.Combos.getValue(sComboId);var comboSeq=oCombo.SequenceNumber;var previewDiv="aPreview"+comboSeq+"0";var pfId=oCombo.PfId;var pgId=GalleryData.Features.ProductGroupId;var galleryDiv="tdPreviewArea";vp.gallery.showMultiPreviewPop(vp.gallery.getViewInsidesPop(),sComboId,previewDiv,galleryDiv,pfId,pgId,oCombo,5,"tblInsidesPreviews","inside-preview-container","divViewInsidesPlaceHolder");return false;};vp.gallery.showBacksidesVerbose=function gallery_showBacksidesVerbose(sComboId,previewDiv,galleryDiv,pfId,pgId,trackingCombo)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
vp.gallery.showMultiPreviewPop(vp.gallery.getViewBacksidesPop(),sComboId,previewDiv,galleryDiv,pfId,pgId,trackingCombo,1,"tblBacksidesPreviews","backside-preview-container","divViewBacksidesPlaceHolder");return false;};vp.gallery.showBacksides=function gallery_showBacksides(sComboId)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var oCombo=GalleryData.Combos.getValue(sComboId);if(oCombo.BacksideGalleryUrl)
{vp.gallery.showBacksidesGallery(sComboId);return false;}
var comboSeq=oCombo.SequenceNumber;var previewDiv="aPreview"+comboSeq+"0";var pfId=oCombo.PfId;var pgId=GalleryData.Features.ProductGroupId;var galleryDiv="tdPreviewArea";return vp.gallery.showBacksidesVerbose(sComboId,previewDiv,galleryDiv,pfId,pgId,oCombo);};function SelectBackside(sIcParts,sComboId,sUrl,sColor,iDocumentPage)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var fnExec=function pv_fnExec()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var oCombo=vp.gallery.SelectedBacksideCombo;var comboSeq=oCombo.SequenceNumber;var editUrl=document.getElementById("aPreview"+comboSeq+"0");var oURL=new vp.web.URL(editUrl);var sDestUrl=oURL.getItem("destURL");var oDestURL=new vp.web.URL(sDestUrl);oDestURL.removeItem("backside_combo_id");oDestURL.setItem("backside_combo_id",sComboId);oDestURL.removeItem("combo2");oDestURL.setItem("combo2",sIcParts);var iColorization=(sColor=="blank")?3:((sColor=="color")?1:2);oDestURL.removeItem("co");oDestURL.setItem("co",iColorization);oDestURL.removeItem("backsideFromAG");oDestURL.setItem("backsideFromAG",1);oURL.removeItem("destURL");oURL.setItem("destURL",oDestURL.toString());vp.gallery.redirect(oURL.toString());}.getClosure({icParts:sIcParts,comboID:sComboId,previewSrc:sUrl,color:sColor});window.setTimeout(fnExec,1);};vp.gallery.showBacksidesGallery=function gallery_showBacksidesGallery(sComboId)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var oCombo=GalleryData.Combos.getValue(sComboId);vp.gallery.SelectedBacksideCombo=oCombo;var oDialog=vp.dialog.IFrameDialog.open("backsidesGalleryPop",GalleryData.LangMap.BacksideGalleryTitle,oCombo.BacksideGalleryUrl+"&ag=true",vp.dialog.chrome.Primary,750,550,{scrollType:DIALOG_SCROLL_TYPE_BOTH});vp.gallery.trackPop("backsides_gallery",oCombo);oDialog.open();};vp.gallery.hideBackSidePop=function gallery_hideBackSidePop()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
document.getElementById("divViewBacksidesPlaceHolder").style.display="block";var oTable=document.getElementById("tblBacksidesPreviews");oTable.style.display="none";vp.ui.removeChildren(oTable);};vp.gallery.hideInsidesPop=function gallery_hideInsidesPop()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
document.getElementById("divViewInsidesPlaceHolder").style.display="block";var oTable=document.getElementById("tblInsidesPreviews");oTable.style.display="none";vp.ui.removeChildren(oTable);};vp.gallery.showMultiPreviewPop=function gallery_showMultiPreviewPop(oPop,sComboId,previewDiv,galleryDiv,pfId,pgId,trackingCombo,iPopType,sTableId,sCellClassName,sPlaceHolderId)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var oPreviewRect=vp.ui.getRect(document.getElementById(previewDiv));var oOuterRect=vp.ui.getRect(document.getElementById(galleryDiv));var oContainerRect=vp.ui.getRect(document.getElementById("divPageContentInner"));oPop.open();oPop.resizeToFitContent(true);var oRequest=new vp.gallery.WebRequest();var iRequestType;switch(iPopType)
{case 1:iRequestType=0;break;case 2:iRequestType=5;break;case 3:iRequestType=6;break;case 4:iRequestType=7;break;case 5:iRequestType=9;break;default:iRequestType=-1;break;}
oRequest.addParameter("request_type",iRequestType);if(isNaN(sComboId))
{oRequest.addParameter("combo_hash",sComboId);}
else
{oRequest.addParameter("combo_id",sComboId);}
oRequest.addParameter("pf_id",pfId);oRequest.addParameter("pg",pgId);var fnErrorHandler=function pv_fnErrorHandler(oResponse)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
alert(GalleryData.LangMap.GenericErrorMessage);oPop.close();};var fnCallback=function pv_fnCallback(oResponse)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
if(oResponse.rc<0)
{fnErrorHandler(oResponse);return;}
var fnFinalCallback=function pv_fnFinalCallback()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var oTable=document.getElementById(sTableId);if(oTable!==null&&oTable.rows.length>0)
{var iWidth=vp.ui.getRect(oTable.rows[0]).width+4;if(iWidth>0)
{oTable.style.width=iWidth+"px";}
oTable.parentNode.style.width=iWidth+"px";}
oPop.resizeToFitContent(true);};if(iRequestType==6)
{vp.gallery.populateTableWithActionablePreviews(oResponse.urls,oResponse.links,sTableId,sCellClassName,sPlaceHolderId,fnFinalCallback,3,true);}
else if(iRequestType==7)
{vp.gallery.populateTableWithActionablePreviews(oResponse.urls,oResponse.links,sTableId,sCellClassName,sPlaceHolderId,fnFinalCallback,1,false);}
else if(GalleryData.Features.ProductGroupId==74)
{vp.gallery.populateTableWithPreviews(oResponse.urls,sTableId,sCellClassName,sPlaceHolderId,fnFinalCallback,3);}
else
{vp.gallery.populateTableWithPreviews(oResponse.urls,sTableId,sCellClassName,sPlaceHolderId,fnFinalCallback,2);}
var trackingId;switch(iPopType)
{case 1:trackingId="backsides";break;case 2:trackingId="checkscenes";break;case 3:trackingId="colorvariations";break;case 4:trackingId="themepreview";break;case 5:trackingId="insides";break;default:trackingId="multipreview";break;}
if(trackingCombo!==null)
{vp.gallery.trackPop("view_"+trackingId,trackingCombo);}
else
{vp.gallery.trackAction("view_"+trackingId,null);}};oRequest.callbackFunction=fnCallback;oRequest.errorHandlerFunction=fnErrorHandler;try
{oRequest.executeAsync();}
catch(e)
{fnErrorHandler(e);}};vp.gallery.populateTableWithPreviews=function gallery_populateTableWithPreviews(oUrls,sTableId,sCellClassName,sPlaceHolderId,fnCallback,iRowLength)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var oCurrentRow=null;var oTable=document.getElementById(sTableId);var aImageLoaded=[];for(var i=0;i<oUrls.length;i++)
{aImageLoaded.push(false);if(i%iRowLength===0)
{oCurrentRow=oTable.insertRow(parseInt(i/iRowLength));}
var oCell=oCurrentRow.insertCell(i%iRowLength);oCell.className=sCellClassName;var oImage=document.createElement("IMG");var fnImageLoadedHandler=function pv_fnImageLoadedHandler()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
aImageLoaded[this.index]=true;var allLoaded=true;for(var j=0;j<oUrls.length;j++)
{allLoaded=allLoaded&&aImageLoaded[j];}
if(allLoaded)
{var oPlaceholder=document.getElementById(sPlaceHolderId);if(oPlaceholder)
{oPlaceholder.style.display="none";}
oTable.style.display="block";if(fnCallback)
{setTimeout(fnCallback,50);}}}.getClosure({index:i});vp.events.add(oImage,"load",fnImageLoadedHandler);oImage.src=oUrls[i];oCell.appendChild(oImage);}};vp.gallery.populateTableWithActionablePreviews=function gallery_populateTableWithActionablePreviews(oImgUrls,oLinkUrls,sTableId,sCellClassName,sPlaceHolderId,fnCallback,iRowLength,bHover)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var oCurrentRow=null;var oTable=vp.ui.get(sTableId);var aImageLoaded=[];if(iRowLength<1)
{iRowLength=2;}
for(var i=0;i<oImgUrls.length;i++)
{aImageLoaded.push(false);if(i%iRowLength===0)
{oCurrentRow=oTable.insertRow(parseInt(i/iRowLength));}
var oCell=oCurrentRow.insertCell(i%iRowLength);oCell.className=sCellClassName;var oLink=document.createElement("A");var oImage=document.createElement("IMG");if(bHover)
{vp.gallery.addIE6HoverBehavior(oCell,"color-variation-hover");}
var fnImageLoadedHandler=function pv_fnImageLoadedHandler()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
aImageLoaded[this.index]=true;var allLoaded=true;for(var j=0;j<oImgUrls.length;j++)
{allLoaded=allLoaded&&aImageLoaded[j];}
if(allLoaded)
{var oPlaceholder=document.getElementById(sPlaceHolderId);if(oPlaceholder)
{oPlaceholder.style.display="none";}
oTable.style.display="block";if(fnCallback)
{fnCallback();}}}.getClosure({index:i});oLink.appendChild(oImage);oCell.appendChild(oLink);vp.events.add(oImage,"load",fnImageLoadedHandler);oImage.src=oImgUrls[i];oLink.href=oLinkUrls[i];}};vp.gallery.setPreviewOverlay=function gallery_setPreviewOverlay(topImg,bottomImg,sCombo,sValue)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var topElt=document.getElementById(topImg);var bottomElt=document.getElementById(bottomImg);if(topElt.style.zIndex==2&&bottomElt.style.zIndex==1)
{return;}
topElt.style.zIndex=2;bottomElt.style.zIndex=1;var oCombo=GalleryData.Combos.getValue(sCombo);var aAdditionalParameters=[];aAdditionalParameters.push({name:"unique_entity_id",value:oCombo.UEI});aAdditionalParameters.push({name:"toggle_value",value:sValue});vp.gallery.trackAction("ag_toggle",aAdditionalParameters);};vp.gallery.changeColor=function gallery_changeColor(iColorId,sCombo)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var oCombo=GalleryData.Combos.getValue(sCombo);if(oCombo==undefined)
{return;}
var iSequenceNum=oCombo.SequenceNumber;var urlNewUrl=null;var aStandardPreviewUrls=oCombo.ViewStandardPreviewUrls[iColorId];for(var i=0;i<aStandardPreviewUrls.length;i++)
{var previewAnchorElement=vp.ui.get("aPreview"+iSequenceNum+i);if(previewAnchorElement!=undefined)
{if(urlNewUrl===null)
{var urlParentUrl=new vp.web.URL(previewAnchorElement.href);var urlChildUrl=new vp.web.URL(vp.web.urlDecode(urlParentUrl.getItem("destURL")));if(GalleryData.Features.ProductGroupName.toString().indexOf("Stamp")>0)
{urlChildUrl.removeItem("ink_pad_color");urlChildUrl.setItem("ink_pad_color",iColorId);}
else
{urlChildUrl.removeItem("ssc");urlChildUrl.setItem("ssc",iColorId);}
urlParentUrl.setItem("destURL",urlChildUrl.toString());urlNewUrl=urlParentUrl.toString();}
previewAnchorElement.href=urlNewUrl;}
var previewImgElement=vp.ui.get("imgPreview"+iSequenceNum+i);if(previewImgElement!=undefined)
{previewImgElement.src=aStandardPreviewUrls[i];}}
var buttonAnchorElement=vp.ui.get("aPreviewItemButton_"+iSequenceNum);if(buttonAnchorElement!=undefined)
{buttonAnchorElement.href=urlNewUrl;}
oCombo.ViewLargerPreviewUrl=oCombo.ViewLargerPreviewUrls[iColorId][0];};vp.gallery.changeShape=function gallery_changeShape(sBaseComboId,sComboId)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var oCombo=GalleryData.Combos.getValue(sBaseComboId);var comboSeq=oCombo.SequenceNumber;var oStandardImage=vp.ui.get("imgPreview"+comboSeq+"0");oStandardImage.src=oCombo.StandardShapeImageUrls[sComboId];oCombo.ViewLargerPreviewUrl=oCombo.LargeShapeImageUrls[sComboId];var oImageLink=vp.ui.get("aPreview"+comboSeq+"0");oImageLink.href=oCombo.ShapeLinkUrls[sComboId];var oButtonLink=vp.ui.get("aPreviewItemButton_"+comboSeq);oButtonLink.href=oCombo.ShapeLinkUrls[sComboId];if(oCombo.ShapeIsVertical)
{var oImgContainer=vp.ui.get("aPreview"+comboSeq+"0");if(sComboId==sBaseComboId)
{oStandardImage.style.height="225px";oStandardImage.style.width="150px";oImgContainer.parentNode.style.borderTopWidth="0px";oImgContainer.parentNode.style.borderBottomWidth="1px";}
else
{oStandardImage.style.width="225px";oStandardImage.style.height="150px";if(vp.ui.get("divPreviewContainer_"+comboSeq).getElementsByTagName("script").length===0)
{oImgContainer.parentNode.style.borderTopWidth="38px";oImgContainer.parentNode.style.borderBottomWidth="38px";}}}
for(var i=1;i<=4;i++)
{var oShapeCell=vp.ui.get("tdShape_"+comboSeq+i);if(oShapeCell)
{oShapeCell.className=oShapeCell.className.replace(" shape-swatch-selected","");}}};vp.gallery.hoverShape=function gallery_hoverShape(oShapeCell,bEnabled)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var sClassName=oShapeCell.className;if(bEnabled)
{oShapeCell.className=sClassName.replace(/^shape-swatch/g,"shape-swatch-hover");}
else
{oShapeCell.className=sClassName.replace(/^shape-swatch-hover/g,"shape-swatch");}};vp.gallery.showViewLargerPop=function gallery_showViewLargerPop(sComboId)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
if(GalleryData.Features.KitId)
{return vp.gallery.showKitViewLarger(sComboId);}
var oViewLargerPop=vp.ui.get("tblViewLargerPop");if(oViewLargerPop)
{oViewLargerPop.style.display="block";}
var lgPop=vp.gallery.getViewLargerPop();lgPop.open();vp.gallery.viewLargerIsFoilSelected=false;vp.gallery.viewLargerComboId=sComboId;var oCombo=GalleryData.Combos.getValue(sComboId);var comboSeq=oCombo.SequenceNumber;var editUrl=document.getElementById("aPreview"+comboSeq+"0");var largerPreviewImage=document.getElementById("divViewLargerPreview");var largerPreviewImageWait=document.getElementById("imgViewLargerPreviewWait");var viewLargerShown=false;var oThreeDPreview=vp.ui.get("trThreeDPreview");if(largerPreviewImageWait===null||largerPreviewImage===null)
{return false;}
largerPreviewImageWait.style.visibility="visible";largerPreviewImage.style.visibility="hidden";var aLargePreviewUrls=[];if(typeof oCombo.ViewLargerPreviewUrl=="string")
{aLargePreviewUrls[0]=oCombo.ViewLargerPreviewUrl;}
else
{aLargePreviewUrls=oCombo.ViewLargerPreviewUrl;}
var fnSwitchImages=function pv_fnSwitchImages()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
if(viewLargerShown&&!lgPop.isVisible())
{return;}
largerPreviewImageWait.style.visibility="hidden";largerPreviewImage.style.visibility="visible";if(oThreeDPreview!==null)
{oThreeDPreview.style.visibility="visible";}
var oPop=vp.ui.get("divViewLargerPreview");var oRectPreview=vp.ui.getRect(vp.ui.get("imgViewLargerPreview_0"));oPop.style.height=oRectPreview.height+"px";oPop.style.width=oRectPreview.width+"px";};var numImages=aLargePreviewUrls.length;var fnLoadAllImages=function pv_fnLoadAllImages()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
numImages--;if(numImages===0)
{fnSwitchImages();numImages=aLargePreviewUrls.length;var largerPreviewImageNode=document.getElementById("tblViewLargerPop");largerPreviewImageNode.style.width=vp.ui.getRect(document.getElementById("tdViewLargerPreview")).width+"px";lgPop.resizeToFitContent(true);}};for(var i=aLargePreviewUrls.length-1;i>=0;i--)
{var previewImage=null;if(document.getElementById("imgViewLargerPreview_"+i)!==null)
{previewImage=document.getElementById("imgViewLargerPreview_"+i);}
else
{if(oThreeDPreview!==null&&i==1)
{previewImage=document.getElementById("studioMiniPreviewImage");var oRotateUp=vp.ui.get("rotate3DUp");var oRotateDown=vp.ui.get("rotate3DDown");var oTempCombo=GalleryData.Combos.getValue(sComboId);if(oRotateUp)
{oRotateUp.onclick=function()
{vp.gallery.threeDPreview.AGroll(-1,sComboId,oTempCombo.ComboHash,GalleryData.Features.PfId,GalleryData.Features.ProductGroupId,oTempCombo.ViewPopPreviewUrls);};}
if(oRotateDown)
{oRotateDown.onclick=function()
{vp.gallery.threeDPreview.AGroll(1,sComboId,oTempCombo.ComboHash,GalleryData.Features.PfId,GalleryData.Features.ProductGroupId,oTempCombo.ViewPopPreviewUrls);};}
vp.events.remove(previewImage,"load",fnLoadAllImages);}
else
{previewImage=document.getElementById("aViewLargerPreview").appendChild(document.createElement("img"));previewImage.id="imgViewLargerPreview_"+i;}
vp.events.add(previewImage,"load",fnLoadAllImages);}
previewImage.src=aLargePreviewUrls[i];previewImage.alt=sComboId;previewImage.title=sComboId;}
var oViewLargerToggle=vp.ui.get("divViewLargerToggle");if(oViewLargerToggle)
{vp.gallery.toggleViewLargerImage(0,oCombo,false);}
largerPreviewImage.alt=sComboId;var viewLargerEditUrl=editUrl.toString();var oItemAttributes=oCombo.Attributes;for(var j=0;j<oItemAttributes.length;j++)
{var attributeId=oItemAttributes[j].name;var attributeValue=oItemAttributes[j].value.toLowerCase();var oAttributeCell=document.getElementById("tblViewLarger_"+attributeId);if(oAttributeCell)
{if(attributeValue==="true")
{oAttributeCell.style.display="block";}
else
{oAttributeCell.style.display="none";}}}
var viewLargerEditUrlImage=null;var viewLargerEditUrlButton=null;var bUsesProxy=viewLargerEditUrl.indexOf(GalleryData.Features.ViewLargerProperties.GalleryProxyURL)>=0;if(bUsesProxy)
{var sRedirectParam="&"+GalleryData.Features.ViewLargerProperties.GalleryProxyRedirectParam+"=";var oSplit=viewLargerEditUrl.split(sRedirectParam);viewLargerEditUrl=unescape(oSplit[1]);viewLargerEditUrlImage=viewLargerEditUrl.replace(GalleryData.Features.ViewLargerProperties.ParamsToRemove,GalleryData.Features.ViewLargerProperties.ParamsToAdd);viewLargerEditUrlButton=viewLargerEditUrlImage+"&"+GalleryData.Features.ViewLargerProperties.ButtonClick;;viewLargerEditUrlImage=oSplit[0]+sRedirectParam+escape(viewLargerEditUrlImage);viewLargerEditUrlButton=oSplit[0]+sRedirectParam+escape(viewLargerEditUrlButton);}
else
{viewLargerEditUrlImage=viewLargerEditUrl.replace(GalleryData.Features.ViewLargerProperties.ParamsToRemove,GalleryData.Features.ViewLargerProperties.ParamsToAdd);viewLargerEditUrlButton=viewLargerEditUrlImage+"&"+GalleryData.Features.ViewLargerProperties.ButtonClick;;}
document.getElementById("aViewLargerPreview").href=viewLargerEditUrlImage;document.getElementById("aViewLargerPreviewButton").href=viewLargerEditUrlButton;var oRectImg=vp.ui.getRect(largerPreviewImageWait);var oPreviewRect=vp.ui.getRect(document.getElementById("aPreview"+comboSeq+"0"));var oContainerRect=vp.ui.getRect(document.getElementById("divPageContentInner"));viewLargerShown=true;vp.gallery.trackPop("view_larger",oCombo);return false;};vp.gallery.hideViewLargerPop=function gallery_hideViewLargerPop()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var oThreeDPreview=vp.ui.get("trThreeDPreview");if(oThreeDPreview!==null)
{document.getElementById("studioMiniPreviewImage").src="/vp/images/s.gif";oThreeDPreview.style.visibility="hidden";if(vp.gallery.threeDPreview.penIndex!==null)
{vp.gallery.threeDPreview.penIndex=null;}}
var largerPreviewImage=document.getElementById("divViewLargerPreview");var largerPreviewImageWait=document.getElementById("imgViewLargerPreviewWait");largerPreviewImage.style.visibility="hidden";largerPreviewImageWait.style.visibility="hidden";var oViewLargerPop=vp.ui.get("tblViewLargerPop");if(oViewLargerPop)
{oViewLargerPop.style.display="none";setTimeout("try{vp.ui.get('tblViewLargerPop').style.display = 'none';}catch(e){}",100);}};vp.gallery.preSizeViewLargerPop=function gallery_preSizeViewLargerPop()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var largerPreviewImage=document.getElementById("divViewLargerPreview");largerPreviewImage.style.width=GalleryData.Features.LargerPreviewImage.width+"px";largerPreviewImage.style.height=GalleryData.Features.LargerPreviewImage.height+"px";var largerPreviewImageWait=document.getElementById("imgViewLargerPreviewWait");var oRectImg=vp.ui.getRect(largerPreviewImageWait);var oRectPop=vp.ui.getRect(document.getElementById("tblViewLargerPop"));largerPreviewImageWait.style.left=((oRectPop.width-oRectImg.width)/2)+"px";largerPreviewImageWait.style.top=((oRectPop.height-oRectImg.height)/2)+"px";var oThreeDPreview=vp.ui.get("trThreeDPreview");if(oThreeDPreview!==null)
{document.getElementById("studioMiniPreviewImage").src="/vp/images/s.gif";}
vp.gallery.getViewLargerPop().resizeToFitContent(true);};vp.gallery.toggleViewLargerImage=function gallery_toggleViewLargerImage(bShowBack,oCombo,bLog)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
if(bLog)
{var aAdditionalParameters=[];aAdditionalParameters.push({name:"unique_entity_id",value:oCombo.UEI});aAdditionalParameters.push({name:"toggle_value",value:bShowBack?"back":"front"});vp.gallery.trackAction("ag_large_toggle",aAdditionalParameters);}
var frontImageUrl=oCombo.ViewLargerPreviewUrl;var backsideImageUrl=oCombo.ViewLargerBacksidePreviewUrl;var oLargerImage=vp.ui.get("imgViewLargerPreview_0");var oToggleFrontLink=vp.ui.get("aViewLargerToggleFront");var oToggleBackLink=vp.ui.get("aViewLargerToggleBack");if(!frontImageUrl||!backsideImageUrl||!oLargerImage||!oToggleFrontLink||!oToggleBackLink)
{var oViewLargerToggle=vp.ui.get("divViewLargerToggle");oViewLargerToggle.style.display="none";return;}
if(bShowBack)
{oToggleBackLink.onclick=function(){return false;};oToggleBackLink.style.cursor="default";oToggleBackLink.style.textDecoration="none";oToggleBackLink.className="view-larger-toggle-text";oToggleFrontLink.onclick=function(){vp.gallery.toggleViewLargerImage(0,oCombo,true);return false;};vp.ui.setStyleValue(oToggleFrontLink,"cursor","pointer");oToggleFrontLink.className="view-larger-toggle-highlight-text";oToggleFrontLink.style.textDecoration="underline";oLargerImage.src=backsideImageUrl;}
else
{oToggleFrontLink.onclick=function(){return false;};oToggleFrontLink.style.cursor="default";oToggleFrontLink.style.textDecoration="none";oToggleFrontLink.className="view-larger-toggle-text";oToggleBackLink.onclick=function(){vp.gallery.toggleViewLargerImage(1,oCombo,true);return false;};vp.ui.setStyleValue(oToggleBackLink,"cursor","pointer");oToggleBackLink.className="view-larger-toggle-highlight-text";oToggleBackLink.style.textDecoration="underline";oLargerImage.src=frontImageUrl;}};vp.gallery.selectCategory=function gallery_selectCategory(sCatListId,sRootId)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
vp.gallery.hideCategoryPop();var oCatList=vp.ui.get(sCatListId);var sUrl=oCatList.options[oCatList.selectedIndex].value;window.parent.location.href=sUrl;};vp.gallery.setSelectElementsVisibility=function gallery_setSelectElementsVisibility(bVisible)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var divPageOuter=vp.ui.get(".page-outer-container");var cSelects=divPageOuter?divPageOuter.getElementsByTagName("select"):document.getElementsByTagName("select");for(var i=0;i<cSelects.length;i++)
{if(bVisible)
{vp.ui.show(cSelects[i]);}
else
{vp.ui.hide(cSelects[i]);}}};vp.gallery.showCategoryPop=function gallery_showCategoryPop()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var oPop=vp.gallery.getCategoryPop();oPop.open();oPop.resizeToFitContent(true);if(vp.gallery.isIE6())
{vp.gallery.setSelectElementsVisibility(false);}
var aAdditionalParameters=[];aAdditionalParameters.push({name:"pop_type",value:"category_pop"});vp.gallery.trackAction("ag_pop",aAdditionalParameters);};vp.gallery.hideCategoryPop=function gallery_hideCategoryPop(e)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
if(vp.gallery.isIE6())
{vp.gallery.setSelectElementsVisibility(true);}
vp.gallery.setCategoryPopCookie();var oTypeAheadMenu=vp.gallery.typeAhead.menus["txtSearchPop"];if(oTypeAheadMenu)
{oTypeAheadMenu.hide();}
if(e&&e.isCancelButton)
{vp.gallery.trackPopClose("category_pop");}};vp.gallery.setCategoryPopCookie=function gallery_setCategoryPopCookie()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
vp.cookies.setSubValue("SITE","gcp","0");vp.cookies.setSubValue("SITE","scigp","217");};vp.gallery.checkPopStatus=function gallery_checkPopStatus()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var cookieVal=vp.cookies.getSubValue("SITE","gcp");if(cookieVal!==null&&cookieVal==="0")
{vp.hoverpop.hide("divHoverPopUp");}};vp.gallery.arrangeIE6Layout=function gallery_arrangeIE6Layout()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
if(vp.browser.isIE&&vp.browser.ver==6)
{var fnStopSize=function pv_fnStopSize(e)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
if(document.documentElement.clientWidth<800)
{document.body.style.width="800px";}
else
{if(document.body.style.width!="100%")
{document.body.style.width="100%";}}};vp.events.add(window,"resize",fnStopSize);}
if(vp.browser.isIE)
{var fnResizePreviews=function pv_fnResizePreviews(e)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var iWidth=parseInt(GalleryData.Features.PreviewAreaWidth);var oContainer=document.getElementById("tblGalleryContentInner");if(!oContainer||isNaN(iWidth)||iWidth<=0)
{return;}
var oRect=vp.ui.getRect(oContainer);var newWidth=iWidth-10;var iAdjustOffset=0;var oLeftContent=document.getElementById("tdHybridRefinementArea");if(oLeftContent)
{iAdjustOffset=vp.ui.getRect(oLeftContent).width;}
if(document.documentElement.clientWidth>iWidth+iAdjustOffset+50)
{newWidth=iWidth+10;}
else if(document.documentElement.clientWidth>=800||(GalleryData.Features.ForceMinWidth=="false"))
{newWidth=document.documentElement.clientWidth-10-iAdjustOffset;}
else
{newWidth=800-10-iAdjustOffset;}
newWidth-=20;if(newWidth<0)
{newWidth=600;}
var oAbovePreviews=document.getElementById("tblFiltersAbovePreviewsContainer");if(oAbovePreviews)
{oAbovePreviews.style.width=newWidth+"px";}
document.getElementById("divResultCount").style.width=newWidth+"px";if(document.getElementById("divTopCategoryName"))
{document.getElementById("divTopCategoryName").style.width=newWidth+"px";}
document.getElementById("divPreviewArea").style.width=newWidth+10+"px";document.getElementById("divPagingAndSorting").style.width=newWidth+"px";var oTransparency=vp.ui.get("divTransparencyMessage");if(oTransparency)
{oTransparency.style.width=newWidth+"px";}};vp.events.add(window,"resize",fnResizePreviews);fnResizePreviews(null);}};vp.gallery.enableBookmarks=function gallery_enableBookmarks()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
vp.gallery.bookmarkEnableAttempts++;var oElement=document.getElementById("tblBooleanFilter_"+vp.gallery.ATTRIBUTE_BOOKMARK_ID);if(!oElement)
{return;}
var oCheckBox=document.getElementById("chkFilter_"+vp.gallery.ATTRIBUTE_BOOKMARK_ID);if(!oElement&&vp.gallery.bookmarkEnableAttempts<=vp.gallery.bookmarkEnableMaxAttempts)
{setTimeout(vp.gallery.enableBookmarks,vp.gallery.bookmarkEnableAttempts*500);return;}
if(GalleryData.Features.UserHasBookmarks.toLowerCase()=="false")
{if(oElement.className.indexOf(" disabled")<0)
{oElement.className=oElement.className+" disabled";}
oCheckBox.disabled=true;}
else
{oElement.className=oElement.className.replace(" disabled","");oCheckBox.disabled=false;}
vp.gallery.bookmarkEnableAttempts=0;};vp.gallery.performInitialLayout=function gallery_performInitialLayout(bIsDev)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
setTimeout(vp.gallery.resizePreviewContainers,500);setTimeout(vp.gallery.enableBookmarks,500);var fnShowSearchTip=function pv_fnShowSearchTip()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
if(GalleryData.Features.ShowSearchCallout=="true")
{vp.gallery.showSearchTextBoxNotification(GalleryData.LangMap.SearchCalloutMessage,vp.gallery.initialCalloutTimeout);}};setTimeout(fnShowSearchTip,vp.gallery.initialCalloutTimeout);};vp.gallery.showSearchTextBoxNotification=function gallery_showSearchTextBoxNotification(sMessage,iHideTimeout)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var oNotification=vp.widget.showNotification(sMessage,document.getElementById("txtSearch"),CALLOUT_BALLOON_ARROW_STYLE_ARROW_TOP,145,null,265,iHideTimeout,vp.gallery.notifications[vp.gallery.NOTIFICATION_SEARCH_BOX_ID]);oNotification.requiresIFrame=true;vp.gallery.notifications[vp.gallery.NOTIFICATION_SEARCH_BOX_ID]=oNotification.id;};vp.gallery.showBookmarkInfoNotification=function gallery_showBookmarkInfoNotification(sMessageForCheckbox,sMessageForLink,sComboId)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var hasCheckBoxMessage=sMessageForCheckbox&&sMessageForCheckbox!==null;var hasLinkMessage=sMessageForLink&&sMessageForLink!==null&&sComboId&&sComboId!==null;var showCheckMessage=hasCheckBoxMessage;var oBmk;if(hasCheckBoxMessage)
{oBmk=document.getElementById("tblBooleanFilter_"+vp.gallery.ATTRIBUTE_BOOKMARK_ID);if(!oBmk)
{showCheckMessage=false;}
else
{var oBmkRect=vp.ui.getRect(oBmk);if(vp.ui.getScrollOffset().top>oBmkRect.top+oBmkRect.height)
{showCheckMessage=!hasLinkMessage;}
if(showCheckMessage)
{var oNotification=vp.widget.showNotification(sMessageForCheckbox,oBmk,CALLOUT_BALLOON_ARROW_STYLE_ARROW_TOP,null,null,null,vp.gallery.notificationTimeout,vp.gallery.notifications[vp.gallery.NOTIFICATION_BOOKMARK_BOX_ID]);vp.gallery.notifications[vp.gallery.NOTIFICATION_BOOKMARK_BOX_ID]=oNotification.id;}}}
if(hasLinkMessage&&!showCheckMessage)
{var iComboSeq=GalleryData.Combos.getValue(sComboId).SequenceNumber;oBmk=document.getElementById("aAttributeLink_"+iComboSeq+"_"+vp.gallery.ATTRIBUTE_BOOKMARK_ID);if(!oBmk)
{return false;}
vp.widget.showNotification(sMessageForLink,oBmk,CALLOUT_BALLOON_ARROW_STYLE_ARROW_TOP,null,null,null,vp.gallery.notificationTimeout);}
return false;};vp.gallery.removePreview=function gallery_removePreview(iComboSeq)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var oElement=document.getElementById("divPreviewContainer_"+iComboSeq);if(!oElement)
{return false;}
if(oElement.parentElement)
{oElement.parentElement.removeChild(oElement);}
else if(oElement.parentNode)
{oElement.parentNode.removeChild(oElement);}
GalleryData.Features.PreviewCount=parseInt(GalleryData.Features.PreviewCount)-1;GalleryData.Features.LastVisibleItem=parseInt(GalleryData.Features.LastVisibleItem)-1;if(GalleryData.Features.PreviewCount===0)
{vp.gallery.redirect(GalleryData.Features.StartOverUrl);}
else if(GalleryData.Features.ResultCountSummary)
{var newText=GalleryData.Features.ResultCountSummary;newText=newText.format(GalleryData.Features.LastVisibleItem,GalleryData.Features.PreviewCount);if(document.getElementById("divResultCount"))
{document.getElementById("divResultCount").innerHTML=newText;}}
return false;};vp.gallery.trackPop=function gallery_trackPop(sPopType,oCombo)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var aAdditionalParameters=[];aAdditionalParameters.push({name:"unique_entity_id",value:oCombo.UEI});aAdditionalParameters.push({name:"pop_type",value:sPopType});vp.gallery.trackAction("ag_pop",aAdditionalParameters);};vp.gallery.trackPopClose=function gallery_trackPopClose(sPopType)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var aAdditionalParameters=[];aAdditionalParameters.push({name:"pop_type",value:sPopType});vp.gallery.trackAction("ag_pop_close",aAdditionalParameters);};vp.gallery.trackBookmark=function gallery_trackBookmark(sActionType,oCombo)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var aAdditionalParameters=[];aAdditionalParameters.push({name:"unique_entity_id",value:oCombo.UEI});aAdditionalParameters.push({name:"action_type",value:sActionType});vp.gallery.trackAction("ag_bookmark",aAdditionalParameters);};vp.gallery.showSearchTips=function gallery_showSearchTips()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
GalleryData.Features.ShowSearchCallout="false";var oNotification=vp.widget.showNotification(GalleryData.LangMap.SearchTipMessage,document.getElementById("aSearchTips"),CALLOUT_BALLOON_ARROW_STYLE_ARROW_TOP,0,null,265,0,vp.gallery.notifications[vp.gallery.NOTIFICATION_SEARCH_TIPS_ID],true);vp.gallery.notifications[vp.gallery.NOTIFICATION_SEARCH_TIPS_ID]=oNotification.id;};vp.gallery.showDisabledRefinementInformation=function gallery_showDisabledRefinementInformation(oElement)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var oRect=vp.ui.getRect(oElement);var oNotification=vp.widget.showNotification(GalleryData.LangMap.DisabledRootClick,oElement,CALLOUT_BALLOON_ARROW_STYLE_ARROW_TOP,oRect.width/3,0,320,15000,vp.gallery.notifications[vp.gallery.NOTIFICATION_INACTIVE_ROOTS_ID]);vp.gallery.notifications[vp.gallery.NOTIFICATION_INACTIVE_ROOTS_ID]=oNotification.id;};vp.gallery.seeAllLinkCount=0;vp.gallery.createSeeAllLink=function gallery_createSeeAllLink(oRootInfo)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var oMenu=document.createElement("DIV");oMenu.className="top-refinement-list-item";var oLink=document.createElement("A");oLink.appendChild(document.createTextNode(oRootInfo.SeeAllDesignsLink.Caption));oLink.href=oRootInfo.SeeAllDesignsLink.URL;oLink.id="aGuidedNav_SEE_ALL_"+vp.gallery.seeAllLinkCount;vp.gallery.seeAllLinkCount++;oMenu.appendChild(oLink);return oMenu;};vp.gallery.selectRootCategory=function gallery_selectRootCategory(iRootId)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var oRootInfo=GalleryData.RootInformation.getValue(iRootId);if(oRootInfo===null)
{return;}
vp.gallery.redirect(oRootInfo.SeeAllDesignsLink.URL);};vp.gallery.toggleRefinementMenuVisibility=function gallery_toggleRefinementMenuVisibility(iRootId)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
if(iRootId==vp.gallery.topListVisibleRoot)
{vp.gallery.hideRefinementMenu();return;}
else if(vp.gallery.topListVisibleRoot>=0)
{vp.gallery.hideRefinementMenu();}
vp.gallery.showRefinementMenu(iRootId);};vp.gallery.showRefinementMenu=function gallery_showRefinementMenu(iRootId,bCloseOnClick)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
if(typeof(bCloseOnClick)=="undefined")
{bCloseOnClick=true;}
var oRefinementList=GalleryData.VisibleRefinements.getValue(iRootId);if(!oRefinementList)
{return;}
if(vp.gallery.topListVisibleRoot>0)
{var oOldMenuHeader=vp.ui.get("divTopRefinementRoot_{0}".format(vp.gallery.topListVisibleRoot));if(oOldMenuHeader&&oOldMenuHeader.className.indexOf("top-refinement-root-ia")!=-1&&(!GalleryData.Features.SelectedRoot||vp.gallery.topListVisibleRoot!=GalleryData.Features.SelectedRoot))
{oOldMenuHeader.className=oOldMenuHeader.className.replace(/\s*top-refinement-root-text-menu-hover/g,"");}}
var oMenuHeader=vp.ui.get("divTopRefinementRoot_{0}".format(iRootId));if(oMenuHeader&&oMenuHeader.className.indexOf("top-refinement-root-ia")!=-1)
{oMenuHeader.className+=" top-refinement-root-text-menu-hover";}
var oRootInfo=GalleryData.RootInformation.getValue(iRootId);var aRenderedList=vp.gallery.topListRendered[iRootId];if(!aRenderedList)
{aRenderedList=vp.gallery.generateRenderedRefinementMenuList(oRefinementList);var oSelectAllElement=vp.gallery.createSeeAllMenuItem(oRootInfo);if(oSelectAllElement)
{aRenderedList.push(oSelectAllElement);}
if(oRootInfo.ExtraCallout)
{var oExtraCalloutElement=vp.gallery.createExtraCalloutMenuItem(oRootInfo.ExtraCallout);if(oExtraCalloutElement)
{aRenderedList.unshift(oExtraCalloutElement);}}
vp.gallery.topListRendered[iRootId]=aRenderedList;}
var oMenu=vp.gallery.getTopRefinementMenuContainer();vp.ui.removeChildren(oMenu);for(var i=0;i<aRenderedList.length;i++)
{oMenu.appendChild(aRenderedList[i]);}
var oSourceRect=vp.ui.getRect(document.getElementById("divTopRefinementRoot_"+iRootId));var oContainerRect=vp.ui.getRect(document.getElementById("divPageContentInner"));oMenu.style.left=(oSourceRect.left-oContainerRect.left-1)+"px";oMenu.style.top=(oSourceRect.top+oSourceRect.height-1)+"px";oMenu.style.height="auto";oMenu.style.display="block";var oRect=vp.ui.getRect(oMenu);var iMenuBottomY=oRect.top+oRect.height;var iPageBottom=vp.ui.getScrollOffset().top+vp.ui.getViewportSize().height-5;if(iMenuBottomY>iPageBottom)
{oMenu.style.height=Math.max(100,iPageBottom-oRect.top)+"px";oMenu.style.overflowY="scroll";}
else
{oMenu.style.overflowY="visible";}
vp.gallery.topListVisibleRoot=iRootId;if(bCloseOnClick)
{vp.events.add(vp.ui.getRootElement(),"mousedown",vp.gallery.hideRefinementMenu);}
if(vp.gallery.isIE6())
{vp.ui.showIE6IFrame(vp.gallery.refinementMenu,true);}};vp.gallery.hideRefinementMenu=function gallery_hideRefinementMenu()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
if(!vp.gallery.refinementMenu)
{return;}
vp.ui.removeChildren(vp.gallery.refinementMenu);vp.gallery.refinementMenu.style.display="none";vp.events.remove(vp.ui.getRootElement(),"mousedown",vp.gallery.hideRefinementMenu);var oMenuHeader=vp.ui.get("divTopRefinementRoot_{0}".format(vp.gallery.topListVisibleRoot));if(oMenuHeader&&oMenuHeader.className.indexOf("top-refinement-root-ia")!=-1&&(!GalleryData.Features.SelectedRoot||vp.gallery.topListVisibleRoot!=GalleryData.Features.SelectedRoot))
{oMenuHeader.className=oMenuHeader.className.replace(/\s*top-refinement-root-text-menu-hover/g,"");}
vp.gallery.topListVisibleRoot=-1;if(vp.gallery.isIE6())
{vp.ui.showIE6IFrame(vp.gallery.refinementMenu,false);}};vp.gallery.refinementMenuShowDelay=100;vp.gallery.refinementMenuIdToShow=-1;vp.gallery.refinementMenuIdToHide=-1;vp.gallery.showRefinementMenuDelayed=function gallery_showRefinementMenuDelayed(iRootId)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
if(vp.gallery.cancelEvents||vp.gallery.refinementMenuIdToShow==iRootId)
{return;}
vp.gallery.refinementMenuIdToShow=iRootId;var fnTimeout=function pv_fnTimeout(e)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
if(vp.gallery.cancelEvents)
{return;}
vp.gallery.showRefinementMenu(iRootId,false);vp.events.add(vp.ui.getRootElement(),'mousemove',vp.gallery.hideRefinementMenuDelayed);};setTimeout(fnTimeout,vp.gallery.refinementMenuShowDelay);};vp.gallery.hideRefinementMenuDelayed=function gallery_hideRefinementMenuDelayed()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
if(vp.gallery.topListVisibleRoot<0)
{return;}
var fnTimeout=function pv_fnTimeout(e)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
if(vp.gallery.cancelEvents)
{}
if(vp.gallery.refinementMenuIdToHide<0)
{vp.gallery.refinementMenuIdToShow=-1;return;}
vp.gallery.hideRefinementMenu();vp.events.remove(vp.ui.getRootElement(),"mousemove",vp.gallery.hideRefinementMenuDelayed);vp.gallery.refinementMenuIdToHide=-1;vp.gallery.refinementMenuIdToShow=-1;};vp.gallery.refinementMenuIdToHide=vp.gallery.topListVisibleRoot;setTimeout(fnTimeout,vp.gallery.refinementMenuShowDelay);};vp.gallery.refinementMenuMouseOver=function gallery_refinementMenuMouseOver(e)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
vp.events.cancelBubble(e);};vp.gallery.positionHybridRefinementArea=function gallery_positionHybridRefinementArea()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var iScrollOffset=vp.ui.getScrollOffset().top;var oContainerRect=vp.ui.getRect(document.getElementById("tdHybridRefinementArea"));var iContainerTop=oContainerRect.top;var iContainerHeight=oContainerRect.height;var oRefinementArea=document.getElementById("divHybridRefinementArea");if(iScrollOffset>iContainerTop)
{var oRefinementAreaRect=vp.ui.getRect(oRefinementArea);if(oRefinementAreaRect.height>vp.ui.getViewportSize().height+36)
{return;}
var bReachBottom=iScrollOffset+10+oRefinementAreaRect.height-iContainerTop>=iContainerHeight;if(vp.gallery.isIE6())
{if(bReachBottom)
{oRefinementArea.style.top=iContainerHeight-oRefinementAreaRect.height+"px";}
else
{oRefinementArea.style.top=iScrollOffset-iContainerTop+"px";}}
else
{if(bReachBottom)
{oRefinementArea.className="hybrid-refinement-relative";oRefinementArea.style.top=iContainerHeight-oRefinementAreaRect.height+"px";}
else
{if(oRefinementArea.className!="hybrid-refinement-fixed")
{oRefinementArea.className="hybrid-refinement-fixed";oRefinementArea.style.top="0px";}}}}
else
{oRefinementArea.className="hybrid-refinement-relative";oRefinementArea.style.top="0px";}
var oTypeAheadMenu=vp.gallery.typeAhead.menus["txtSearch"];if(oTypeAheadMenu)
{oTypeAheadMenu.position();}};vp.gallery.refinementMenu=null;vp.gallery.getTopRefinementMenuContainer=function gallery_getTopRefinementMenuContainer()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
if(!vp.gallery.refinementMenu)
{vp.gallery.refinementMenu=document.createElement("DIV");vp.gallery.refinementMenu.id="divTopRefinementMenu";var fnCancelBubble=function pv_fnCancelBubble(e)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
vp.events.cancel(e);};vp.events.add(vp.gallery.refinementMenu,"mousedown",fnCancelBubble);document.getElementById("divPageInner").appendChild(vp.gallery.refinementMenu);vp.events.add(vp.gallery.refinementMenu,"mousemove",vp.gallery.refinementMenuMouseOver);}
return vp.gallery.refinementMenu;};vp.gallery.generateRenderedRefinementMenuList=function gallery_generateRenderedRefinementMenuList(oRefinementList)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var aRenderedList=[];for(var i=0;i<oRefinementList.length;i++)
{var oRefinement=oRefinementList[i];var oCDiv=document.createElement("DIV");oCDiv.className="top-refinement-menu-item-container";var oDiv=document.createElement("DIV");oDiv.className="top-refinement-menu-item";var aRef=document.createElement("A");aRef.className="nav";aRef.appendChild(document.createTextNode(oRefinement.DisplayName));if(oRefinement.RecordCount>0)
{var spCount=document.createElement("SPAN");spCount.className="refinement-count";spCount.appendChild(document.createTextNode(" ({0})".format(oRefinement.RecordCount)));aRef.appendChild(spCount);}
oDiv.appendChild(aRef);oCDiv.appendChild(oDiv);vp.gallery.attachRedirectOnClick(oCDiv,oRefinement.URL);aRenderedList.push(oCDiv);vp.gallery.addIE6HoverBehavior(oCDiv,"over");}
return aRenderedList;};vp.gallery.createExtraCalloutMenuItem=function gallery_createExtraCalloutMenuItem(oExtraCallout)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
if(!oExtraCallout)
{return null;}
var oCDiv=document.createElement("DIV");oCDiv.className="top-refinement-extra-callout-container";var oDiv=document.createElement("DIV");oDiv.className="top-refinement-extra-callout-menu-item";oCDiv.appendChild(oDiv);oDiv.innerHTML=oExtraCallout;return oCDiv;};vp.gallery.createSeeAllMenuItem=function gallery_createSeeAllMenuItem(oRootInfo)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
if(!oRootInfo.SeeAllDesignsLink)
{return null;}
var oCDiv=document.createElement("DIV");oCDiv.className="top-refinement-menu-item-container";var oDiv=document.createElement("DIV");oDiv.className="top-refinement-menu-item";var aRef=document.createElement("A");aRef.className="nav";aRef.appendChild(document.createTextNode(oRootInfo.SeeAllDesignsLink.Caption));aRef.id="aGuidedNav_SEE_ALL_"+vp.gallery.seeAllLinkCount;aRef.href=oRootInfo.SeeAllDesignsLink.URL;vp.gallery.seeAllLinkCount++;oDiv.appendChild(aRef);oCDiv.appendChild(oDiv);vp.gallery.attachRedirectOnClick(oCDiv,oRootInfo.SeeAllDesignsLink.URL);vp.gallery.addIE6HoverBehavior(oCDiv,"over");return oCDiv;};vp.gallery.attachRedirectOnClick=function gallery_attachRedirectOnClick(oElement,sURL)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var fnRedirect=function pv_fnRedirect()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
vp.gallery.cancelDOMEvents();window.location=sURL;};vp.events.add(oElement,"click",fnRedirect);};vp.gallery.addIE6HoverBehavior=function gallery_addIE6HoverBehavior(oElement,sClassName)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
if(!vp.gallery.isIE6())
{return;}
var adjClassName=" "+sClassName;var fnHoverRecursive=function pv_fnHoverRecursive(oCurrentElement,bApply)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
if(oCurrentElement.className&&oCurrentElement.className!==null)
{if(bApply)
{if(oCurrentElement.className.indexOf(adjClassName)<0)
{oCurrentElement.className=oCurrentElement.className+adjClassName;}}
else
{if(oCurrentElement.className.indexOf(adjClassName)>=0)
{oCurrentElement.className=oCurrentElement.className.replace(adjClassName,"");}}}
var child=oCurrentElement.firstChild;while(child!==null)
{fnHoverRecursive(child,bApply);child=child.nextSibling;}};var fnHover=function pv_fnHover()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
fnHoverRecursive(oElement,true);};var fnUnHover=function pv_fnUnHover()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
fnHoverRecursive(oElement,false);};vp.events.add(oElement,"mouseover",fnHover);vp.events.add(oElement,"mouseout",fnUnHover);};vp.gallery.viewBacksidesPop=null;vp.gallery.viewInsidesPop=null;vp.gallery.viewLargerPop=null;vp.gallery.checkAccentImagePop=null;vp.gallery.checkScenesPop=null;vp.gallery.colorVariationsPop=null;vp.gallery.themePreviewPop=null;vp.gallery.categoryPop=null;vp.gallery.createDialog=function gallery_createDialog(sDialogId,oContent,sTitle,bModal)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var oRect={width:400,left:200,top:200,height:300};var oDialog=new vp.dialog.NodeDialog(sDialogId,oRect,oContent);if(!bModal)
{oDialog.options.veilOpacity=0;oDialog.options.closeOnClickOutside=true;}
oDialog.chrome=vp.dialog.chrome.Primary;oDialog.options.title=sTitle;oDialog.options.maximumHeight=-20;oDialog.options.maximumWidth=-20;return oDialog;};vp.gallery.getCategoryPop=function gallery_getCategoryPop()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
if(vp.gallery.categoryPop===null)
{var oContent=document.getElementById("divCategoryPopContainer");oContent.firstChild.style.display="block";vp.gallery.categoryPop=vp.gallery.createDialog("divCategoryPop",oContent,GalleryData.LangMap.CategoryPopTitle,true);vp.gallery.categoryPop.onclose.addHandler(vp.gallery.hideCategoryPop);if(GalleryData.Features.KitId)
{if(GalleryData.Features.IsMatchingSetKit=="True")
{vp.gallery.categoryPop.options.iconUrl="/vp/images/nns/common/icons/kits/matching_icon30.png";}
else
{vp.gallery.categoryPop.options.iconUrl="/vp/images/nns/common/icons/kits/kit_icon_xsm.png";}}
var fnMoveHandler=function pv_fnMoveHandler()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var oMenu=vp.gallery.typeAhead.menus["txtSearchPop"];if(oMenu)
{oMenu.position();}};vp.gallery.categoryPop.onmove.addHandler(fnMoveHandler);}
return vp.gallery.categoryPop;};vp.gallery.getColorVariationsPop=function gallery_getColorVariationsPop()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
if(vp.gallery.colorVariationsPop===null)
{var oContent=document.getElementById("divViewColorVariationsContent");oContent.style.display="block";vp.gallery.colorVariationsPop=vp.gallery.createDialog("divViewColorVariations",oContent,GalleryData.LangMap.ViewColorVariationsTitle);vp.gallery.colorVariationsPop.onclose.addHandler(vp.gallery.hideColorVariationsPop);}
return vp.gallery.colorVariationsPop;};vp.gallery.getCheckAccentImagePop=function gallery_getCheckAccentImagePop()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
if(vp.gallery.checkAccentImagePop===null)
{var oContent=document.getElementById("divAccentImagePopContent");oContent.style.display="block";vp.gallery.checkAccentImagePop=vp.gallery.createDialog("divCheckAccentImagePop",oContent,GalleryData.LangMap.ChecksAccentImageTitle);vp.gallery.checkAccentImagePop.onclose.addHandler(vp.gallery.hideCheckAccentImagePop);}
return vp.gallery.checkAccentImagePop;};vp.gallery.getCheckScenesPop=function gallery_getCheckScenesPop()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
if(vp.gallery.checkScenesPop===null)
{var oContent=document.getElementById("divViewCheckScenesContent");oContent.style.display="block";vp.gallery.checkScenesPop=vp.gallery.createDialog("divViewCheckScenes",oContent,GalleryData.LangMap.ViewCheckScenesTitle);vp.gallery.checkScenesPop.onclose.addHandler(vp.gallery.hideCheckScenesPop);}
return vp.gallery.checkScenesPop;};vp.gallery.getThemePreviewPop=function gallery_getThemePreviewPop()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
if(vp.gallery.themePreviewPop===null)
{var oContent=document.getElementById("divViewThemePreviewContent");oContent.style.display="block";vp.gallery.themePreviewPop=vp.gallery.createDialog("divViewThemePreview",oContent,"");vp.gallery.themePreviewPop.onclose.addHandler(vp.gallery.hideThemePreviewPop);}
return vp.gallery.themePreviewPop;};vp.gallery.getViewBacksidesPop=function gallery_getViewBacksidesPop()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
if(vp.gallery.viewBacksidesPop===null)
{var oContent=document.getElementById("divViewBacksidesContent");oContent.style.display="block";vp.gallery.viewBacksidesPop=vp.gallery.createDialog("divViewBacksidesPop",oContent,GalleryData.LangMap.ViewBacksidesTitle);vp.gallery.viewBacksidesPop.onclose.addHandler(vp.gallery.hideBackSidePop);}
return vp.gallery.viewBacksidesPop;};vp.gallery.getViewInsidesPop=function gallery_getViewInsidesPop()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
if(vp.gallery.viewInsidesPop===null)
{var oContent=document.getElementById("divViewInsidesContent");oContent.style.display="block";vp.gallery.viewInsidesPop=vp.gallery.createDialog("divViewInsidesPop",oContent,GalleryData.LangMap.ViewInsidesTitle);vp.gallery.viewInsidesPop.onclose.addHandler(vp.gallery.hideInsidesPop);}
return vp.gallery.viewInsidesPop;};vp.gallery.getViewLargerPop=function gallery_getViewLargerPop()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
if(vp.gallery.viewLargerPop===null)
{var oContent=document.getElementById("tblViewLargerPop");vp.gallery.viewLargerPop=vp.gallery.createDialog("divViewLargerPop",oContent,GalleryData.LangMap.ViewLargerTitle);vp.gallery.viewLargerPop.onclose.addHandler(vp.gallery.hideViewLargerPop);vp.gallery.viewLargerPop.onopen.addHandler(vp.gallery.preSizeViewLargerPop);}
return vp.gallery.viewLargerPop;};vp.gallery.togglePreviewLinkPop=function gallery_togglePreviewLinkPop(event,sDivId)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var oTarget=(event.target||event.srcElement);if(oTarget.nodeName=="SPAN")
{oTarget=oTarget.parentNode;}
else if(oTarget.parentNode.nodeName=="SPAN")
{oTarget=oTarget.parentNode.parentNode;}
var oAttrPop=oTarget.nextSibling;if(oAttrPop)
{var isCurrentPop=oAttrPop.id==sDivId;vp.gallery.closePreviewLinkPop(sDivId);if(!isCurrentPop)
{oAttrPop.id=sDivId;var oTargetRect=vp.ui.getRect(oTarget);if(oAttrPop.offsetParent)
{oAttrPop.offsetParent.style.zIndex=5;var oPreviewRect=vp.ui.getRect(oAttrPop.offsetParent);oAttrPop.style.position="absolute";oAttrPop.style.left=(oTargetRect.left-oPreviewRect.left-2)+"px";}
for(var i=0;i<oAttrPop.childNodes.length;i++)
{var child=oAttrPop.childNodes[i];if(child.innerHTML=="&nbsp;"||child.innerHTML.length<=1)
{oAttrPop.removeChild(child);i--;}}
oAttrPop.style.visibility="visible";oAttrPop.style.display="block";vp.events.cancelBubble(event);var fnCloseHandler=function pv_fnCloseHandler()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
vp.gallery.closePreviewLinkPop(sDivId);vp.events.remove(vp.ui.get("divPageContentInner"),"click",fnCloseHandler);};vp.events.add(vp.ui.get("divPageContentInner"),"click",fnCloseHandler);}}
return false;};vp.gallery.closePreviewLinkPop=function gallery_closePreviewLinkPop(sDivId)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var oAttrPop=vp.ui.get(sDivId);if(oAttrPop)
{oAttrPop.id=null;oAttrPop.style.visibility="hidden";if(oAttrPop.offsetParent)
{oAttrPop.offsetParent.style.zIndex=1;}}};vp.gallery.toggleSimilarCategoriesPop=function gallery_toggleSimilarCategoriesPop(event)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
return vp.gallery.togglePreviewLinkPop(event,"divSimilarCategoriesPopOpen");};vp.gallery.toggleAttributePop=function gallery_toggleAttributePop(event)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
return vp.gallery.togglePreviewLinkPop(event,"divAttrPopOpen");};vp.gallery.imagesLoaded=0;vp.gallery.trackImagesLoaded=function gallery_trackImagesLoaded(index)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
vp.gallery.imagesLoaded++;if(vp.gallery.imagesLoaded==GalleryData.Features.PreviewCount)
{setTimeout(vp.gallery.resizePreviewContainers,500);}};vp.gallery.resizePreviewContainers=function gallery_resizePreviewContainers()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var xPadding=GalleryData.Features.IsReseller=="True"?0:10;var yPadding=GalleryData.Features.IsReseller=="True"?0:5;var oPreviewArea=vp.ui.get("divPreviewArea");try
{var maxWidth=0;var maxHeight=0;for(var i=0;i<oPreviewArea.childNodes.length;i++)
{var oChild=oPreviewArea.childNodes[i];if(!oChild||!oChild.style||!oChild.firstChild||(oChild.id&&oChild.id.indexOf("DebugInfo")!=-1))
{continue;}
oChild.firstChild.style.borderWidth="0px 0px";var childIndex=parseInt(oChild.id.replace(/.*_/,""));var oImgContainer=vp.ui.get("aPreview"+childIndex+"0");if(oImgContainer&&oImgContainer.parentNode&&oImgContainer.parentNode.style)
{oImgContainer.parentNode.style.borderWidth="0px 0px";}
var oImg=oImgContainer.firstChild;if(oImg&&oImg.style&&(GalleryData.Features.ProductGroupId==74||GalleryData.Features.ProductGroupId==71||GalleryData.Features.ProductGroupId==72||GalleryData.Features.ProductGroupId==77||GalleryData.Features.ProductGroupId==54))
{var naturalHeight=oImg.naturalHeight;var naturalWidth=oImg.naturalWidth;if(!naturalHeight||!naturalWidth)
{var lpi=new Image();lpi.src=oImg.src;naturalHeight=lpi.height;naturalWidth=lpi.width;}
if(!naturalHeight||!naturalWidth)
{oImg.style.height="auto";oImg.style.width="auto";}
else if(oImg.height!=naturalHeight)
{oImg.style.height=naturalHeight+"px";oImg.style.width=naturalWidth+"px";}}
var oChildRect=vp.ui.getRect(oChild.firstChild);if(oChildRect.width>maxWidth)
{maxWidth=Math.round(oChildRect.width);}
if(oChildRect.height>maxHeight)
{maxHeight=Math.round(oChildRect.height);}}
maxWidth+=xPadding;maxHeight+=yPadding;for(i=0;i<oPreviewArea.childNodes.length;i++)
{oChild=oPreviewArea.childNodes[i];if(!oChild||!oChild.style||(oChild.id&&oChild.id.indexOf("DebugInfo")!=-1))
{continue;}
if(oChild.firstChild&&oChild.firstChild.style)
{oChildRect=vp.ui.getRect(oChild.firstChild);oChild.firstChild.style.width=oChildRect.width+"px";oChild.firstChild.style.minWidth=oChildRect.width+"px";oChild.firstChild.style.height=oChildRect.height+"px";oChild.firstChild.style.minHeight=oChildRect.height+"px";oChild.firstChild.style.borderStyle="solid";oChild.firstChild.style.borderColor="white";var xOffset=Math.max(0,Math.round((maxWidth-oChildRect.width)/2-1));var yOffset=Math.max(0,Math.round((maxHeight-oChildRect.height)/2-1));oChild.firstChild.style.borderWidth="1px "+xOffset+"px";childIndex=parseInt(oChild.id.replace(/.*_/,""));oImgContainer=vp.ui.get("aPreview"+childIndex+"0");if(oImgContainer&&oImgContainer.parentNode&&oImgContainer.parentNode.style)
{oImgContainer.parentNode.style.borderStyle="solid";oImgContainer.parentNode.style.borderColor="white";oImgContainer.parentNode.style.borderWidth=Math.max(0,yOffset-1)+"px 0px";}}
oChild.style.width=maxWidth+"px";oChild.style.minWidth=maxWidth+"px";oChild.style.height=maxHeight+"px";oChild.style.minHeight=maxHeight+"px";}
vp.gallery.configureMaximumPreviewColumns();}
catch(e)
{}
oPreviewArea.style.visibility="visible";vp.gallery.arrangeIE6Layout();};vp.gallery.configureMaximumPreviewColumns=function gallery_configureMaximumPreviewColumns()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var colCount=GalleryData.Features.MaximumNumberOfColumns;if(!colCount)
{return;}
var oPreviewArea=vp.ui.get("divPreviewArea");var oSampleContainer=oPreviewArea.firstChild;if(!oSampleContainer)
{return;}
var iWidth=vp.ui.getRect(oSampleContainer).width;var iPreviewAreaWidth=colCount*(iWidth+15);oPreviewArea.style.maxWidth=iPreviewAreaWidth+"px";var oAbovePreviews=document.getElementById("tblFiltersAbovePreviewsContainer");if(oAbovePreviews)
{oAbovePreviews.style.maxWidth=iPreviewAreaWidth+"px";}
document.getElementById("divResultCount").style.maxWidth=iPreviewAreaWidth+"px";if(document.getElementById("divTopCategoryName"))
{document.getElementById("divTopCategoryName").style.maxWidth=iPreviewAreaWidth+"px";}
document.getElementById("divPagingAndSorting").style.maxWidth=iPreviewAreaWidth+"px";var oTransparency=vp.ui.get("divTransparencyMessage");if(oTransparency)
{oTransparency.style.maxWidth=iPreviewAreaWidth+"px";}
GalleryData.Features.PreviewAreaWidth=iPreviewAreaWidth;};vp.gallery.setMinPageWidth=function gallery_setMinPageWidth(iWidth)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var oPageOuter=vp.ui.get(".page-outer-container");if(oPageOuter&&oPageOuter.style)
{oPageOuter.style.minWidth=iWidth+"px";if(vp.gallery.isIE6())
{var fnStopSize=function pv_fnStopSize(e)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
if(document.documentElement.clientWidth<iWidth)
{document.body.style.width=iWidth+"px";}
else
{if(document.body.style.width!="100%")
{document.body.style.width="100%";}}};vp.events.add(window,"resize",fnStopSize);}}};vp.gallery.showUploadDialog=function gallery_showUploadDialog()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var fnClose=function pv_fnClose()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
vp.cookies.setSubValue("SITE","gupcallout","False");};vp.gallery.photoFirst.showPhotoFirstPop(vp.gallery.uploadPopCallBackHandler,fnClose);return false;};vp.gallery.showPreviousUploadedFileDialog=function gallery_showPreviousUploadedFileDialog()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var fnClose=function pv_fnClose()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}};vp.gallery.photoFirst.showPreviouslyUploadedFiles(vp.gallery.uploadBoxCallBackHandler,fnClose);return false;};vp.gallery.browseUploadFile=function gallery_browseUploadFile(oUploadResult)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
if(oUploadResult.cancel)
{}
else if(oUploadResult.error)
{vp.upload.showErrorDialog(oUploadResult);}
else if(oUploadResult.success)
{var fnClose=function pv_fnClose()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}};vp.gallery.photoFirst.showCropDialog(oUploadResult.success.uploadId,vp.gallery.uploadBoxCallBackHandler,fnClose);}};vp.gallery.uploadBoxCallBackHandler=function gallery_uploadBoxCallBackHandler(iDocItemType,iItemID,oCropInfo,fAspectRatio)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
vp.gallery.uploadPopCallBackHandler(iDocItemType,iItemID,oCropInfo,fAspectRatio,GalleryData.Features.FullBleedUrl);};vp.gallery.uploadPopCallBackHandler=function gallery_uploadPopCallBackHandler(iDocItemType,iItemID,oCropInfo,fAspectRatio,sBaseUrl)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
if(!sBaseUrl)
{sBaseUrl=window.location.href;}
var oUrl=new vp.web.URL(sBaseUrl);oUrl.setItem("lgimgs1",iItemID);oUrl.setItem("image_list",iItemID);oUrl.setItem("image_type",iDocItemType);if(oCropInfo)
{oUrl.setItem("crop_left",oCropInfo.left);oUrl.setItem("crop_top",oCropInfo.top);oUrl.setItem("crop_right",oCropInfo.right);oUrl.setItem("crop_bottom",oCropInfo.bottom);}
vp.gallery.redirect(oUrl.toString());};vp.gallery.showPermLinkMessage=function gallery_showPermLinkMessage(iMessageId)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var sMessage=GalleryData.Features.PermLinkMessages[iMessageId];var oNotification=vp.widget.showNotification(sMessage,document.getElementById("txtPermLink"),CALLOUT_BALLOON_ARROW_STYLE_ARROW_TOP,0,null,240,null,vp.gallery.notifications[vp.gallery.NOTIFICATION_PERM_LINK_BOX_ID],150);vp.gallery.notifications[vp.gallery.NOTIFICATION_PERM_LINK_BOX_ID]=oNotification.id;};vp.gallery.reseller=function gallery_reseller(){if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}};vp.gallery.reseller.selectedRootId=-1;vp.gallery.reseller.selectCategoryRoot=function gallery_reseller_selectCategoryRoot(iRootId)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var oNewElement=vp.ui.get("divCategoryRootContents_"+iRootId);if(oNewElement)
{var oExistingElement=vp.ui.get("divCategoryRootContents_"+vp.gallery.reseller.selectedRootId);if(oExistingElement)
{oExistingElement.style.display="none";}
oNewElement.style.display="block";vp.gallery.reseller.selectedRootId=iRootId;}};vp.gallery.showMarketPlaceSurvey=function gallery_showMarketPlaceSurvey()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var oSessionDiv=vp.ui.get("divSessionId");var iSessionid=0;if(oSessionDiv)
{iSessionid=oSessionDiv.innerHTML;}
var iProductGroup=GalleryData.Features.ProductGroupId;var oWin=vp.win.open("/survey/marketplace-survey.aspx?surveyid=89&popupmode=true&session_id={0}&pg={1}&xnav=galleryugcpop".format(iSessionid,iProductGroup),"marketplaceSurvey","menubar=no,width=660,height=500,toolbar=no,scrollbars=yes",true,false);};vp.gallery.showVaporTestPop=function gallery_showVaporTestPop(sTrackRef,sTitle,sBody)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
vp.gallery.trackAction(sTrackRef);var element=document.createElement("div");element.style.padding="10px";element.innerHTML=sBody;var oRect={width:200,left:550,top:200,height:75};var oDialog=new vp.dialog.NodeDialog("divVaporTestPop",oRect,element);oDialog.options.veilOpacity=0;oDialog.options.closeOnClickOutside=true;oDialog.chrome=vp.dialog.chrome.Primary;oDialog.options.title=sTitle;oDialog.options.maximumHeight=-20;oDialog.options.maximumWidth=-20;oDialog.open();};vp.gallery.productsContainer=null;vp.gallery.optionsContainer=null;vp.gallery.clicked=false;vp.gallery.showProductOptions=function gallery_showProductOptions(){if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
vp.gallery.optionsContainer=document.getElementById("productOptions");var dimensions=vp.gallery.getElementDimensions(vp.gallery.optionsContainer);vp.gallery.productsContainer=document.getElementById("productsContainer");vp.gallery.productsContainer.style.left=dimensions.left+"px";vp.gallery.productsContainer.style.top=dimensions.top+dimensions.height+"px";vp.events.add(document.body,"mousemove",vp.gallery.hideProductOptions);vp.gallery.productsContainer.style.visibility="visible";vp.gallery.clicked=true;};vp.gallery.toggleProductMenu=function gallery_toggleProductMenu(){if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
if(!vp.gallery.clicked){vp.gallery.showProductOptions();}
else{vp.gallery.productsContainer.style.visibility="hidden";vp.gallery.clicked=false;}};vp.gallery.isMouseInProduct=function gallery_isMouseInProduct(e){if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var oRect=vp.ui.getRect(vp.gallery.productsContainer);var dropRect=vp.ui.getRect(vp.gallery.optionsContainer);oRect=vp.ui.expandRect(oRect,3);dropRect=vp.ui.expandRect(dropRect,3);return(vp.ui.isPointInRect(e.clientX,e.clientY,oRect)||vp.ui.isPointInRect(e.clientX,e.clientY,dropRect));};vp.gallery.hideProductOptions=function gallery_hideProductOptions(e)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
if(!vp.gallery.isMouseInProduct(e)){vp.gallery.productsContainer.style.visibility="hidden";vp.events.remove(document.body,"mousemove",vp.gallery.hideProductOptions);}};vp.gallery.getElementDimensions=function gallery_getElementDimensions(el){if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var _x=0;var _y=0;var tempEl=el.offsetParent;_y=el.offsetTop+tempEl.offsetTop+1;_x=el.offsetLeft+tempEl.offsetLeft;var browser=navigator.appName;if(browser=="Microsoft Internet Explorer"){_y-=1;_x+=3;}
return{top:_y,left:_x,height:el.offsetHeight,width:el.offsetWidth};};