var store=(function(){var f=function(){$newsletter=$("#newsletter_email");$newsletter_btn=$("span.newsletter_btn");$account_menu=$("div.account_choices");$account_menu_choices=$("div.account_choices li");$account_menu_click=$("#profileTitle");$search_menu=$("div.choices");$search_dropdown=$("div.search span");$search_dropdown_choices=$("div.choices li");$search_button=$("div.search_btn");$cat_viewall=$("span.viewall");$cat_scroll=$("div.category ul");$cat_row=$("div.category li");$colors=$("div.colors")};var b=function(){if($account_menu.is(":visible")){return}$account_menu.fadeIn("fast")};var e=function(){setTimeout(function(){$account_menu.fadeOut("fast")},500)};var h=function(l){var o=$(l.target),m=o.text(),n=o.attr("class");if(m==null){return}m=m.replace(/\s/,"","g");switch(m){case"Logout":location="/pplogout.do";break;case"Profile":location="http://"+n+".purephoto.com";break;case"Account":var k=n.split("-");location="http://"+k[0]+".purephoto.com/#/"+k[1];break;case"Collections":var k=n.split("-");location="http://"+k[0]+".purephoto.com/#/"+k[1];break;case"Messages":var k=n.split("-");location="http://"+k[0]+".purephoto.com/#/"+k[1];break}};var j=function(k){var l=$newsletter.val();if(l==="youremail@me.com"||$.string(l).blank()){alert("Email address required");return}if(!echeck(l)){alert("please enter a valid email address");return}$("div.newsletter_footer").append("<img src='http://blog.purephoto.com/classes/newsletter2.php?email="+l);$newsletter.val("Thank you");$newsletter.attr("disabled",true)};var d=function(){if($search_menu.is(":visible")){return}$search_menu.fadeIn("fast")};var g=function(){setTimeout(function(){$search_menu.fadeOut("fast")},500)};var c=function(k){var m=$(k.target),l=m.text();if(l==null){return}if(l=="Shop (soon)"){return}$search_dropdown.text(l);$search_menu.fadeOut("fast");if(l=="All"){$("#searchType").val("1")}else{if(l=="Members"){$("#searchType").val("2")}else{$("#searchType").val("3")}}};var a=function i(){f();$newsletter_btn.click(j);$newsletter.click(function(k){var l=$(k.target);if(l.val()==="youremail@me.com"){l.val("")}});$account_menu.mouseleave(e);$account_menu_choices.click(h);$account_menu_click.click(b);$search_dropdown.click(d);$search_menu.mouseleave(g);$search_dropdown_choices.click(c);$search_button.click(function(){$("#searchForm").submit()});$cat_viewall.click(function(){$cat_scroll.addClass("scroll")});$cat_row.click(function(k){var m=$(k.target),l=m.find("a").attr("href");if(l==null){return}location=l});$colors.click(function(k){var l=$(k.target);if(l==null||l.attr("title")==null){return}location="/?term="+escape(l.attr("title"))})};return{C:a}}());$(document).ready(store.C);function doStoreSearch(){var a=$("#search_query").val(),b=$("#searchType").val();if(a.length<2||b==null){return false}else{if(b==="1"||b==="2"){location="http://www.purephoto.com/siteSearch.do?term="+escape(a)+"&sType="+b;return false}else{return true}}}function trim(a){a=a.replace(/(^\s*)|(\s*$)/gi,"");a=a.replace(/[ ]{2,}/gi," ");a=a.replace(/\n /,"\n");return a};
