
if(!this.JSON){JSON=function(){function f(n){return n<10?'0'+n:n;}
Date.prototype.toJSON=function(){return this.getUTCFullYear()+'-'+
f(this.getUTCMonth()+1)+'-'+
f(this.getUTCDate())+'T'+
f(this.getUTCHours())+':'+
f(this.getUTCMinutes())+':'+
f(this.getUTCSeconds())+'Z';};var m={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'};function stringify(value,whitelist){var a,i,k,l,r=/["\\\x00-\x1f\x7f-\x9f]/g,v;switch(typeof value){case'string':return r.test(value)?'"'+value.replace(r,function(a){var c=m[a];if(c){return c;}
c=a.charCodeAt();return'\\u00'+Math.floor(c/16).toString(16)+
(c%16).toString(16);})+'"':'"'+value+'"';case'number':return isFinite(value)?String(value):'null';case'boolean':case'null':return String(value);case'object':if(!value){return'null';}
if(typeof value.toJSON==='function'){return stringify(value.toJSON());}
a=[];if(typeof value.length==='number'&&!(value.propertyIsEnumerable('length'))){l=value.length;for(i=0;i<l;i+=1){a.push(stringify(value[i],whitelist)||'null');}
return'['+a.join(',')+']';}
if(whitelist){l=whitelist.length;for(i=0;i<l;i+=1){k=whitelist[i];if(typeof k==='string'){v=stringify(value[k],whitelist);if(v){a.push(stringify(k)+':'+v);}}}}else{for(k in value){if(typeof k==='string'){v=stringify(value[k],whitelist);if(v){a.push(stringify(k)+':'+v);}}}}
return'{'+a.join(',')+'}';}}
return{stringify:stringify,parse:function(text,filter){var j;function walk(k,v){var i,n;if(v&&typeof v==='object'){for(i in v){if(Object.prototype.hasOwnProperty.apply(v,[i])){n=walk(i,v[i]);if(n!==undefined){v[i]=n;}}}}
return filter(k,v);}
if(/^[\],:{}\s]*$/.test(text.replace(/\\./g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(:?[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,''))){j=eval('('+text+')');return typeof filter==='function'?walk('',j):j;}
throw new SyntaxError('parseJSON');}};}();}

window.dhtmlHistory={isIE:false,isOpera:false,isSafari:false,isKonquerer:false,isGecko:false,isSupported:false,create:function(_1){var _2=this;var UA=navigator.userAgent.toLowerCase();var _4=navigator.platform.toLowerCase();var _5=navigator.vendor||"";if(_5==="KDE"){this.isKonqueror=true;this.isSupported=false;}else{if(typeof window.opera!=="undefined"){this.isOpera=true;this.isSupported=true;}else{if(typeof document.all!=="undefined"){this.isIE=true;this.isSupported=true;}else{if(_5.indexOf("Apple Computer, Inc.")>-1){this.isSafari=true;this.isSupported=(_4.indexOf("mac")>-1);}else{if(UA.indexOf("gecko")!=-1){this.isGecko=true;this.isSupported=true;}}}}}window.historyStorage.setup(_1);if(this.isSafari){this.createSafari();}else{if(this.isOpera){this.createOpera();}}var _6=this.getCurrentLocation();this.currentLocation=_6;if(this.isIE){this.createIE(_6);}var _7=function(){_2.firstLoad=null;};this.addEventListener(window,"unload",_7);if(this.isIE){this.ignoreLocationChange=true;}else{if(!historyStorage.hasKey(this.PAGELOADEDSTRING)){this.ignoreLocationChange=true;this.firstLoad=true;historyStorage.put(this.PAGELOADEDSTRING,true);}else{this.ignoreLocationChange=false;this.fireOnNewListener=true;}}var _8=function(){_2.checkLocation();};setInterval(_8,100);},initialize:function(){if(this.isIE){if(!historyStorage.hasKey(this.PAGELOADEDSTRING)){this.fireOnNewListener=false;this.firstLoad=true;historyStorage.put(this.PAGELOADEDSTRING,true);}else{this.fireOnNewListener=true;this.firstLoad=false;}}},addListener:function(_9){this.listener=_9;if(this.fireOnNewListener){this.fireHistoryEvent(this.currentLocation);this.fireOnNewListener=false;}},addEventListener:function(o,e,l){if(o.addEventListener){o.addEventListener(e,l,false);}else{if(o.attachEvent){o.attachEvent("on"+e,function(){l(window.event);});}}},add:function(_d,_e){if(this.isSafari){_d=this.removeHash(_d);historyStorage.put(_d,_e);this.currentLocation=_d;window.location.hash=_d;this.putSafariState(_d);}else{var _f=this;var _10=function(){if(_f.currentWaitTime>0){_f.currentWaitTime=_f.currentWaitTime-_f.waitTime;}_d=_f.removeHash(_d);if(document.getElementById(_d)&&_f.debugMode){var e="Exception: History locations can not have the same value as _any_ IDs that might be in the document,"+" due to a bug in IE; please ask the developer to choose a history location that does not match any HTML"+" IDs in this document. The following ID is already taken and cannot be a location: "+_d;throw new Error(e);}historyStorage.put(_d,_e);_f.ignoreLocationChange=true;_f.ieAtomicLocationChange=true;_f.currentLocation=_d;window.location.hash=_d;if(_f.isIE){_f.iframe.src="blank.html?"+_d;}_f.ieAtomicLocationChange=false;};window.setTimeout(_10,this.currentWaitTime);this.currentWaitTime=this.currentWaitTime+this.waitTime;}},isFirstLoad:function(){return this.firstLoad;},getVersion:function(){return"0.6";},getCurrentLocation:function(){var r=(this.isSafari?this.getSafariState():this.getCurrentHash());return r;},getCurrentHash:function(){var r=window.location.href;var i=r.indexOf("#");return(i>=0?r.substr(i+1):"");},PAGELOADEDSTRING:"DhtmlHistory_pageLoaded",listener:null,waitTime:200,currentWaitTime:0,currentLocation:null,iframe:null,safariHistoryStartPoint:null,safariStack:null,safariLength:null,ignoreLocationChange:null,fireOnNewListener:null,firstLoad:null,ieAtomicLocationChange:null,createIE:function(_15){this.waitTime=400;var _16=(historyStorage.debugMode?"width: 800px;height:80px;border:1px solid black;":historyStorage.hideStyles);var _17="rshHistoryFrame";var _18="<iframe frameborder=\"0\" id=\""+_17+"\" style=\""+_16+"\" src=\"blank.html?"+_15+"\"></iframe>";document.write(_18);this.iframe=document.getElementById(_17);},createOpera:function(){this.waitTime=400;var _19="<img src=\"javascript:location.href='javascript:dhtmlHistory.checkLocation();';\" style=\""+historyStorage.hideStyles+"\" />";document.write(_19);},createSafari:function(){var _1a="rshSafariForm";var _1b="rshSafariStack";var _1c="rshSafariLength";var _1d=historyStorage.debugMode?historyStorage.showStyles:historyStorage.hideStyles;var _1e=(historyStorage.debugMode?"width:800px;height:20px;border:1px solid black;margin:0;padding:0;":historyStorage.hideStyles);var _1f="<form id=\""+_1a+"\" style=\""+_1d+"\">"+"<input type=\"text\" style=\""+_1e+"\" id=\""+_1b+"\" value=\"[]\"/>"+"<input type=\"text\" style=\""+_1e+"\" id=\""+_1c+"\" value=\"\"/>"+"</form>";document.write(_1f);this.safariStack=document.getElementById(_1b);this.safariLength=document.getElementById(_1c);if(!historyStorage.hasKey(this.PAGELOADEDSTRING)){this.safariHistoryStartPoint=history.length;this.safariLength.value=this.safariHistoryStartPoint;}else{this.safariHistoryStartPoint=this.safariLength.value;}},getSafariStack:function(){var r=this.safariStack.value;return historyStorage.fromJSON(r);},getSafariState:function(){var _21=this.getSafariStack();var _22=_21[history.length-this.safariHistoryStartPoint-1];return _22;},putSafariState:function(_23){var _24=this.getSafariStack();_24[history.length-this.safariHistoryStartPoint]=_23;this.safariStack.value=historyStorage.toJSON(_24);},fireHistoryEvent:function(_25){var _26=historyStorage.get(_25);this.listener.call(null,_25,_26);},checkLocation:function(){if(!this.isIE&&this.ignoreLocationChange){this.ignoreLocationChange=false;return;}if(!this.isIE&&this.ieAtomicLocationChange){return;}var _27=this.getCurrentLocation();if(_27==this.currentLocation){return;}this.ieAtomicLocationChange=true;if(this.isIE&&this.getIframeHash()!=_27){this.iframe.src="blank.html?"+_27;}else{if(this.isIE){return;}}this.currentLocation=_27;this.ieAtomicLocationChange=false;this.fireHistoryEvent(_27);},getIframeHash:function(){var doc=this.iframe.contentWindow.document;var _29=String(doc.location.search);if(_29.length==1&&_29.charAt(0)=="?"){_29="";}else{if(_29.length>=2&&_29.charAt(0)=="?"){_29=_29.substring(1);}}return _29;},removeHash:function(_2a){var r;if(_2a===null||_2a===undefined){r=null;}else{if(_2a===""){r="";}else{if(_2a.length==1&&_2a.charAt(0)=="#"){r="";}else{if(_2a.length>1&&_2a.charAt(0)=="#"){r=_2a.substring(1);}else{r=_2a;}}}}return r;},iframeLoaded:function(_2c){if(this.ignoreLocationChange){this.ignoreLocationChange=false;return;}var _2d=String(_2c.search);if(_2d.length==1&&_2d.charAt(0)=="?"){_2d="";}else{if(_2d.length>=2&&_2d.charAt(0)=="?"){_2d=_2d.substring(1);}}window.location.hash=_2d;this.fireHistoryEvent(_2d);}};window.historyStorage={setup:function(_2e){if(typeof _2e!=="undefined"){if(_2e.debugMode){this.debugMode=_2e.debugMode;}if(_2e.toJSON){this.toJSON=_2e.toJSON;}if(_2e.fromJSON){this.fromJSON=_2e.fromJSON;}}var _2f="rshStorageForm";var _30="rshStorageField";var _31=this.debugMode?historyStorage.showStyles:historyStorage.hideStyles;var _32=(historyStorage.debugMode?"width: 800px;height:80px;border:1px solid black;":historyStorage.hideStyles);var _33="<form id=\""+_2f+"\" style=\""+_31+"\">"+"<textarea id=\""+_30+"\" style=\""+_32+"\"></textarea>"+"</form>";document.write(_33);this.storageField=document.getElementById(_30);if(typeof window.opera!=="undefined"){this.storageField.focus();}},put:function(key,_35){this.assertValidKey(key);if(this.hasKey(key)){this.remove(key);}this.storageHash[key]=_35;this.saveHashTable();},get:function(key){this.assertValidKey(key);this.loadHashTable();var _37=this.storageHash[key];if(_37===undefined){_37=null;}return _37;},remove:function(key){this.assertValidKey(key);this.loadHashTable();delete this.storageHash[key];this.saveHashTable();},reset:function(){this.storageField.value="";this.storageHash={};},hasKey:function(key){this.assertValidKey(key);this.loadHashTable();return(typeof this.storageHash[key]!=="undefined");},isValidKey:function(key){return(typeof key==="string");},showStyles:"border:0;margin:0;padding:0;",hideStyles:"left:-1000px;top:-1000px;width:1px;height:1px;border:0;position:absolute;",debugMode:false,storageHash:{},hashLoaded:false,storageField:null,assertValidKey:function(key){var _3c=this.isValidKey(key);if(!_3c&&this.debugMode){throw new Error("Please provide a valid key for window.historyStorage. Invalid key = "+key+".");}},loadHashTable:function(){if(!this.hashLoaded){var _3d=this.storageField.value;if(_3d!==""&&_3d!==null){this.storageHash=this.fromJSON(_3d);this.hashLoaded=true;}}},saveHashTable:function(){this.loadHashTable();var _3e=this.toJSON(this.storageHash);this.storageField.value=_3e;},toJSON:function(o){return o.toJSONString();},fromJSON:function(s){return s.parseJSON();}};

(function($){var dropShadowZindex=1;$.fn.dropShadow=function(options)
{var opt=$.extend({left:4,top:4,blur:2,opacity:.5,color:"black",swap:false},options);var jShadows=$([]);this.not(".dropShadow").each(function()
{var jthis=$(this);var shadows=[];var blur=(opt.blur<=0)?0:opt.blur;var opacity=(blur==0)?opt.opacity:opt.opacity/(blur*8);var zOriginal=(opt.swap)?dropShadowZindex:dropShadowZindex+1;var zShadow=(opt.swap)?dropShadowZindex+1:dropShadowZindex;var shadowId;if(this.id){shadowId=this.id+"_dropShadow";}
else{shadowId="ds"+(1+Math.floor(9999*Math.random()));}
$.data(this,"shadowId",shadowId);$.data(this,"shadowOptions",options);jthis.attr("shadowId",shadowId).css("zIndex",zOriginal);if(jthis.css("position")!="absolute"){jthis.css({position:"relative",zoom:1});}
bgColor=jthis.css("backgroundColor");if(bgColor=="rgba(0, 0, 0, 0)")bgColor="transparent";if(bgColor!="transparent"||jthis.css("backgroundImage")!="none"||this.nodeName=="SELECT"||this.nodeName=="INPUT"||this.nodeName=="TEXTAREA"){shadows[0]=$("<div></div>").css("background",opt.color);}
else{shadows[0]=jthis.clone().removeAttr("id").removeAttr("name").removeAttr("shadowId").css("color",opt.color);}
shadows[0].addClass("dropShadow").css({height:jthis.outerHeight(),left:blur,opacity:opacity,position:"absolute",top:blur,width:jthis.outerWidth(),zIndex:zShadow});var layers=(8*blur)+1;for(i=1;i<layers;i++){shadows[i]=shadows[0].clone();}
var i=1;var j=blur;while(j>0){shadows[i].css({left:j*2,top:0});shadows[i+1].css({left:j*4,top:j*2});shadows[i+2].css({left:j*2,top:j*4});shadows[i+3].css({left:0,top:j*2});shadows[i+4].css({left:j*3,top:j});shadows[i+5].css({left:j*3,top:j*3});shadows[i+6].css({left:j,top:j*3});shadows[i+7].css({left:j,top:j});i+=8;j--;}
var divShadow=$("<div></div>").attr("id",shadowId).addClass("dropShadow").css({left:jthis.position().left+opt.left-blur,marginTop:jthis.css("marginTop"),marginRight:jthis.css("marginRight"),marginBottom:jthis.css("marginBottom"),marginLeft:jthis.css("marginLeft"),position:"absolute",top:jthis.position().top+opt.top-blur,zIndex:zShadow});for(i=0;i<layers;i++){divShadow.append(shadows[i]);}
jthis.after(divShadow);jShadows=jShadows.add(divShadow);$(window).resize(function()
{try{divShadow.css({left:jthis.position().left+opt.left-blur,top:jthis.position().top+opt.top-blur});}
catch(e){}});dropShadowZindex+=2;});return this.pushStack(jShadows);};$.fn.redrawShadow=function()
{this.removeShadow();return this.each(function()
{var shadowOptions=$.data(this,"shadowOptions");$(this).dropShadow(shadowOptions);});};$.fn.removeShadow=function()
{return this.each(function()
{var shadowId=$(this).shadowId();$("div#"+shadowId).remove();});};$.fn.shadowId=function()
{return $.data(this[0],"shadowId");};$(function()
{var noPrint="<style type='text/css' media='print'>";noPrint+=".dropShadow{visibility:hidden;}</style>";$("head").append(noPrint);});})(jQuery);(function($){$.fn.corner=function(options){function BlendColour(Col1,Col2,Col1Fraction){var red1=parseInt(Col1.substr(1,2),16);var green1=parseInt(Col1.substr(3,2),16);var blue1=parseInt(Col1.substr(5,2),16);var red2=parseInt(Col2.substr(1,2),16);var green2=parseInt(Col2.substr(3,2),16);var blue2=parseInt(Col2.substr(5,2),16);if(Col1Fraction>1||Col1Fraction<0)Col1Fraction=1;var endRed=Math.round((red1*Col1Fraction)+(red2*(1-Col1Fraction)));if(endRed>255)endRed=255;if(endRed<0)endRed=0;var endGreen=Math.round((green1*Col1Fraction)+(green2*(1-Col1Fraction)));if(endGreen>255)endGreen=255;if(endGreen<0)endGreen=0;var endBlue=Math.round((blue1*Col1Fraction)+(blue2*(1-Col1Fraction)));if(endBlue>255)endBlue=255;if(endBlue<0)endBlue=0;return"#"+IntToHex(endRed)+IntToHex(endGreen)+IntToHex(endBlue);}
function IntToHex(strNum){base=strNum/16;rem=strNum%16;base=base-(rem/16);baseS=MakeHex(base);remS=MakeHex(rem);return baseS+''+remS;}
function MakeHex(x){if((x>=0)&&(x<=9)){return x;}else{switch(x){case 10:return"A";case 11:return"B";case 12:return"C";case 13:return"D";case 14:return"E";case 15:return"F";};return"F";};}
function pixelFraction(x,y,r){var pixelfraction=0;var xvalues=new Array(1);var yvalues=new Array(1);var point=0;var whatsides="";var intersect=Math.sqrt((Math.pow(r,2)-Math.pow(x,2)));if((intersect>=y)&&(intersect<(y+1))){whatsides="Left";xvalues[point]=0;yvalues[point]=intersect-y;point=point+1;};var intersect=Math.sqrt((Math.pow(r,2)-Math.pow(y+1,2)));if((intersect>=x)&&(intersect<(x+1))){whatsides=whatsides+"Top";xvalues[point]=intersect-x;yvalues[point]=1;point=point+1;};var intersect=Math.sqrt((Math.pow(r,2)-Math.pow(x+1,2)));if((intersect>=y)&&(intersect<(y+1))){whatsides=whatsides+"Right";xvalues[point]=1;yvalues[point]=intersect-y;point=point+1;};var intersect=Math.sqrt((Math.pow(r,2)-Math.pow(y,2)));if((intersect>=x)&&(intersect<(x+1))){whatsides=whatsides+"Bottom";xvalues[point]=intersect-x;yvalues[point]=0;};switch(whatsides){case"LeftRight":pixelfraction=Math.min(yvalues[0],yvalues[1])+((Math.max(yvalues[0],yvalues[1])-Math.min(yvalues[0],yvalues[1]))/2);break;case"TopRight":pixelfraction=1-(((1-xvalues[0])*(1-yvalues[1]))/2);break;case"TopBottom":pixelfraction=Math.min(xvalues[0],xvalues[1])+((Math.max(xvalues[0],xvalues[1])-Math.min(xvalues[0],xvalues[1]))/2);break;case"LeftBottom":pixelfraction=(yvalues[0]*xvalues[1])/2;break;default:pixelfraction=1;};return pixelfraction;}
function rgb2Hex(rgbColour){try{var rgbArray=rgb2Array(rgbColour);var red=parseInt(rgbArray[0]);var green=parseInt(rgbArray[1]);var blue=parseInt(rgbArray[2]);var hexColour="#"+IntToHex(red)+IntToHex(green)+IntToHex(blue);}catch(e){alert("There was an error converting the RGB value to Hexadecimal in function rgb2Hex");};return hexColour;}
function rgb2Array(rgbColour){var rgbValues=rgbColour.substring(4,rgbColour.indexOf(")"));var rgbArray=rgbValues.split(", ");return rgbArray;}
function format_colour(colour){var returnColour="transparent";if(colour!=""&&colour!="transparent")
{if(colour.substr(0,3)=="rgb")
{returnColour=rgb2Hex(colour);}
else if(colour.length==4)
{returnColour="#"+colour.substring(1,2)+colour.substring(1,2)+colour.substring(2,3)+colour.substring(2,3)+colour.substring(3,4)+colour.substring(3,4);}
else
{returnColour=colour;};};return returnColour;};function strip_px(value){return parseInt(((value!="auto"&&value.indexOf("%")==-1&&value!=""&&value.indexOf("px")!==-1)?value.slice(0,value.indexOf("px")):0))}
function drawPixel(box,intx,inty,colour,transAmount,height,newCorner,image,bgImage,cornerRadius,isBorder,borderWidth,boxWidth,settings){var $$=$(box);var pixel=document.createElement("div");$(pixel).css({height:height,width:"1px",position:"absolute","font-size":"1px",overflow:"hidden"});var topMaxRadius=Math.max(settings.tl?settings.tl.radius:0,settings.tr?settings.tr.radius:0);if(image==-1&&bgImage!=""){if(topMaxRadius>0)
$(pixel).css("background-position","-"+((boxWidth-cornerRadius-borderWidth)+intx)+"px -"+(($$.height()+topMaxRadius-borderWidth)-inty)+"px");else
$(pixel).css("background-position","-"+((boxWidth-cornerRadius-borderWidth)+intx)+"px -"+(($$.height())-inty)+"px");$(pixel).css({"background-image":bgImage,"background-repeat":$$.css("background-repeat"),"background-color":colour});}
else
{if(!isBorder)$(pixel).css("background-color",colour).addClass('hasBackgroundColor');else $(pixel).css("background-color",colour);};if(transAmount!=100)
setOpacity(pixel,transAmount);$(pixel).css({top:inty+"px",left:intx+"px"});return pixel;};function setOpacity(obj,opacity){opacity=(opacity==100)?99.999:opacity;if($.browser.safari&&obj.tagName!="IFRAME")
{var rgbArray=rgb2Array(obj.style.backgroundColor);var red=parseInt(rgbArray[0]);var green=parseInt(rgbArray[1]);var blue=parseInt(rgbArray[2]);obj.style.backgroundColor="rgba("+red+", "+green+", "+blue+", "+opacity/100+")";}
else if(typeof(obj.style.opacity)!="undefined")
{obj.style.opacity=opacity/100;}
else if(typeof(obj.style.MozOpacity)!="undefined")
{obj.style.MozOpacity=opacity/100;}
else if(typeof(obj.style.filter)!="undefined")
{obj.style.filter="alpha(opacity:"+opacity+")";}
else if(typeof(obj.style.KHTMLOpacity)!="undefined")
{obj.style.KHTMLOpacity=opacity/100;}}
function applyCorners(box,settings){var $$=$(box);var thebgImage=$$.css("backgroundImage");var topContainer=null;var bottomContainer=null;var masterCorners=new Array();var contentDIV=null;var boxHeight=strip_px($$.css("height"))?strip_px($$.css("height")):box.scrollHeight;var boxWidth=strip_px($$.css("width"))?strip_px($$.css("width")):box.scrollWidth;var borderWidth=strip_px($$.css("borderTopWidth"))?strip_px($$.css("borderTopWidth")):0;var boxPaddingTop=strip_px($$.css("paddingTop"));var boxPaddingBottom=strip_px($$.css("paddingBottom"));var boxPaddingLeft=strip_px($$.css("paddingLeft"));var boxPaddingRight=strip_px($$.css("paddingRight"));var boxColour=format_colour($$.css("backgroundColor"));var bgImage=(thebgImage!="none"&&thebgImage!="initial")?thebgImage:"";var borderColour=format_colour($$.css("borderTopColor"));var borderString=borderWidth+"px"+" solid "+borderColour;var topMaxRadius=Math.max(settings.tl?settings.tl.radius:0,settings.tr?settings.tr.radius:0);var botMaxRadius=Math.max(settings.bl?settings.bl.radius:0,settings.br?settings.br.radius:0);$$.addClass('hasCorners').css({"padding":"0","borderColor":box.style.borderColour,'overflow':'visible'});if(box.style.position!="absolute")$$.css("position","relative");if(($.browser.msie)){if($.browser.version==6&&box.style.width=="auto"&&box.style.height=="auto")$$.css("width","100%");$$.css("zoom","1");$($$+" *").css("zoom","normal");}
for(var t=0;t<2;t++){switch(t){case 0:if(settings.tl||settings.tr){var newMainContainer=document.createElement("div");topContainer=box.appendChild(newMainContainer);$(topContainer).css({width:"100%","font-size":"1px",overflow:"hidden",position:"absolute","padding-left":borderWidth,"padding-right":borderWidth,height:topMaxRadius+"px",top:0-topMaxRadius+"px",left:0-borderWidth+"px"}).addClass('topContainer');};break;case 1:if(settings.bl||settings.br){var newMainContainer=document.createElement("div");bottomContainer=box.appendChild(newMainContainer);$(bottomContainer).css({width:"100%","font-size":"1px",overflow:"hidden",position:"absolute","padding-left":borderWidth,"padding-right":borderWidth,height:botMaxRadius,bottom:0-botMaxRadius+"px",left:0-borderWidth+"px"}).addClass('bottomContainer');};break;};};if(settings.autoPad==true){var contentContainer=document.createElement("div");var contentContainer2=document.createElement("div");var clearDiv=document.createElement("div");$(contentContainer2).css({margin:"0","padding-bottom":boxPaddingBottom,"padding-top":boxPaddingTop,"padding-left":boxPaddingLeft,"padding-right":boxPaddingRight,'overflow':'visible'}).addClass('hasBackgroundColor content_container');$(contentContainer).css({position:"relative",'float':"left",width:"100%","margin-top":"-"+(topMaxRadius-borderWidth)+"px","margin-bottom":"-"+(botMaxRadius-borderWidth)+"px"}).addClass="autoPadDiv";$(clearDiv).css("clear","both");contentContainer2.appendChild(contentContainer);contentContainer2.appendChild(clearDiv);$$.wrapInner(contentContainer2);};if(topContainer)$$.css("border-top",0);if(bottomContainer)$$.css("border-bottom",0);var corners=["tr","tl","br","bl"];for(var i in corners){if(i>-1<4){var cc=corners[i];if(!settings[cc]){if(((cc=="tr"||cc=="tl")&&topContainer!=null)||((cc=="br"||cc=="bl")&&bottomContainer!=null)){var newCorner=document.createElement("div");$(newCorner).css({position:"relative","font-size":"1px",overflow:"hidden"});if(bgImage=="")
$(newCorner).css("background-color",boxColour);else
$(newCorner).css("background-image",bgImage).css("background-color",boxColour);;switch(cc)
{case"tl":$(newCorner).css({height:topMaxRadius-borderWidth,"margin-right":settings.tr.radius-(borderWidth*2),"border-left":borderString,"border-top":borderString,left:-borderWidth+"px","background-repeat":$$.css("background-repeat"),"background-position":borderWidth+"px 0px"});break;case"tr":$(newCorner).css({height:topMaxRadius-borderWidth,"margin-left":settings.tl.radius-(borderWidth*2),"border-right":borderString,"border-top":borderString,left:borderWidth+"px","background-repeat":$$.css("background-repeat"),"background-position":"-"+(topMaxRadius+borderWidth)+"px 0px"});break;case"bl":if(topMaxRadius>0)
$(newCorner).css({height:botMaxRadius-borderWidth,"margin-right":settings.br.radius-(borderWidth*2),"border-left":borderString,"border-bottom":borderString,left:-borderWidth+"px","background-repeat":$$.css("background-repeat"),"background-position":"0px -"+($$.height()+topMaxRadius-borderWidth+1)+"px"});else
$(newCorner).css({height:botMaxRadius-borderWidth,"margin-right":settings.br.radius-(borderWidth*2),"border-left":borderString,"border-bottom":borderString,left:-borderWidth+"px","background-repeat":$$.css("background-repeat"),"background-position":"0px -"+($$.height())+"px"});break;case"br":if(topMaxRadius>0)
$(newCorner).css({height:botMaxRadius-borderWidth,"margin-left":settings.bl.radius-(borderWidth*2),"border-right":borderString,"border-bottom":borderString,left:borderWidth+"px","background-repeat":$$.css("background-repeat"),"background-position":"-"+settings.bl.radius+borderWidth+"px -"+($$.height()+topMaxRadius-borderWidth+1)+"px"});else
$(newCorner).css({height:botMaxRadius-borderWidth,"margin-left":settings.bl.radius-(borderWidth*2),"border-right":borderString,"border-bottom":borderString,left:borderWidth+"px","background-repeat":$$.css("background-repeat"),"background-position":"-"+settings.bl.radius+borderWidth+"px -"+($$.height())+"px"});break;};};}else{if(masterCorners[settings[cc].radius]){var newCorner=masterCorners[settings[cc].radius].cloneNode(true);}else{var newCorner=document.createElement("DIV");$(newCorner).css({height:settings[cc].radius,width:settings[cc].radius,position:"absolute","font-size":"1px",overflow:"hidden"});var borderRadius=parseInt(settings[cc].radius-borderWidth);for(var intx=0,j=settings[cc].radius;intx<j;intx++){if((intx+1)>=borderRadius)
var y1=-1;else
var y1=(Math.floor(Math.sqrt(Math.pow(borderRadius,2)-Math.pow((intx+1),2)))-1);if(borderRadius!=j){if((intx)>=borderRadius)
var y2=-1;else
var y2=Math.ceil(Math.sqrt(Math.pow(borderRadius,2)-Math.pow(intx,2)));if((intx+1)>=j)
var y3=-1;else
var y3=(Math.floor(Math.sqrt(Math.pow(j,2)-Math.pow((intx+1),2)))-1);};if((intx)>=j)
var y4=-1;else
var y4=Math.ceil(Math.sqrt(Math.pow(j,2)-Math.pow(intx,2)));if(y1>-1)newCorner.appendChild(drawPixel(box,intx,0,boxColour,100,(y1+1),newCorner,-1,bgImage,settings[cc].radius,0,borderWidth,boxWidth,settings));if(borderRadius!=j){for(var inty=(y1+1);inty<y2;inty++){if(settings.antiAlias){if(bgImage!=""){var borderFract=(pixelFraction(intx,inty,borderRadius)*100);if(borderFract<30){newCorner.appendChild(drawPixel(box,intx,inty,borderColour,100,1,newCorner,0,bgImage,settings[cc].radius,1,borderWidth,boxWidth,settings));}else{newCorner.appendChild(drawPixel(box,intx,inty,borderColour,100,1,newCorner,-1,bgImage,settings[cc].radius,1,borderWidth,boxWidth,settings));};}else{var pixelcolour=BlendColour(boxColour,borderColour,pixelFraction(intx,inty,borderRadius));newCorner.appendChild(drawPixel(box,intx,inty,pixelcolour,100,1,newCorner,0,bgImage,settings[cc].radius,cc,1,borderWidth,boxWidth,settings));};};};if(settings.antiAlias){if(y3>=y2)
{if(y2==-1)y2=0;newCorner.appendChild(drawPixel(box,intx,y2,borderColour,100,(y3-y2+1),newCorner,0,bgImage,0,1,borderWidth,boxWidth,settings));}}else{if(y3>=y1)
{newCorner.appendChild(drawPixel(box,intx,(y1+1),borderColour,100,(y3-y1),newCorner,0,bgImage,0,1,borderWidth,boxWidth,settings));}};var outsideColour=borderColour;}else{var outsideColour=boxColour;var y3=y1;};if(settings.antiAlias){for(var inty=(y3+1);inty<y4;inty++){newCorner.appendChild(drawPixel(box,intx,inty,outsideColour,(pixelFraction(intx,inty,j)*100),1,newCorner,((borderWidth>0)?0:-1),bgImage,settings[cc].radius,1,borderWidth,boxWidth,settings));};};};masterCorners[settings[cc].radius]=newCorner.cloneNode(true);};if(cc!="br"){for(var t=0,k=newCorner.childNodes.length;t<k;t++){var pixelBar=newCorner.childNodes[t];var pixelBarTop=strip_px($(pixelBar).css("top"));var pixelBarLeft=strip_px($(pixelBar).css("left"));var pixelBarHeight=strip_px($(pixelBar).css("height"));if(cc=="tl"||cc=="bl"){$(pixelBar).css("left",settings[cc].radius-pixelBarLeft-1+"px");};if(cc=="tr"||cc=="tl"){$(pixelBar).css("top",settings[cc].radius-pixelBarHeight-pixelBarTop+"px");};switch(cc){case"tr":$(pixelBar).css("background-position","-"+Math.abs((boxWidth-settings[cc].radius+borderWidth)+pixelBarLeft)+"px -"+Math.abs(settings[cc].radius-pixelBarHeight-pixelBarTop-borderWidth)+"px");break;case"tl":$(pixelBar).css("background-position","-"+Math.abs((settings[cc].radius-pixelBarLeft-1)-borderWidth)+"px -"+Math.abs(settings[cc].radius-pixelBarHeight-pixelBarTop-borderWidth)+"px");break;case"bl":if(topMaxRadius>0)
$(pixelBar).css("background-position","-"+Math.abs((settings[cc].radius-pixelBarLeft-1)-borderWidth)+"px -"+Math.abs(($$.height()+topMaxRadius-borderWidth+1))+"px");else
$(pixelBar).css("background-position","-"+Math.abs((settings[cc].radius-pixelBarLeft-1)-borderWidth)+"px -"+Math.abs(($$.height()))+"px");break;};};};};if(newCorner){switch(cc){case"tl":if($(newCorner).css("position")=="absolute")$(newCorner).css("top","0");if($(newCorner).css("position")=="absolute")$(newCorner).css("left","0");if(topContainer)topContainer.appendChild(newCorner);break;case"tr":if($(newCorner).css("position")=="absolute")$(newCorner).css("top","0");if($(newCorner).css("position")=="absolute")$(newCorner).css("right","0");if(topContainer)topContainer.appendChild(newCorner);break;case"bl":if($(newCorner).css("position")=="absolute")$(newCorner).css("bottom","0");if(newCorner.style.position=="absolute")$(newCorner).css("left","0");if(bottomContainer)bottomContainer.appendChild(newCorner);break;case"br":if($(newCorner).css("position")=="absolute")$(newCorner).css("bottom","0");if($(newCorner).css("position")=="absolute")$(newCorner).css("right","0");if(bottomContainer)bottomContainer.appendChild(newCorner);break;};};};};var radiusDiff=new Array();radiusDiff["t"]=Math.abs(settings.tl.radius-settings.tr.radius);radiusDiff["b"]=Math.abs(settings.bl.radius-settings.br.radius);for(z in radiusDiff){if(z=="t"||z=="b"){if(radiusDiff[z]){var smallerCornerType=((settings[z+"l"].radius<settings[z+"r"].radius)?z+"l":z+"r");var newFiller=document.createElement("div");$(newFiller).css({height:radiusDiff[z],width:settings[smallerCornerType].radius+"px",position:"absolute","font-size":"1px",overflow:"hidden","background-color":boxColour,"background-image":bgImage});switch(smallerCornerType)
{case"tl":$(newFiller).css({"bottom":"0","left":"0","border-left":borderString,"background-position":"0px -"+(settings[smallerCornerType].radius-borderWidth)});topContainer.appendChild(newFiller);break;case"tr":$(newFiller).css({"bottom":"0","right":"0","border-right":borderString,"background-position":"0px -"+(settings[smallerCornerType].radius-borderWidth)+"px"});topContainer.appendChild(newFiller);break;case"bl":$(newFiller).css({"top":"0","left":"0","border-left":borderString,"background-position":"0px -"+($$.height()+settings[smallerCornerType].radius-borderWidth)});bottomContainer.appendChild(newFiller);break;case"br":$(newFiller).css({"top":"0","right":"0","border-right":borderString,"background-position":"0px -"+($$.height()+settings[smallerCornerType].radius-borderWidth)});bottomContainer.appendChild(newFiller);break;}};var newFillerBar=document.createElement("div");$(newFillerBar).css({position:"relative","font-size":"1px",overflow:"hidden","background-color":boxColour,"background-image":bgImage,"background-repeat":$$.css("background-repeat")});switch(z){case"t":if(topContainer){if(settings.tl.radius&&settings.tr.radius){$(newFillerBar).css({height:topMaxRadius-borderWidth+"px","margin-left":settings.tl.radius-borderWidth+"px","margin-right":settings.tr.radius-borderWidth+"px","border-top":borderString}).addClass('hasBackgroundColor');if(bgImage!="")
$(newFillerBar).css("background-position","-"+(topMaxRadius+borderWidth)+"px 0px");topContainer.appendChild(newFillerBar);};$$.css("background-position","0px -"+(topMaxRadius-borderWidth+1)+"px");};break;case"b":if(bottomContainer){if(settings.bl.radius&&settings.br.radius){$(newFillerBar).css({height:botMaxRadius-borderWidth+"px","margin-left":settings.bl.radius-borderWidth+"px","margin-right":settings.br.radius-borderWidth+"px","border-bottom":borderString});if(bgImage!=""&&topMaxRadius>0)
$(newFillerBar).css("background-position","-"+(settings.bl.radius-borderWidth)+"px -"+($$.height()+topMaxRadius-borderWidth+1)+"px");else
$(newFillerBar).css("background-position","-"+(settings.bl.radius-borderWidth)+"px -"+($$.height())+"px").addClass('hasBackgroundColor');bottomContainer.appendChild(newFillerBar);};};break;};};};$$.prepend(topContainer);$$.prepend(bottomContainer);}
var settings={tl:{radius:8},tr:{radius:8},bl:{radius:8},br:{radius:8},antiAlias:true,autoPad:true,validTags:["div"]};if(options&&typeof(options)!='string')
$.extend(settings,options);return this.each(function(){if(!$(this).is('.hasCorners')){applyCorners(this,settings);}});};})(jQuery);

function arrayIntersection(array1,array2){var intersectionArray=[];for(var i=0;i<array1.length;i++){if(array2.indexOf(array1[i])!=-1){intersectionArray.push(array1[i]);}}
return intersectionArray;}
function arrayMultiIntersection(arraySet){var commonArrayHolder={};var multiIntersection=[];var numArrays=0;var arraySetLength=arraySet.length;for(var i=0;i<arraySetLength;i++){var innerArraySetLength=arraySet[i].length;for(var k=0;k<innerArraySetLength;k++){if(!commonArrayHolder[arraySet[i][k]]){commonArrayHolder[arraySet[i][k]]=0;}
commonArrayHolder[arraySet[i][k]]++;}
numArrays++;}
for(index in commonArrayHolder){if(commonArrayHolder[index]==numArrays){multiIntersection.push(index);}}
return multiIntersection;}
if(!TP){var TP={};}
if(!TP.Site){TP.Site={};}
TP.Site.CategoryPage=Class.create({itemsPerPage:24,currentPage:1,currentSort:'rec',viewAll:false,storeName:null,productThumbUrl:null,productPreviewUrl:null,ratingPrefixUrl:null,products:null,colors:null,filters:null,vendors:null,sorts:null,sortSelect1:null,sortSelect2:null,itemsPerPageSelect1:null,itemsPerPageSelect2:null,paginator:null,quickView:null,filterObjects:null,numResults:null,activePids:null,productBoxCache:null,lastColorCategoryId:null,studioBasicsHelpBox:null,initialize:function(storeName){var windowWidth=document.viewport.getWidth();var windowHeight=document.viewport.getHeight();var previewTop=0;var previewLeft=0;this.storeName=storeName;this.productThumbUrl=urlThumbProduct;this.productPreviewUrl=urlPreviewProduct;this.ratingPrefixUrl=ratingImageURLPrefix;this.vendors=vendors;this.products=products;this.filters=filters;this.colors=colors;this.productBoxCache={};this.sorts={};this.quickView=new TP.Site.CategoryPage.QuickView();this.sorts['rec']=sortDefault;this.sorts['new']=sortDate;this.sorts['lth']=sortPrice;this.sorts['htl']=sortPrice.slice().reverse();this.sorts['rat']=sortRating;this.sortSelect1=$('nav_sortBy1');this.sortSelect2=$('nav_sortBy2');this.sortSelect1.observe('change',this.changeSort.bind(this,this.sortSelect1));this.sortSelect2.observe('change',this.changeSort.bind(this,this.sortSelect2));this.itemsPerPageSelect1=$('nav_ipp1');this.itemsPerPageSelect2=$('nav_ipp2');this.itemsPerPageSelect1.observe('change',this.changeItemsPerPage.bind(this,this.itemsPerPageSelect1));this.itemsPerPageSelect2.observe('change',this.changeItemsPerPage.bind(this,this.itemsPerPageSelect2));if(this.storeName=='tinyprints'){this.studioBasicsHelpBox=new TP.Site.CategoryPage.HelpBox('studioBasicsHelp');}
this.paginator=new TP.Site.CategoryPage.Paginator(this);if(windowHeight>400){previewTop=Math.max((windowHeight-400)/2,160);}
if(windowWidth>500){previewLeft=(windowWidth-500)/2;}
$("categoryBody_preview").setStyle({'top':previewTop+'px','left':previewLeft+'px'});$("categoryBody_info").setStyle({'top':(previewTop+100)+'px','left':(previewLeft+200)+'px'});this.constructFilters();this.processQueryStrings();this.handleFilterChange();setCookie("catalogContext",window.location.pathname);setCookie("categoryName",categoryHeader);Event.observe(window,'unload',this.unloadHandler.bind(this));},constructFilters:function(){this.filterObjects={};for(filterElement in this.filters){switch(filterElement){case'prices':this.filterObjects[filterElement]=new TP.Site.CategoryPage.PriceFilter(filterElement,this.filters[filterElement],this);break;case'colors':this.filterObjects[filterElement]=new TP.Site.CategoryPage.ColorFilter(filterElement,this.filters[filterElement],this);break;case'cardFormats':this.filterObjects[filterElement]=new TP.Site.CategoryPage.CardFormatFilter(filterElement,this.filters[filterElement],this);break;case'cardSizes':this.filterObjects[filterElement]=new TP.Site.CategoryPage.CardSizeFilter(filterElement,this.filters[filterElement],this);break;case'photos':this.filterObjects[filterElement]=new TP.Site.CategoryPage.NumberPhotosFilter(filterElement,this.filters[filterElement],this);break;case'printTypes':this.filterObjects[filterElement]=new TP.Site.CategoryPage.PrintTypeFilter(filterElement,this.filters[filterElement],this);break;case'papers':this.filterObjects[filterElement]=new TP.Site.CategoryPage.PaperTypeFilter(filterElement,this.filters[filterElement],this);break;case'vendors':this.filterObjects[filterElement]=new TP.Site.CategoryPage.VendorFilter(filterElement,this.filters[filterElement],this);break;}}},changeSort:function(changedSelect){var index=0;var sortSelectLength=this.sortSelect1.length;this.currentSort=changedSelect.value;for(index=0;index<sortSelectLength;index++){if(this.sortSelect1.options[index].value==this.currentSort){this.sortSelect1.options[index].selected=true;this.sortSelect2.options[index].selected=true;}}
window.dhtmlHistory.add(this.getCurrentUrl(),'');this.handleFilterChange();},changeItemsPerPage:function(changedSelect){var index=0;var itemsPerPageSelectLength=this.itemsPerPageSelect1.length;this.itemsPerPage=changedSelect.value;for(index=0;index<itemsPerPageSelectLength;index++){if(this.itemsPerPageSelect1.options[index].value==this.itemsPerPage){this.itemsPerPageSelect1.options[index].selected=true;this.itemsPerPageSelect2.options[index].selected=true;}}
window.dhtmlHistory.add(this.getCurrentUrl(),'');this.render();},changePage:function(page){this.currentPage=page;window.dhtmlHistory.add(this.getCurrentUrl(),'');this.render();},toggleViewAll:function(viewAll){this.viewAll=viewAll;window.dhtmlHistory.add(this.getCurrentUrl(),'');this.render();},handleFilterChange:function(){var intersection=[];var filteredPidSet=[];if(!$('categoryBody_info').visible()){$('categoryBody_info').show();}
for(filterName in this.filterObjects){if(this.filterObjects[filterName]){this.filterObjects[filterName].filteredPids=[];this.filterObjects[filterName].filteredPids=this.filterObjects[filterName].qualifyingProducts(this.sorts[this.currentSort],this.products);filteredPidSet.push(this.filterObjects[filterName].filteredPids);}}
intersection=arrayMultiIntersection(filteredPidSet);for(filterName in this.filterObjects){this.filterObjects[filterName].rerenderCount(this.filterObjects,this.products);}
this.activePids=intersection;this.numResults=intersection.length;$('categoryBody_body_nav_title_number1').update(this.numResults);$('categoryBody_body_nav_title_number2').update(this.numResults);$('categoryBody_search_control_number').update(this.numResults);$('categoryBody_info_number').update(this.numResults);this.render();},render:function(){var startIndex;var endIndex;var checkedColors=[];var i;this.paginator.update(this);$('categoryBody_body_body').update('');startIndex=(this.currentPage-1)*this.itemsPerPage;endIndex=this.itemsPerPage*this.currentPage;if(this.viewAll){startIndex=0;endIndex=this.activePids.length;}
if(this.filterObjects['colors']){checkedColors=this.filterObjects['colors'].getCheckedColorCategories();}
for(i=startIndex;i<endIndex;i++){if(this.products[this.activePids[i]]){if(this.productBoxCache[this.activePids[i]]){this.productBoxCache[this.activePids[i]].initialize(this.products[this.activePids[i]],this.quickView);}else{this.productBoxCache[this.activePids[i]]=new TP.Site.CategoryPage.ProductBox(this.products[this.activePids[i]],this.quickView);}
this.productBoxCache[this.activePids[i]].selectBestColor(checkedColors,this.lastColorCategoryId);$('categoryBody_body_body').insert(this.productBoxCache[this.activePids[i]].getProductBox());}}
if(!$('categoryBody_info').style.opacity||$('categoryBody_info').style.opacity==1){Effect.Fade('categoryBody_info',{duration:1.0});}},processQueryStrings:function(){var url=window.location.href;var urlArray=url.split('#');var queryString,parameters,filterValues,filterIndex,validEntry,index;var itemsPerPageLength,sortSelectLength;var pricesSet=false;if(hideStudioBasics){if(this.filterObjects['prices']&&this.filterObjects['prices'].checkboxes){for(filterValue in this.filterObjects['prices'].checkboxes){if(this.filterObjects['prices'].checkboxes[filterValue].checked==true){pricesSet=true;break;}}}}
if(urlArray.length==1){urlArray=url.split('?');if(urlArray.length==1){}}
queryString=urlArray.pop();parameters=queryString.toQueryParams();if(parameters){for(parameter in parameters){switch(parameter){case'prices':pricesSet=true;case'printTypes':case'cardSizes':case'photos':case'colors':case'vendors':case'papers':case'cardFormats':filterValues=parameters[parameter].split(',');for(filterIndex=0;filterIndex<filterValues.length;filterIndex++){if(this.filterObjects[parameter]){this.filterObjects[parameter].toggleFilter(filterValues[filterIndex],true);}}
break;case'paperTypes':filterValues=parameters[parameter].split(',');for(filterIndex=0;filterIndex<filterValues.length;filterIndex++){if(this.filterObjects['papers']){this.filterObjects['papers'].toggleFilter(filterValues[filterIndex],true);}}
break;case'cardTypes':filterValues=parameters[parameter].split(',');for(filterIndex=0;filterIndex<filterValues.length;filterIndex++){if(this.filterObjects['cardFormats']){this.filterObjects['cardFormats'].toggleFilter(filterValues[filterIndex],true);}}
break;case'page':if(parseInt(parameters[parameter])){this.currentPage=parameters[parameter];}else{this.currentPage=1;}
break;case'per':if(parseInt(parameters[parameter])){this.itemsPerPage=parameters[parameter];validEntry=false;itemsPerPageLength=this.itemsPerPageSelect1.length;for(index=0;index<itemsPerPageLength;index++){if(this.itemsPerPageSelect1.options[index].value==this.itemsPerPage){validEntry=true;this.itemsPerPageSelect1.options[index].selected=true;this.itemsPerPageSelect2.options[index].selected=true;}}
if(!validEntry){this.itemsPerPage=24;}}
break;case'sort':this.currentSort=parameters[parameter];validEntry=false;sortSelectLength=this.sortSelect1.length;for(index=0;index<sortSelectLength;index++){if(this.sortSelect1.options[index].value==this.currentSort){validEntry=true;this.sortSelect1.options[index].selected=true;this.sortSelect2.options[index].selected=true;}}
if(!validEntry){this.currentSort='rec';}
break;case'all':if(parameters[parameter]==1){this.viewAll=true;}
break;}}}
if(!pricesSet){if(hideStudioBasics){if(this.filterObjects['prices']&&this.filterObjects['prices'].checkboxes){for(filterValue in this.filterObjects['prices'].checkboxes){if(filterValue!=0){this.filterObjects['prices'].checkboxes[filterValue].checked=true;}}}}}},getCurrentUrl:function(){var hashString='';var filterCheckboxValues;if(this.itemsPerPage!=24){hashString+='per='+this.itemsPerPage+'&';}
if(this.currentPage!=0){hashString+='page='+this.currentPage+'&';}
if(this.currentSort!='rec'){hashString+='sort='+this.currentSort+'&';}
if(this.viewAll){hashString+='all=1&';}
if(this.filterObjects){for(filterName in this.filterObjects){filterCheckboxValues=[];for(filterValue in this.filterObjects[filterName].checkboxes){if(this.filterObjects[filterName].checkboxes&&this.filterObjects[filterName].checkboxes[filterValue].checked){filterCheckboxValues.push(filterValue);}}
if(filterCheckboxValues.length>0){hashString+=filterName+'='+filterCheckboxValues.join(',')+'&';}}}
return hashString;},unloadHandler:function(){window.dhtmlHistory.add(this.getCurrentUrl(),'');}});TP.Site.CategoryPage.HelpBox=Class.create({id:null,initialize:function(id){this.id=id;$(this.id+'Icon').observe('click',this.showSelf.bind(this));$(this.id+'Close').observe('click',this.hideSelf.bind(this));$(this.id+'CloseIcon').observe('click',this.hideSelf.bind(this));new Draggable(id,{handle:this.id+'Head'});},showSelf:function(e){new Effect.Appear(this.id,{duration:0.3});Event.stop(e);},hideSelf:function(e){new Effect.Fade(this.id,{duration:0.3});Event.stop(e);}});TP.Site.CategoryPage.HistoryHandler=Class.create({initialize:function(categoryController){},handleHistory:function(newLocation,historyData){cp.processQueryStrings();cp.handleFilterChange();}});TP.Site.CategoryPage.QuickView=Class.create({mainWindow:null,currentPid:null,nameDiv:null,previewImage:null,descriptionDiv:null,papersDiv:null,papersList:null,button:null,destinationUrl:null,colorsDiv:null,colorsListContainer:null,colorsList:null,colorsObjects:null,currentColorNumber:null,initialize:function(){this.mainWindow=$('categoryBody_preview');this.nameDiv=$('categoryBody_preview_name');this.previewImage=$('categoryBody_preview_body_imageUrl');this.descriptionDiv=$('categoryBody_preview_body_desc_text');this.colorsDiv=$('categoryBody_preview_body_desc_colors');this.colorsListContainer=$('categoryBody_preview_body_desc_colors_list');this.papersDiv=$('categoryBody_preview_body_desc_papers');this.papersList=$('categoryBody_preview_body_desc_papers_names');this.button=$('categoryBody_preview_body_desc_button');$('categoryBody_preview_close').observe('click',this.hideQuickview.bind(this));this.button.observe('click',this.goDestinationUrl.bind(this));new Draggable('categoryBody_preview',{handle:'categoryBody_preview_title'});},showQuickview:function(productBox){var preloader;var colorCount;this.previewImage.src=spinner;this.nameDiv.update(productBox.productObject.name);this.currentPid=productBox.productId;this.currentColorNumber=productBox.color;this.destinationUrl='/product/'+this.currentPid+'/'+productBox.productObject.url+'.html';preloader=new Element('img',{'src':urlPreviewProduct.replace(/\{pid\}/,this.currentPid).replace(/\{colorNum\}/,this.currentColorNumber)});preloader.observe('load',$(function(preloader){this.src=preloader.src;}).bind(this.previewImage,preloader));this.descriptionDiv.update('');this.descriptionDiv.insert(new Element('strong').update('Card Details :'));this.descriptionDiv.insert(new Element('br'));if(cardTypes[productBox.productObject.cardTypeId]){this.descriptionDiv.insert(cardTypes[productBox.productObject.cardTypeId]+' Card');this.descriptionDiv.insert(new Element('br'));}
this.descriptionDiv.insert(cardSizes[productBox.productObject.cardSizeId]+' (w x h)');this.descriptionDiv.insert(new Element('br'));this.descriptionDiv.insert('By '+realVendors[productBox.productObject.realVId]);this.descriptionDiv.insert(new Element('br'));if(productBox.productObject.ratingCount&&productBox.productObject.ratingCount>0){this.descriptionDiv.insert(productBox.ratingLink);}
this.papersDiv.hide();colorCount=0;if(productBox.productObject.colors){this.colorsListContainer.update('');this.colorsObjects=[];this.colorsList=new Element('ul',{'class':'colorBoxContainer'});for(colorCategoryId in productBox.productObject.colors){var colorBox=new Element('li',{'class':'colorBox','title':productBox.productObject.colors[colorCategoryId].name});colorBox.setStyle({backgroundColor:'#'+productBox.productObject.colors[colorCategoryId].rgb});colorBox.number=productBox.productObject.colors[colorCategoryId].number;if(productBox.color==productBox.productObject.colors[colorCategoryId].number){colorBox.addClassName('colorBoxOn');}
colorBox.observe('click',this.changeColor.bind(this,productBox.productObject.colors[colorCategoryId].number));this.colorsObjects.push(colorBox);this.colorsList.insert(colorBox);colorCount++;}
this.colorsListContainer.insert(this.colorsList);}
if(colorCount>1){this.colorsDiv.show();}else{this.colorsDiv.hide();}
new Effect.Appear(this.mainWindow,{duration:0.3});},changeColor:function(number){var i;var colorObjectsLength;this.currentColorNumber=number;colorObjectsLength=this.colorsObjects.length;for(i=0;i<colorObjectsLength;i++){if(this.colorsObjects[i].number==number){this.colorsObjects[i].addClassName('colorBoxOn');}else{this.colorsObjects[i].removeClassName('colorBoxOn');}}
this.previewImage.src=urlPreviewProduct.replace(/\{pid\}/,this.currentPid).replace(/\{colorNum\}/,this.currentColorNumber);},goDestinationUrl:function(){window.location.href=this.destinationUrl+'#color/'+this.currentColorNumber;},hideQuickview:function(){this.mainWindow.hide();}});TP.Site.CategoryPage.Paginator=Class.create({maxPageSpan:9,currentPage:null,itemsPerPage:null,viewAll:null,paginatorElement1:null,paginatorElement2:null,initialize:function(controller){this.currentPage=controller.currentPage;this.itemsPerPage=controller.itemsPerPage;this.viewAll=controller.viewAll;this.paginatorElement1=$('nav_pages1');this.paginatorElement2=$('nav_pages2');},update:function(controller){var maxPages,pageSpan,startPage,endPage;var i;this.currentPage=controller.currentPage;this.itemsPerPage=controller.itemsPerPage;this.viewAll=controller.viewAll;this.paginatorElement1.update('');this.paginatorElement2.update('');maxPages=Math.ceil(controller.activePids.length/this.itemsPerPage);if(maxPages==0){this.currentPage=1;controller.currentPage=1;}else if(this.currentPage>maxPages){this.currentPage=maxPages;controller.currentPage=maxPages;}
if(this.viewAll==false){this.paginatorElement1.insert(new Element('a').update('View All').observe('click',controller.toggleViewAll.bind(controller,true)));this.paginatorElement2.insert(new Element('a').update('View All').observe('click',controller.toggleViewAll.bind(controller,true)));}else{this.paginatorElement1.insert(new Element('a').update('View Pages').observe('click',controller.toggleViewAll.bind(controller,false)));this.paginatorElement2.insert(new Element('a').update('View Pages').observe('click',controller.toggleViewAll.bind(controller,false)));}
if(this.viewAll){this.paginatorElement1.insert(new Element('span',{'class':'prev_page'}));this.paginatorElement2.insert(new Element('span',{'class':'prev_page'}));this.paginatorElement1.insert(new Element('strong').update(1));this.paginatorElement2.insert(new Element('strong').update(1));this.paginatorElement1.insert(new Element('span',{'class':'next_page'}));this.paginatorElement2.insert(new Element('span',{'class':'next_page'}));}else{if(this.currentPage==1){this.paginatorElement1.insert(new Element('span',{'class':'prev_page'}));this.paginatorElement2.insert(new Element('span',{'class':'prev_page'}));}else{this.paginatorElement1.insert(new Element('span',{'class':'prev_page','style':'cursor: pointer;'}).observe('click',controller.changePage.bind(controller,this.currentPage-1)));this.paginatorElement2.insert(new Element('span',{'class':'prev_page','style':'cursor: pointer;'}).observe('click',controller.changePage.bind(controller,this.currentPage-1)));}
if(maxPages>this.maxPageSpan){if(this.currentPage==1){this.paginatorElement1.insert(new Element('strong').update(1));this.paginatorElement2.insert(new Element('strong').update(1));}else{this.paginatorElement1.insert(new Element('a').update(1).observe('click',controller.changePage.bind(controller,1)));this.paginatorElement2.insert(new Element('a').update(1).observe('click',controller.changePage.bind(controller,1)));}
pageSpan=Math.floor(this.maxPageSpan/2);if((this.currentPage-pageSpan)>1){this.paginatorElement1.insert('...');this.paginatorElement2.insert('...');}
startPage=Math.max(2,this.currentPage-pageSpan);endPage=Math.min(maxPages-1,this.currentPage+pageSpan);for(i=startPage;i<=endPage;i++){if(i==this.currentPage){this.paginatorElement1.insert(new Element('strong').update(i));this.paginatorElement2.insert(new Element('strong').update(i));}else{this.paginatorElement1.insert(new Element('a').update(i).observe('click',controller.changePage.bind(controller,i)));this.paginatorElement2.insert(new Element('a').update(i).observe('click',controller.changePage.bind(controller,i)));}}
if((this.currentPage+pageSpan)<(maxPages-1)){this.paginatorElement1.insert('...');this.paginatorElement2.insert('...');}
if(this.currentPage==maxPages){this.paginatorElement1.insert(new Element('strong').update(maxPages));this.paginatorElement2.insert(new Element('strong').update(maxPages));}else{this.paginatorElement1.insert(new Element('a').update(maxPages).observe('click',controller.changePage.bind(controller,maxPages)));this.paginatorElement2.insert(new Element('a').update(maxPages).observe('click',controller.changePage.bind(controller,maxPages)));}}else{for(i=1;i<=maxPages;i++){if(i==this.currentPage){this.paginatorElement1.insert(new Element('strong').update(i));this.paginatorElement2.insert(new Element('strong').update(i));}else{this.paginatorElement1.insert(new Element('a').update(i).observe('click',controller.changePage.bind(controller,i)));this.paginatorElement2.insert(new Element('a').update(i).observe('click',controller.changePage.bind(controller,i)));}}}
if(this.currentPage==maxPages){this.paginatorElement1.insert(new Element('span',{'class':'next_page'}));this.paginatorElement2.insert(new Element('span',{'class':'next_page'}));}else{this.paginatorElement1.insert(new Element('span',{'class':'next_page','style':'cursor: pointer;'}).observe('click',controller.changePage.bind(controller,this.currentPage+1)));this.paginatorElement2.insert(new Element('span',{'class':'next_page','style':'cursor: pointer;'}).observe('click',controller.changePage.bind(controller,this.currentPage+1)));}}}});TP.Site.CategoryPage.ProductBox=Class.create({productBox:null,productId:null,productObject:null,thumbnailDiv:null,thumbnailLink:null,thumbnailImage:null,quickViewDiv:null,productLink:null,ratingLink:null,ratingImage:null,description:null,priceDescription:null,color:1,colorCategoryToNumber:null,colorBoxes:null,colorSpan:null,currentTimeout:null,initialize:function(productObject,quickView){var ratingString;var colorCount;this.productObject=productObject;this.productId=productObject.id;this.productBox=new Element('div',{'class':'productBox'});this.thumbnailDiv=new Element('div',{'id':'product_'+this.productId,'class':'productImage'});this.thumbnailImage=new Element('img',{'id':'product_link_'+this.productId,'src':this.getThumbnailUrl(),'alt':classes[productObject['classId']]+' '+productObject['name']});this.thumbnailLink=new Element('a',{'href':'/product/'+this.productId+'/'+productObject.url+'.html','class':'img'});this.thumbnailLink.insert(this.thumbnailImage);this.thumbnailDiv.insert(this.thumbnailLink);this.quickViewDiv=new Element('div',{'id':'zoom_'+this.productId,'class':'productZoom'});this.quickViewDiv.hide();this.productLink=new Element('a',{'class':'productName','href':'/product/'+this.productId+'/'+productObject.url+'.html'}).update(productObject.name);if(productObject.ratingCount&&productObject.ratingCount>0){ratingString=productObject.rating.toString().replace('.','_');this.ratingLink=new Element('a',{'class':'ratingImage img','href':'/product/'+this.productId+'/'+productObject.url+'.html#review-tab'});this.ratingImage=new Element('img',{'style':'vertical-align: bottom;','src':ratingImageURLPrefix+ratingString+'/5/rating.gif'});this.ratingLink.insert(this.ratingImage);}
this.description=cardSizes[productObject.cardSizeId]+' '+cardTypes[productObject.cardTypeId];this.priceDescription='';if(productObject.itemPerSet>0){this.priceDescription+='Set of '+productObject.itemPerSet+' for ';}else{this.priceDescription+='As low as ';}
if(productObject.minDiscountPrice){this.priceDescription+='<del>$'+productObject.minUnitPrice+'</del><span class="salePrice"> $'+productObject.minDiscountPrice+'<br/>Sale</span>';}else{this.priceDescription+='$'+productObject.minUnitPrice;}
colorCount=0;this.colorBoxes=[];this.colorCategoryToNumber={};this.colorSpan=new Element('span',{'class':'colorBoxHolder'});this.colorSpan.update('');for(colorCategoryId in productObject.colors){var colorBox=new Element('span',{'class':'colorBox','style':'background-color : #'+productObject.colors[colorCategoryId].rgb,'title':productObject.colors[colorCategoryId].name}).update(' ');colorBox.number=productObject.colors[colorCategoryId].number;colorBox.categoryId=productObject.colors[colorCategoryId].categoryId;this.colorCategoryToNumber[productObject.colors[colorCategoryId].categoryId]=productObject.colors[colorCategoryId].number;if(colorBox.number==this.color){colorBox.addClassName('colorBoxSelected');}
colorBox.observe('click',this.changeColor.bind(this,colorBox.number));colorBox.observe('mouseover',this.tempColor.bind(this,colorBox.number));colorBox.observe('mouseout',this.restoreColor.bind(this));if(colorCount>0&&(colorCount%8==0)){this.colorSpan.insert(new Element('br'));}
this.colorBoxes.push(colorBox);this.colorSpan.insert(colorBox);colorCount++;}
this.colorSpan.insert(new Element('br'));this.productBox.insert(this.thumbnailDiv);if(colorCount>1){this.productBox.insert(this.colorSpan);}
this.productBox.insert(this.productLink);this.productBox.insert(new Element('br'));if(productObject.priceTier==0){this.productBox.insert(new Element('div',{'id':'product_'+this.productId+'_studioBasics','class':'studiobasics'}));}
if(productObject.cardTypeId>1){this.productBox.insert(this.description);this.productBox.insert(new Element('br'));}
this.productBox.insert(this.priceDescription);if(productObject.ratingCount&&productObject.ratingCount>0){this.productBox.insert(new Element('br'));this.productBox.insert(this.ratingLink);}else{if(productObject.newProductFlag==1){this.productBox.insert(new Element('br'));this.productBox.insert(new Element('span',{'class':'noReview'}).update('New Product!'));}}
this.thumbnailImage.observe('load',this.insertQuickViewButton.bind(this));this.thumbnailDiv.observe('mouseover',this.showQuickViewButton.bind(this));this.thumbnailDiv.observe('mouseout',this.hideQuickViewButton.bind(this));this.quickViewDiv.observe('click',quickView.showQuickview.bind(quickView,this));this.quickViewDiv.observe('mouseover',function(){this.addClassName('productZoomMouseOver');});this.quickViewDiv.observe('mouseout',function(){this.removeClassName('productZoomMouseOver');});},insertQuickViewButton:function(){this.thumbnailDiv.insert(this.quickViewDiv);this.thumbnailImage.stopObserving('load');},selectBestColor:function(selectedColorCategories,lastSelectedColorCategory){var bestColorNumber=1;var lastValidColorCategory=0;var i;var selectedColorCategoriesLength=selectedColorCategories.length;for(i=0;i<selectedColorCategoriesLength;i++){if(selectedColorCategories[i]==lastSelectedColorCategory&&this.colorCategoryToNumber[lastSelectedColorCategory]){bestColorNumber=this.colorCategoryToNumber[lastSelectedColorCategory];break;}
if(this.colorCategoryToNumber[selectedColorCategories[i]]){bestColorNumber=this.colorCategoryToNumber[selectedColorCategories[i]];}}
this.changeColor(bestColorNumber);},getThumbnailUrl:function(colorNumber){var cleanClass=classes[this.productObject.classId];var cleanName=this.productObject.name;var thumbnailNumber=colorNumber?colorNumber:this.color
cleanClass=cleanClass.replace(/ /g,'-').replace(/:/g,'').replace(/\//g,'').toLowerCase();cleanName=cleanName.replace(/ /g,'-').replace(/:/g,'').replace(/\//g,'').toLowerCase();return urlThumbProduct.replace(/\{pid\}/,this.productId).replace(/\{colorNum\}/,thumbnailNumber).replace(/\{productClass\}/,cleanClass).replace(/\{productName\}/,cleanName);},tempColor:function(number){clearTimeout(this.currentTimeout);this.thumbnailImage.src=this.getThumbnailUrl(number);},restoreColor:function(){this.currentTimeout=setTimeout(this.resetImage.bind(this),250);},resetImage:function(){this.thumbnailImage.src=this.getThumbnailUrl();},changeColor:function(number){var i;var colorBoxesLength;this.color=number;colorBoxesLength=this.colorBoxes.length;for(i=0;i<colorBoxesLength;i++){if(this.colorBoxes[i].number==this.color){this.colorBoxes[i].addClassName('colorBoxSelected');}else{this.colorBoxes[i].removeClassName('colorBoxSelected');}}
this.productLink.href='/product/'+this.productId+'/'+this.productObject.url+'.html#color/'+this.color;this.thumbnailLink.href='/product/'+this.productId+'/'+this.productObject.url+'.html#color/'+this.color;this.thumbnailImage.src=this.getThumbnailUrl();},getProductBox:function(){return this.productBox;},showQuickViewButton:function(){this.quickViewDiv.show();},hideQuickViewButton:function(){this.quickViewDiv.hide();}});TP.Site.CategoryPage.Filter=Class.create({namespace:null,controller:null,checkboxes:null,countSpans:null,clearer:null,filteredPids:null,filterArea:null,expander:null,expanderImage:null,initialize:function(filterNamespace,filterJson,categoryPageController){this.namespace=filterNamespace;this.controller=categoryPageController;this.checkboxes={};this.labels={};this.labelsText={};this.countSpans={};this.expander=$(this.namespace+'_bar');this.expanderImage=$(this.namespace+'_control');this.filterArea=$(this.namespace+'_div');this.clearer=$(this.namespace+'_clear');if(this.clearer){this.clearer.observe('click',this.clearFilter.bind(this));}
if(this.expander){this.expander.observe('click',this.toggleVisibility.bind(this));}
if(filterJson.each){var i;var filterJsonLength=filterJson.length;for(i=0;i<filterJson.length;i++){this.checkboxes[''+i]=$(this.namespace+'_'+i);this.countSpans[''+i]=$(this.namespace+'_'+i+'_sum');this.labelsText[''+i]=$(this.namespace+'_'+i+'_text');this.countSpans[''+i].value=0;this.labels[''+i]=$(this.namespace+'_'+i+'_wholeName');this.checkboxes[i].observe('click',this.controller.handleFilterChange.bind(this.controller));this.labels[i].observe('click',this.setFilter.bind(this,i));}}else{for(filterValue in filterJson){this.checkboxes[filterValue]=$(this.namespace+'_'+filterValue);this.countSpans[filterValue]=$(this.namespace+'_'+filterValue+'_sum');this.labelsText[filterValue]=$(this.namespace+'_'+filterValue+'_text');this.countSpans[filterValue].value=0;this.labels[filterValue]=$(this.namespace+'_'+filterValue+'_wholeName');this.checkboxes[filterValue].observe('click',this.controller.handleFilterChange.bind(this.controller));this.labels[filterValue].observe('click',this.setFilter.bind(this,filterValue));}}},toggleVisibility:function(){if(this.filterArea.visible()){this.filterArea.hide();this.expanderImage.removeClassName('filterControlMinus');this.expanderImage.addClassName('filterControlPlus');}else{this.filterArea.show();this.expanderImage.removeClassName('filterControlPlus');this.expanderImage.addClassName('filterControlMinus');}},toggleFilter:function(filterValue,on){if(this.checkboxes[filterValue]&&!this.checkboxes[filterValue].disabled){if(on){this.checkboxes[filterValue].checked=true;}else{this.checkboxes[filterValue].checked=false;}}},setFilter:function(filterValue){if(!this.checkboxes[filterValue].disabled){this.checkboxes[filterValue].checked=!this.checkboxes[filterValue].checked;this.controller.handleFilterChange();}},clearFilter:function(){for(checkboxIndex in this.checkboxes){if(this.checkboxes[checkboxIndex]){this.checkboxes[checkboxIndex].checked=false;}}
this.controller.handleFilterChange();},resetFilterCount:function(){for(filterValue in this.labels){this.countSpans[filterValue].value=0;}},redrawFilter:function(){for(filterValue in this.labels){this.countSpans[filterValue].update('('+this.countSpans[filterValue].value+')');if(this.countSpans[filterValue].value==0){this.checkboxes[filterValue].checked=false;this.checkboxes[filterValue].disabled=true;this.labelsText[filterValue].removeClassName('condition_active');this.countSpans[filterValue].removeClassName('condition_active_num');this.labelsText[filterValue].addClassName('condition_inactive');this.countSpans[filterValue].addClassName('condition_inactive_num');}else{this.checkboxes[filterValue].disabled=false;this.labelsText[filterValue].removeClassName('condition_inactive');this.countSpans[filterValue].removeClassName('condition_inactive_num');this.labelsText[filterValue].addClassName('condition_active');this.countSpans[filterValue].addClassName('condition_active_num');}}},intersectionWithoutThisFilter:function(filterObjects){var intersection=[];var filteredPidSet=[];for(filterName in filterObjects){if(filterName!=this.namespace){filteredPidSet.push(filterObjects[filterName].filteredPids);}}
intersection=arrayMultiIntersection(filteredPidSet);return intersection;}});TP.Site.CategoryPage.PriceFilter=Class.create(TP.Site.CategoryPage.Filter,{initialize:function($super,filterNamespace,filterJson,categoryPageController){$super(filterNamespace,filterJson,categoryPageController);},qualifyingProducts:function(pids,products){var qualifyingPids=[];var i,hasChecked,qualifies;var pidsLength=pids.length;for(i=0;i<pidsLength;i++){hasChecked=false;qualifies=false;for(filterValue in this.checkboxes){if(this.checkboxes[filterValue].checked==true){hasChecked=true;if(products[pids[i]].priceTier==filterValue){qualifies=true;break;}}}
if(qualifies==true||hasChecked==false){qualifyingPids.push(pids[i]);}}
return qualifyingPids;},rerenderCount:function(filterObjects,products){this.resetFilterCount();var intersection=this.intersectionWithoutThisFilter(filterObjects);var i;var intersectionLength=intersection.length;for(i=0;i<intersectionLength;i++){for(filterValue in this.checkboxes){if(products[intersection[i]].priceTier==filterValue){this.countSpans[filterValue].value++;}}}
this.redrawFilter();}});TP.Site.CategoryPage.ColorFilter=Class.create(TP.Site.CategoryPage.Filter,{initialize:function($super,filterNamespace,filterJson,categoryPageController){$super(filterNamespace,filterJson,categoryPageController);for(filterValue in this.checkboxes){this.checkboxes[filterValue].stopObserving('click');this.labels[filterValue].stopObserving('click');this.checkboxes[filterValue].observe('click',this.setLastCategoryId.bind(this,filterValue));this.labels[filterValue].observe('click',this.setFilter.bind(this,filterValue));}},setLastCategoryId:function(filterValue){if(this.checkboxes[filterValue].checked==true){this.controller.lastColorCategoryId=filterValue;}
this.controller.handleFilterChange();},setFilter:function(filterValue){if(!this.checkboxes[filterValue].disabled){this.checkboxes[filterValue].checked=!this.checkboxes[filterValue].checked;}
if(this.checkboxes[filterValue].checked==true){this.controller.lastColorCategoryId=filterValue;}
if(!this.checkboxes[filterValue].disabled){this.controller.handleFilterChange();}},getCheckedColorCategories:function(){var checkedColors=[];for(filterValue in this.checkboxes){if(this.checkboxes[filterValue].checked==true){checkedColors.push(filterValue);}}
return checkedColors;},qualifyingProducts:function(pids,products){var qualifyingPids=[];var i,hasChecked,qualifies;var pidsLength=pids.length;for(i=0;i<pidsLength;i++){hasChecked=false;qualifies=false;for(filterValue in this.checkboxes){if(this.checkboxes[filterValue].checked==true){hasChecked=true;if(products[pids[i]].colors&&products[pids[i]].colors[filterValue]&&products[pids[i]].colors[filterValue].categoryId==filterValue){qualifies=true;break;}}}
if(qualifies==true||hasChecked==false){qualifyingPids.push(pids[i]);}}
return qualifyingPids;},rerenderCount:function(filterObjects,products){var intersection,i,intersectionLength;this.resetFilterCount();intersection=this.intersectionWithoutThisFilter(filterObjects);intersectionLength=intersection.length;for(i=0;i<intersectionLength;i++){for(filterValue in this.checkboxes){if(products[intersection[i]].colors&&products[intersection[i]].colors[filterValue]&&products[intersection[i]].colors[filterValue].categoryId==filterValue){this.countSpans[filterValue].value++;}}}
this.redrawFilter();}});TP.Site.CategoryPage.CardFormatFilter=Class.create(TP.Site.CategoryPage.Filter,{qualifyingProducts:function(pids,products){var qualifyingPids=[];var i,hasChecked,qualifies;var pidsLength=pids.length;for(i=0;i<pidsLength;i++){hasChecked=false;qualifies=false;for(filterValue in this.checkboxes){if(this.checkboxes[filterValue].checked==true){hasChecked=true;if(products[pids[i]].cardTypeId==filterValue){qualifies=true;break;}}}
if(qualifies==true||hasChecked==false){qualifyingPids.push(pids[i]);}}
return qualifyingPids;},rerenderCount:function(filterObjects,products){var i,intersection,intersectionLength;this.resetFilterCount();intersection=this.intersectionWithoutThisFilter(filterObjects);intersectionLength=intersection.length;for(i=0;i<intersectionLength;i++){for(filterValue in this.checkboxes){if(products[intersection[i]].cardTypeId==filterValue){this.countSpans[filterValue].value++;}}}
this.redrawFilter();}});TP.Site.CategoryPage.CardSizeFilter=Class.create(TP.Site.CategoryPage.Filter,{qualifyingProducts:function(pids,products){var qualifyingPids=[];var i,hasChecked,qualifies;var pidsLength=pids.length;for(i=0;i<pidsLength;i++){hasChecked=false;qualifies=false;for(filterValue in this.checkboxes){if(this.checkboxes[filterValue].checked==true){hasChecked=true;if(products[pids[i]].cardSize==filterValue){qualifies=true;break;}}}
if(qualifies==true||hasChecked==false){qualifyingPids.push(pids[i]);}}
return qualifyingPids;},rerenderCount:function(filterObjects,products){var i,intersection,intersectionLength;this.resetFilterCount();intersection=this.intersectionWithoutThisFilter(filterObjects);intersectionLength=intersection.length;for(i=0;i<intersectionLength;i++){for(filterValue in this.checkboxes){if(products[intersection[i]].cardSize==filterValue){this.countSpans[filterValue].value++;}}}
this.redrawFilter();}});TP.Site.CategoryPage.NumberPhotosFilter=Class.create(TP.Site.CategoryPage.Filter,{qualifyingProducts:function(pids,products){var qualifyingPids=[];var i,hasChecked,qualifies;var pidsLength=pids.length;for(i=0;i<pidsLength;i++){hasChecked=false;qualifies=false;for(filterValue in this.checkboxes){if(this.checkboxes[filterValue].checked==true){hasChecked=true;if(products[pids[i]].numPhotos==filterValue){qualifies=true;break;}}}
if(qualifies==true||hasChecked==false){qualifyingPids.push(pids[i]);}}
return qualifyingPids;},rerenderCount:function(filterObjects,products){var i,intersection,intersectionLength;this.resetFilterCount();intersection=this.intersectionWithoutThisFilter(filterObjects);intersectionLength=intersection.length;for(i=0;i<intersectionLength;i++){for(filterValue in this.checkboxes){if(products[intersection[i]].numPhotos==filterValue){this.countSpans[filterValue].value++;}}}
this.redrawFilter();}});TP.Site.CategoryPage.PrintTypeFilter=Class.create(TP.Site.CategoryPage.Filter,{qualifyingProducts:function(pids,products){var qualifyingPids=[];var i,k,hasChecked,qualifies;var pidsLength=pids.length;for(i=0;i<pidsLength;i++){hasChecked=false;qualifies=false;for(filterValue in this.checkboxes){if(this.checkboxes[filterValue].checked==true){hasChecked=true;if(products[pids[i]].printTypes){for(k=0;k<products[pids[i]].printTypes.length;k++){if(products[pids[i]].printTypes[k]==filterValue){qualifies=true;break;}}}}}
if(qualifies==true||hasChecked==false){qualifyingPids.push(pids[i]);}}
return qualifyingPids;},rerenderCount:function(filterObjects,products){var i,k,intersection,intersectionLength;this.resetFilterCount();intersection=this.intersectionWithoutThisFilter(filterObjects);intersectionLength=intersection.length;for(i=0;i<intersectionLength;i++){for(filterValue in this.checkboxes){if(products[intersection[i]].printTypes){for(k=0;k<products[intersection[i]].printTypes.length;k++){if(products[intersection[i]].printTypes[k]==filterValue){this.countSpans[filterValue].value++;}}}}}
this.redrawFilter();}});TP.Site.CategoryPage.PaperTypeFilter=Class.create(TP.Site.CategoryPage.Filter,{qualifyingProducts:function(pids,products){var i,k,hasChecked,qualifies;var qualifyingPids=[];var pidsLength=pids.length;for(i=0;i<pidsLength;i++){hasChecked=false;qualifies=false;for(filterValue in this.checkboxes){if(this.checkboxes[filterValue].checked==true){hasChecked=true;if(products[pids[i]].papers){for(k=0;k<products[pids[i]].papers.length;k++){if(products[pids[i]].papers[k]==filterValue){qualifies=true;break;}}}}}
if(qualifies==true||hasChecked==false){qualifyingPids.push(pids[i]);}}
return qualifyingPids;},rerenderCount:function(filterObjects,products){var i,k,intersection,intersectionLength;this.resetFilterCount();intersection=this.intersectionWithoutThisFilter(filterObjects);intersectionLength=intersection.length;for(i=0;i<intersection.length;i++){for(filterValue in this.checkboxes){if(products[intersection[i]].papers){for(k=0;k<products[intersection[i]].papers.length;k++){if(products[intersection[i]].papers[k]==filterValue){this.countSpans[filterValue].value++;}}}}}
this.redrawFilter();}});TP.Site.CategoryPage.VendorFilter=Class.create(TP.Site.CategoryPage.Filter,{qualifyingProducts:function(pids,products){var i,hasChecked,qualifies;var qualifyingPids=[];var pidsLength=pids.length;for(i=0;i<pidsLength;i++){hasChecked=false;qualifies=false;for(filterValue in this.checkboxes){if(this.checkboxes[filterValue].checked==true){hasChecked=true;if(products[pids[i]].vendorId==filterValue){qualifies=true;break;}}}
if(qualifies==true||hasChecked==false){qualifyingPids.push(pids[i]);}}
return qualifyingPids;},rerenderCount:function(filterObjects,products){var i,intersection,intersectionLength;this.resetFilterCount();intersection=this.intersectionWithoutThisFilter(filterObjects);intersectionLength=intersection.length;for(i=0;i<intersectionLength;i++){for(filterValue in this.checkboxes){if(products[intersection[i]].vendorId==filterValue){this.countSpans[filterValue].value++;}}}
this.redrawFilter();}});

sfHover=function(){if(document.getElementById("dropdown")){var sfEls=document.getElementById("dropdown").getElementsByTagName("li");for(var i=0;i<sfEls.length;i++){sfEls[i].onmouseover=function(){this.className+=" sfhover";}
sfEls[i].onmouseout=function(){this.className=this.className.replace(new RegExp(" sfhover\\b"),"");}}}}
if(window.attachEvent)window.attachEvent("onload",sfHover);function popUp(URL){eval("page=window.open(URL, '', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=440,height=400');");}
function checkEmail(fieldId){var field=document.getElementById(fieldId);var error='';if(field.value){if(field.value.match(/^[^\s@]+@[^\s@]+\.[^\s@]+[^\.]$/)){return true;}
error='The email you entered is invalid';}else{error='Please enter an email address';}
document.getElementById('signup-error').innerHTML=error;return false;}
var BrowserDetect={init:function(){this.browser=this.searchString(this.dataBrowser)||"An unknown browser";this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"an unknown version";this.OS=this.searchString(this.dataOS)||"an unknown OS";},searchString:function(data){for(var i=0;i<data.length;i++){var dataString=data[i].string;var dataProp=data[i].prop;this.versionSearchString=data[i].versionSearch||data[i].identity;if(dataString){if(dataString.indexOf(data[i].subString)!=-1)
return data[i].identity;}
else if(dataProp)
return data[i].identity;}},searchVersion:function(dataString){var index=dataString.indexOf(this.versionSearchString);if(index==-1)return;return parseFloat(dataString.substring(index+this.versionSearchString.length+1));},dataBrowser:[{string:navigator.userAgent,subString:"Chrome",identity:"Chrome"},{string:navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:navigator.vendor,subString:"Apple",identity:"Safari",versionSearch:"Version"},{prop:window.opera,identity:"Opera"},{string:navigator.vendor,subString:"iCab",identity:"iCab"},{string:navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:navigator.vendor,subString:"Camino",identity:"Camino"},{string:navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}],dataOS:[{string:navigator.platform,subString:"Win",identity:"Windows"},{string:navigator.platform,subString:"Mac",identity:"Mac"},{string:navigator.platform,subString:"Linux",identity:"Linux"}]};BrowserDetect.init();
