var photoviewer_properties={next:"next",prev:"prev",close:"<div class='b_outer2'><div class='b4 closeIcon'></div></div>"};function popup(b){window.open(b,"name","height=550,width=750,left=30,top=30,location=no,resizable=yes,scrollbars=yes,toolbar=no,status=no")}function move(b){window.location=b}function form_submit(b,c){b=Y$(b);if(!b)return!1;if(c)for(key in c)new Insertion.Bottom(b,'<input type="hidden" name="'+key+'" value="'+c[key]+'" />');return b.submit()}
function toggleOver(b,c){Y$(b).className=c}function search_onfocus(b,c){if(Y$(b).value==c)Y$(b).value="";Y$(b).style.color="#000"}function search_onblur(b,c){Y$(b).value=c;Y$(b).style.color="#ccc"}function search_close(b,c){search_onblur(b,c)}function showException(b,c){log_error("ajax exception: "+c,"","")}
function rate_design(b,c){var d=Y$("rateform_"+b).action,a="design_id="+b;a+=c=="rate_up"?"&rate_up=1":"&rate_down=1";YC.asyncRequest("GET",d,{success:function(){if(rating)Y$("thanks_"+b).show(),Y$("rating_up_"+b).innerHTML=rating.positive,Y$("rating_down_"+b).innerHTML=Math.abs(rating.negative),Y$("rateform_"+b).disable()},failure:showException,argument:null},null)}
function add_favorite_design(b,c){YC.asyncRequest("POST",c,{success:function(c){Y$("button_fav_"+b).className="button_favorite";Y$("button_fav_"+b).title=c.responseText},failure:showException,argument:null},"add=1&design_id="+b)}function remove_favorite_design(b,c){YC.asyncRequest("POST",c,{success:function(c){Y$("button_fav_"+b).className="button_favorite_add";Y$("button_fav_"+b).title=c.responseText},failure:showException,argument:null},"remove=1&design_id="+b)}
function toggle_favorite_design(b,c){return Y$("button_fav_"+b).className.substring(0,19)=="button_favorite_add"?add_favorite_design(b,c):remove_favorite_design(b,c)}function hide_select_controls(){var b=Y$$("SELECT");if(b)for(var c=0;c<b.length;c++)Y$(b[c]).hide()}function show_select_controls(){var b=Y$$("SELECT");if(b)for(var c=0;c<b.length;c++)Y$(b[c]).show()}
function remind_me_design(b,c,d,a){YC.asyncRequest("POST",d,{success:a,failure:showException,argument:null},"design_id="+b+"&date[year]="+c.year+"&date[month]="+c.month+"&date[day]="+c.day)}function reorder_images(b,c,d,a){YC.asyncRequest("POST",d,{success:a,failure:showException,argument:null},"album_id="+b+"&order="+YJSON.stringify(c))}
function post_ajax_yui(b,c,d,a,h,f){f==null&&(f=12E4);var g=a||function(){log_error("post_ajax_yui: onFailure: sUrl:"+c+", postData:"+b,c,"")},a=YC.asyncRequest("POST",c,{success:function(a,b){if(a.responseText.indexOf("REDIRECT TO: ")==0)return location.href=a.responseText.replace("REDIRECT TO: ",""),!0;d.call(h,a,b)},failure:function(a,f){a.status==-1&&log_error("post_ajax_yui: abort call: sUrl:"+c+", postData:"+b,c,"");g.call(h,a,f)},argument:null,scope:h,timeout:f},b);a.abort=function(){YC.abort(this);
g.call(h,{status:-1},null)};return a}function post_ajax(b,c,d){return YC.asyncRequest("POST",c,{success:d,failure:showException,argument:null},b)}function post_effects(b,c,d,a,h){typeof h!="function"&&(h=showException);YC.asyncRequest("POST",d,{success:a,failure:h,argument:null},"image_id="+b+"&params="+YJSON.stringify(c))}function show_preview_image(b){hide_select_controls();Y$("preview_image_big").src=b;Y$("preview_image_big_container").show();Y$("preview_image_big_container").scrollTo()}
function hide_preview_image(){Y$("preview_image_big_container").hide();Y$("preview_image_big").src="http://c.optimalprint.com/img/loading-v1301032853.gif";show_select_controls()}var visible_price_list=!1;function show_price_list(b){visible_price_list&&Y$(visible_price_list)&&(Y$(visible_price_list).hide(),visible_price_list=!1);b&&Y$(b)&&(Y$(b).show(),visible_price_list=b)}var visible_spec_list=!1;
function show_spec_list(b){visible_spec_list&&Y$(visible_spec_list)&&(Y$(visible_spec_list).hide(),visible_spec_list=!1);b&&Y$(b)&&(Y$(b).show(),visible_spec_list=b)}function is_email(b){return/^([-!#$%&'*+.\/0-9=?A-Z^_`a-z{|}~ ])+@([-!#$%&'*+\/0-9=?A-Z^_`a-z{|}~ ]+\.)+[a-zA-Z]{2,5}$/.test(b)}function window_stop(b){try{document.all?b.document.execCommand("Stop"):b.window.stop()}catch(c){typeof log_error=="function"&&log_error(c)}}
function get_random_string(b){uuid="";for(i=0;i<b;i++)uuid+=Math.floor(Math.random()*16).toString(16);return uuid}
window.YAHOO&&function(){Y=YAHOO;YA=(YU=Y.util)&&YU.Anim;YD=YU&&YU.Dom;YE=YU&&YU.Event;YS=YU&&YU.Selector;YC=YU&&YU.Connect;YR=YU&&YU.Region;YJSON=(YL=Y.lang)&&YL.JSON;var b=function(a,b){if(a)for(var c in b)a[c]=b[c];return a},c=function(a,b,c){YE.addListener(this,a,b,c||!1);return this},d={show:function(){YD.setStyle(this,"display","");return this},hide:function(){YD.setStyle(this,"display","none");return this},setStyle:function(a,b){YD.setStyle(this,a,b);return this},getStyle:function(a){return YD.getStyle(this,
a)},addListener:c,on:c,update:function(a){if(this.tagName)this.innerHTML=a;else if(this.length)for(var b=0;b<this.length;b++)Y$(this[b]).update(a);return this},evalScripts:function(){if(this.tagName)for(;this.getElementsByTagName("SCRIPT").length;){var a=this.getElementsByTagName("SCRIPT")[0].innerHTML,a=a.indexOf("<\!--")==-1?a:a.substr(a.indexOf("<\!--")+4);eval(a);this.getElementsByTagName("SCRIPT")[0].parentNode.removeChild(this.getElementsByTagName("SCRIPT")[0])}else if(this.length)for(a=0;a<
this.length;a++)this.evalScripts();return this},disable:function(){if(this.tagName)if(this.tagName.toLowerCase()=="form")for(var a=0;a<this.elements.length;a++)this.elements[a].disabled=!0;else this.disabled=!0;else if(this.length)for(a=0;a<this.length;a++)Y$(this[a]).disable();return this},enable:function(){if(this.tagName)if(this.tagName.toLowerCase()=="form")for(var a=0;a<this.elements.length;a++)this.elements[a].disabled=!1;else this.disabled=!1;else if(this.length)for(a=0;a<this.length;a++)Y$(this[a]).enable();
return this},getWidth:function(){var a=YR.getRegion(this);return a.right-a.left},getHeight:function(){var a=YR.getRegion(this);return a.bottom-a.top},insertAfter:function(a){if(!a.tagName){var b=document.createElement("div");b.innerHTML=a;a=Y$(b).down()}if(this.tagName)a&&YD.insertAfter(a,this);else if(a)for(b=0;b<this.length;b++)YD.insertAfter(a,this),a=document.cloneNode(a,1);return this},remove:function(){if(this.tagName)this.parentNode.removeChild(this);else for(var a=0;a<this.length;a++)this[a].parentNode.removeChild(this[a]);
return this},toggle:function(a){YU.Effect.toggle(this,a);return this},each:function(a){if(this.tagName)a(this);else for(var b=0;b<this.length;b++)a(this[b]);return this},replace:function(a){if(this.tagName)if(a.tagName)this.parentNode.replaceChild(a,this);else{var b=document.createElement("div");for(b.innerHTML=String(a);b.firstChild;)this.parentNode.insertBefore(b.firstChild,this);this.parentNode.removeChild(this)}else if(this.length)for(var b=document.createElement("div"),c=0;c<this.length;c++)if(a.tagName)this[c].parentNode.replaceChild(a,
this[c]);else{for(b.innerHTML=String(a);b.firstChild;)this[c].parentNode.insertBefore(b.firstChild,this[c]);this[c].parentNode.removeChild(this[c])}return this},down:function(a,c){var f=a||"*";if(this.tagName)return b(YS.query(f,this)[c||0]||null,d);else{for(var g=[],e=0;e<this.length;e++)for(var j=YS.query(f,this[e]),k=0;k<j.length;k++)g.push(j[k]);return b(g[c||0]||null,d)}},up:function(a,c){var f=a||"*",g=[];if(this.tagName){var e=this;do e=e.parentNode,g.push(e);while(e&&e.parentNode&&e.parentNode!=
e)}else for(var j=0;j<this.length;j++){e=this[j];do e=e.parentNode,g.push(e);while(e&&e.parentNode&&e.parentNode!=e)}return b(YS.filter(g,f)[c||0]||null,d)},adjacent:function(){var a=[].join.call(arguments,","),c=[];if(this.tagName)for(var f=this.parentNode.childNodes,g=0;g<f.length;g++)f[g]!=this&&c.push(f[g]);else for(var e=0;e<this.length;e++){f=this[e].parentNode.childNodes;for(g=0;g<f.length;g++)f[g]!=this[e]&&c.push(f[g])}return b(YS.filter(c,a),d)}};YU.Effect={};YU.Effect.toggle=function(a,
b){a=a.tagName&&[a]||a;switch(b||""){case "blind":for(var c=0;c<a.length;c++)if(!a[c].EffectBlocked)a[c].EffectBlocked=1,YU.Effect.blind(a[c]);break;default:for(c=0;c<a.length;c++)a[c].EffectBlocked||YD.setStyle(a[c],"display",YD.getStyle(a[c],"display")=="none"?"":"none")}};YU.Effect.blind=function(a){if(YD.getStyle(a,"display")!="none"){YD.setStyle(a,"overflow-y","hidden");var b=new YA(a,{height:{to:1}},0.5,YU.Easing.easeInStrong);b.onComplete.subscribe(function(){YD.setStyle(a,"display","none");
a.EffectBlocked=0})}else YD.setStyle(a,"overflow-y","hidden"),YD.setStyle(a,"height","1px"),YD.setStyle(a,"display",""),b=new YA(a,{height:{to:a.scrollHeight}},0.5,YU.Easing.easeInStrong),b.onComplete.subscribe(function(){YD.setStyle(a,"overflow-y","visible");YD.setStyle(a,"height","auto");a.EffectBlocked=0});b.animate()};Y$=function(a){return b(a.tagName&&a||Y$$("#".concat(a))[0]||null,d)};Y$$=function(a,c,f){a=YS.query(a,c||null,f||0);for(c=0;c<a.length;c++)b(a[c],d);return b(a,d)};Y$A=function(a){return b(a,
d)}}();
var Crc32Tab=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,
2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,
2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,
2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,
3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,
936918E3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];function Crc32Add(b,c){return Crc32Tab[(b^c)&255]^b>>8&16777215}function Crc32Str(b){var c,d=b.length,a;a=4294967295;for(c=0;c<d;c++)a=Crc32Add(a,b.charCodeAt(c));return a^4294967295}function isEmptyObj(b){for(var c in b)if(b.hasOwnProperty(c))return!1;return!0}
function in_array(b,c){for(var d=0;d<c.length;d++)if(b==c[d])return!0;return!1};

