function navStyleImages(d,a,c,b){$("#"+a+"_NavImg_"+d).css("display","none");if(c=="prev"){if(d==0){$("#"+a+"_NavImg_"+(b-1)).css("display","block");tempCurrent=(b-1);}else{$("#"+a+"_NavImg_"+(d-1)).css("display","block");tempCurrent=(d-1);}document.getElementById(a+"_ImageButton_prev").onclick=function(){navStyleImages(tempCurrent,a,"prev",b);return false;};document.getElementById(a+"_ImageButton_next").onclick=function(){navStyleImages(tempCurrent,a,"next",b);return false;};}else{if(d==(b-1)){$("#"+a+"_NavImg_0").css("display","block");tempCurrent=0;}else{$("#"+a+"_NavImg_"+(d+1)).css("display","block");tempCurrent=(d+1);}document.getElementById(a+"_ImageButton_prev").onclick=function(){navStyleImages(tempCurrent,a,"prev",b);return false;};document.getElementById(a+"_ImageButton_next").onclick=function(){navStyleImages(tempCurrent,a,"next",b);return false;};}}function showEmailForm(){$("#formmessage").css("display","none");$("#emailform").css("display","block");$("#send_email").attr("disabled",false);}function showLessInfo(){$(".style_more").css("display","none");$(".style_more_link").css("display","inline");}function showMoreInfo(){$(".style_more").css("display","block");$(".style_more_link").css("display","none");}function signupNewUser(){signupAction="planner";loginAction="StyleEngine/results";gotoSignUp();}function switchCategories(b,a){$(".style_more").css("display","none");$(".style_more_link").css("display","inline");$(".morelink").removeClass("selected");$(b).addClass("selected");$(".styleimage, .blurb, .furniture").css("display","none");$("."+a+"img, ."+a+"txt").css("display","block");$(b).blur();}function validEmail(a,b){element=document.getElementById(a);email=element.value;atPos=email.indexOf("@");stopPos=email.lastIndexOf(".");message="";$("#formmessage").css("color","red");if((email=="")||(email==b)){$("#formmessage").css("display","block");$("#formmessage").html("Please enter a valid email address.");$("#send_email").attr("disabled",false);element.focus();return false;}if(atPos==-1||stopPos==-1){$("#formmessage").css("display","block");$("#formmessage").html("You have entered an invalid email address, please check your entry and try again.");$("#send_email").attr("disabled",false);element.focus();return false;}if(stopPos<atPos){$("#formmessage").css("display","block");$("#formmessage").html("You have entered an invalid email address, please check your entry and try again.");$("#send_email").attr("disabled",false);element.focus();return false;}if(stopPos-atPos==1){$("#formmessage").css("display","block");$("#formmessage").html("You have entered an invalid email address, please check your entry and try again.");$("#send_email").attr("disabled",false);element.focus();return false;}return true;}$("#styleemailer").submit(function(){$("#send_email").attr("disabled",true);if((validEmail("emails","friend's email address"))&&(validEmail("email","your email address"))){$.ajax({type:"POST",url:"/ajax/emailFriends",data:$(this).serialize(),success:function(a){$("#emailform").css("display","none");$("#formmessage").css("display","block");$("#formmessage").css("color","#888888");$("#formmessage").html('Your message has been sent.  Thanks for sharing your Sproost style with your friends! <div style="margin-top: 5px;">&nbsp;&nbsp;&nbsp;&gt;&nbsp;<a href="#" onclick="showEmailForm(); return false;">Send another email</a>.</div>');}});}else{}return false;});