                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                if(!window.__td){window.__MT=100;window.__ti=0;window.__td=[];window.__td.length=window.__MT;window.__noTrace=false;}




if(typeof vp=="undefined")
{
var vp={};
};





if(typeof vp.ppso=="undefined")
{
vp.ppso=function(){};
};





vp.ppso.EventManager=function $vpfn_wdYSDXE1Q48MRmRSSbUbEw24$23()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var me=this;


var currentPfId="";
var currentUrl="";

this.responder=new vp.ppso.Responder();


this.galleryRedirect=function $vpfn_RhJ_PJZqr6fb4EqVBa4OAQ35$24()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
document.location=manager.currentUrl;
return false;
};
};




vp.ppso.Responder=function $vpfn_88G5zVBMXPeeh5hpYrrcrg45$20()
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var me=this;

this.addNewConfiguration=new vp.events.CustomEvent(this,"addNewConfiguration");

this.pfIdChanged=new vp.events.CustomEvent(this,"pfIdChanged");

this.orientationChanged=new vp.events.CustomEvent(this,"orientationChanged");

this.sizeChanged=new vp.events.CustomEvent(this,"sizeChanged");

this.galleryUrlChanged=new vp.events.CustomEvent(this,"galleryUrlChanged");
};


var manager=new vp.ppso.EventManager();



vp.ppso.SizeSelectorRegistrant=function $vpfn_Hfr$N_KTGiXbUtozcxg9Aw65$33(defaultPfId,pfIdList)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var me=this;

var lastPfId=0;

var currentSizePfId=defaultPfId;

var allPfIds=pfIdList.split(",");


this.changeSize=function $vpfn_qq0PaCP4FJhQySz9$qxePw76$19(evt)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var newPfId=vp.events.getEventData(evt,"newPfId");
if(newPfId!=currentSizePfId)
{
switchActivePfid(newPfId);

lastPfId=currentSizePfId;
currentSizePfId=newPfId;
}
};

manager.responder.sizeChanged.addHandler(this.changeSize);


this.selectorClicked=function $vpfn_qvIdm4CF5vl$LgFdvwysSQ91$24(evt)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var identifier;
if(evt.srcElement)
{
identifier=evt.srcElement.id.split("_")[1];
}
else if(evt.target)
{
identifier=evt.target.id.split("_")[1];
}
else
{
identifier=this.id.split("_")[1];
}
vp.events.setEventData(evt,"newPfId",identifier);

manager.responder.sizeChanged.fire(evt);
};


for(var i=0;i<allPfIds.length;i++)
{
vp.events.add("selectSize_"+allPfIds[i],'click',this.selectorClicked);

if(vp.ui.get("selectSize_"+allPfIds[i]+"_image"))
{
vp.events.add("selectSize_"+allPfIds[i]+"_image",'click',this.selectorClicked);
}
}
};

vp.ppso.OptionSelectorRegistrant=function $vpfn_DtCuiyRxYxyZyfmff5Vjgw123$35(pfId,activeOption,optionList)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var me=this;

var currentPfId=pfId;

var originalOption=activeOption;
var currentOption=activeOption;

var allOptions=optionList.split(",");

this.changeOption=function $vpfn_ifzPnquztANoXES9JvdK_Q134$24(evt)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var url,success;
var newOptionValue=vp.events.getEventData(evt,"newVal");
if(newOptionValue&&newOptionValue!=originalOption)
{
currentOption=newOptionValue;


if(manager.currentPfId)
{
url="/paper-stock-switcher.aspx?option_val="+newOptionValue+"&pf_id="+manager.currentPfId;
}
else
{
url="/paper-stock-switcher.aspx?option_val="+newOptionValue+"&pf_id="+currentPfId;
}
success=vp.http.get(url);
}
else if(newOptionValue&&newOptionValue==originalOption)
{
if(manager.currentPfId)
{
url="/paper-stock-switcher.aspx?r=1&pf_id="+manager.currentPfId;
}
else
{
url="/paper-stock-switcher.aspx?r=1&pf_id="+currentPfId;
}
success=vp.http.get(url);
}
};

manager.responder.addNewConfiguration.addHandler(this.changeOption);

this.productChanged=function $vpfn_wpE4hCYmLJgXyeKGTpngiA169$26(evt)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var newPfId=vp.events.getEventData(evt,"newPfId");
if(newPfId)
{

var url="/paper-stock-switcher.aspx?option_val="+currentOption+"&pf_id="+newPfId;
var success=vp.http.get(url);


manager.currentPfId=newPfId;
}
};

manager.responder.pfIdChanged.addHandler(this.productChanged);


this.selectorClicked=function $vpfn_qvIdm4CF5vl$LgFdvwysSQ186$27(evt)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var identifier;
if(evt.srcElement)
{
identifier=evt.srcElement.id.split("_")[1];
}
else if(evt.target)
{
identifier=evt.target.id.split("_")[1];
}
else
{
identifier=this.id.split("_")[1];
}
vp.events.setEventData(evt,"newVal",identifier);

manager.responder.addNewConfiguration.fire(evt);
};

for(var i=0;i<allOptions.length;i++)
{
vp.events.add("selectOption_"+allOptions[i],'click',this.selectorClicked);
}
};

vp.ppso.OrientationSelectorRegistrant=function $vpfn_4gkAMCunXhKfD6zQc0zcPw212$40(sizePfId,orientationList,defaultGalleryUrlList)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var me=this;


var currentOrientIndex;
var currentSizeIndex;


var pfIdsByOrientation=orientationList.split(";");
var urlListsByOrientation=defaultGalleryUrlList.split(";");

var orientationCount=pfIdsByOrientation.length;
var pfIdCount;

var orientationThenSizeArr=new Array(orientationCount);
var urlsByOrientThenSizeArr=new Array(orientationCount);

for(var i=0;i<orientationCount;i++)
{
var pfIdsBySize=pfIdsByOrientation[i].split(",");
var urlsBySize=urlListsByOrientation[i].split(",");


orientationThenSizeArr[i]=pfIdsBySize;
urlsByOrientThenSizeArr[i]=urlsBySize;

if(!pfIdCount)
{
pfIdCount=pfIdsBySize.length;
}


if(!currentSizeIndex)
{
for(var j=0;j<pfIdCount;j++)
{
if(pfIdsBySize[j]==sizePfId)
{
currentSizeIndex=j;
if(!currentOrientIndex)
{
currentOrientIndex=i;
}
}
}
}
}


manager.currentPfId=orientationThenSizeArr[currentOrientIndex][currentSizeIndex];
manager.currentUrl=urlsByOrientThenSizeArr[currentOrientIndex][currentSizeIndex];



this.changeSize=function $vpfn_qq0PaCP4FJhQySz9$qxePw267$22(evt)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var newPfId=vp.events.getEventData(evt,"newPfId");

var sizingOrientation=orientationThenSizeArr[0];
for(var i=0;i<pfIdCount;i++)
{
if(sizingOrientation[i]==newPfId)
{
currentSizeIndex=i;
}
}

if(manager.currentPfId)
{
var url="/paper-stock-switcher.aspx?r=1&pf_id="+manager.currentPfId;
var success=vp.http.get(url);
}

manager.currentUrl=urlsByOrientThenSizeArr[currentOrientIndex][currentSizeIndex];

vp.events.setEventData(evt,"newPfId",orientationThenSizeArr[currentOrientIndex][currentSizeIndex]);
manager.responder.pfIdChanged.fire(evt);
};

manager.responder.sizeChanged.addHandler(this.changeSize);



this.changeOrientation=function $vpfn_5UkyKwAfeuqYk7CF5qAmUQ296$29(evt)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var newOrientIndex=vp.events.getEventData(evt,"orientId");
if(newOrientIndex!=currentOrientIndex)
{
currentOrientIndex=newOrientIndex;

if(manager.currentPfId)
{
var url="/paper-stock-switcher.aspx?r=1&pf_id="+manager.currentPfId;
var success=vp.http.get(url);
}

manager.currentUrl=urlsByOrientThenSizeArr[currentOrientIndex][currentSizeIndex];

vp.events.setEventData(evt,"newPfId",orientationThenSizeArr[currentOrientIndex][currentSizeIndex]);

manager.responder.pfIdChanged.fire(evt);
}
};

manager.responder.orientationChanged.addHandler(this.changeOrientation);

this.selectorClicked=function $vpfn_qvIdm4CF5vl$LgFdvwysSQ319$27(evt)
{if(!window.__noTrace){__td[__ti]=arguments;__ti=__ti>=__MT?0:__ti+1;}
var identifier;
if(evt.srcElement)
{
identifier=evt.srcElement.id.split("_")[1];
}
else if(evt.target)
{
identifier=evt.target.id.split("_")[1];
}
else
{
identifier=this.id.split("_")[1];
}
vp.events.setEventData(evt,"orientId",identifier);

manager.responder.orientationChanged.fire(evt);
};

for(i=0;i<orientationThenSizeArr.length;i++)
{
vp.events.add("selectOrient_"+i,'click',this.selectorClicked);
}
};