jQuery(document).ready(function(){try{jQuery("#sortkeyname").text(document.getElementById("selectsortkey")[document.getElementById("selectsortkey").selectedIndex].text)}catch(Error){}try{jQuery("#lightwindow_status").val("0")}catch(Error){}});function ShowCustomerReviews(index,review,productId){jQuery("div#review-content").append("<div id='spinereview"+index+"' class='cr-item-content'></div>");jQuery("div#spinereview"+index).append("<div class='crheadrows'>");jQuery("div#spinereview"+index+" div.crheadrows").append("<div class='labelItem'><img src='http://iweb.rachaelraystore.com/images/RachaelRayStore/"+review.ProductRating+".gif'> <strong>"+review.VchSubject+"</strong></div>");jQuery("div#spinereview"+index+" div.crheadrows").append("<div class='dateItem mediumtext'>"+review.Date+"</div>");jQuery("div#spinereview"+index).append("</div>");jQuery("div#spinereview"+index).append("<div class='crmiddlerows'>By "+review.VchFirtname+", "+review.VCHState+"<br>"+review.VchComments+"</div>");jQuery("div#spinereview"+index).append("<div class='crfootrows'>");jQuery("div#spinereview"+index+" div.crfootrows").append("<div class='helpful'><strong>"+review.CountHelpful+" of "+review.HelpfulCount+" </strong>users found this helpful.  Was it helpful to you ? <a onclick=\"saveReview('1', '"+productId+"', '"+review.ProductReviewId+"'); return false;\" href='javascript:void(0)' id='review-yes-"+review.ProductReviewId+"' class='producttitle'>Yes</a>&nbsp;|&nbsp;<a onclick=\"saveReview('2', '"+productId+"', '"+review.ProductReviewId+"'); return false;\" href='javascript:void(0)' id='review-no-"+review.ProductReviewId+"' class='producttitle'>No</a></span></div>");jQuery("div#spinereview"+index+" div.crfootrows").append("<div class='reportItem'><a onclick=\"saveReview('3', '"+productId+"', '"+review.ProductReviewId+"'); return false;\" class='producttitle' href='javascript:void(0)'  id='review-confirm-"+review.ProductReviewId+"'>Report Violation</a></div>");jQuery("div#spinereview"+index).append("</div>");jQuery("#review-yes-"+review.ProductReviewId).click(function(){saveReview(1,productid,review.ProductReviewId)});jQuery("#review-no-"+review.ProductReviewId).click(function(){saveReview(2,productid,review.ProductReviewId)});jQuery("#review-confirm-"+review.ProductReviewId).click(function(){saveReview(3,productid,review.ProductReviewId)})}function SortReviews(){var productid=jQuery("#ProductId").val(),items=jQuery("#itemCount3").val(),selectid=document.getElementById("selectsortkey").selectedIndex;jQuery("#sortkeyname").text(document.getElementById("selectsortkey")[document.getElementById("selectsortkey").selectedIndex].text);if(parseInt(jQuery("#itemCount2").val())>1){jQuery("div#messagebox").css({display:"block"});jQuery.getJSON("/Product/GetReviewList/"+productid+"/"+selectid+"/"+items+"/",function(data){jQuery("div#review-content").remove();jQuery("div#other-content").css({display:"block"});jQuery("div#other-content").append("<div id='review-content'></div>");var itemcount=0;jQuery.each(data,function(index,review){ShowCustomerReviews(index,review,productid);itemcount++;jQuery("div#messagebox").css({display:"none"})})})}}jQuery(document).ready(function(){jQuery("#showallreview").click(function(){var productid=jQuery("#ProductId").val(),itemCount=jQuery("#itemCount2").val(),selectid=document.getElementById("selectsortkey").selectedIndex;jQuery("div#messagebox2").css({display:"block"});jQuery.getJSON("/Product/GetReviewList/"+productid+"/"+selectid+"/"+itemCount+"/",function(data){jQuery("div#review-content").remove();jQuery("div#other-content").css({display:"block"});jQuery("div#other-content").append("<div id='review-content'></div>");var itemcount=0;jQuery.each(data,function(index,review){ShowCustomerReviews(index,review,productid);itemcount++});jQuery("#itemCount3").val(itemcount);jQuery("#linkMoreReview").css({display:"none"});jQuery("#linkLessReview").css({display:"inline"});jQuery("div#messagebox2").css({display:"none"})})})});jQuery(document).ready(function(){jQuery("#hideallreview").click(function(){var productid=jQuery("#ProductId").val(),itemCount=jQuery("#itemCount").val(),selectid=document.getElementById("selectsortkey").selectedIndex;jQuery("div#messagebox2").css({display:"block"});jQuery.getJSON("/Product/GetReviewList/"+productid+"/"+selectid+"/"+itemCount+"/",function(data){jQuery("div#review-content").remove();jQuery("div#other-content").css({display:"block"});jQuery("div#other-content").append("<div id='review-content'></div>");var itemcount=0;jQuery.each(data,function(index,review){ShowCustomerReviews(index,review,productid);itemcount++});jQuery("#itemCount3").val(3);jQuery("#linkMoreReview").css({display:"inline"});jQuery("#linkLessReview").css({display:"none"});jQuery("div#messagebox2").css({display:"none"})})})});function saveReview(category,productid,reviewid){var item=true;if(category==3)item=confirmReport();item&&jQuery.getJSON("/Product/CustomerReviewReport/"+reviewid+"/"+category,function(data){item=data;category==1&&alert("Thank you very much !");category==2&&alert("Thank you very much !");category==3&&alert("Thanks for Reporting")})}function confirmReport(){var win=confirm("Are You Sure That You Want To Report This?");return win}function keyhandler(evt){evt=evt?evt:window.event?event:null;try{if(evt){var charCode=evt.charCode?evt.charCode:evt.keyCode?evt.keyCode:evt.which?evt.which:0;charCode==13&&jQuery("#btnSearch").click()}}catch(e){}}jQuery(document).ready(function(){jQuery("#btnSearch").click(function(){var keyword=jQuery("#searchKeyword").val(),itemPerpage=jQuery("#itemPerpage").val();keyword=regularSearchTearm(keyword);keyword=StringTrim(keyword);keyword=keyword.replace("  ","%20");keyword=keyword.replace(" ","%20");var itemCount="",temp="",itemCountCookie="";keyword!=""&&jQuery.getJSON("/Home/GetRachaelRayDimensionId",function(data){itemCount=data.objectId;itemCount=itemCount.replace("-","/");temp=itemCount.substring(0,itemCount.indexOf("/")+1);try{itemCountCookie=Get_Cookie("ItemCount")}catch(Error){}if(itemCountCookie!=undefined&&itemCountCookie!="")itemCount=temp+"/"+itemCountCookie;else if(itemPerpage!=undefined&&itemPerpage!="")try{itemCount=temp+"/"+itemPerpage}catch(Error){}itemCount=itemCount.replace("//","/");window.location="/Search/List/"+keyword+"/"+itemCount+"/"})})});function leftTrim(sString){while(sString.substring(0,1)==" ")sString=sString.substring(1,sString.length);return sString}function rightTrim(sString){while(sString.substring(sString.length-1,sString.length)==" ")sString=sString.substring(0,sString.length-1);return sString}function StringTrim(sString){return leftTrim(rightTrim(sString))}function Get_Cookie(name){var start=document.cookie.indexOf(name+"="),len=start+name.length+1;if(!start&&name!=document.cookie.substring(0,name.length))return null;if(start==-1)return null;var end=document.cookie.indexOf(";",len);if(end==-1)end=document.cookie.length;return unescape(document.cookie.substring(len,end))}function regularSearchTearm(keyword){var keyvalue=keyword.replace(/[^a-zA-Z0-9\-\+]+/g," ");return keyvalue}jQuery(document).ready(function(){jQuery("#btnSignUpEmail").click(function(){SignupEmail()})});function keyhandlerSignup(evt){evt=evt?evt:window.event?event:null;try{if(evt){var charCode=evt.charCode?evt.charCode:evt.keyCode?evt.keyCode:evt.which?evt.which:0;charCode==13&&jQuery("#btnSignUpEmail").click()}}catch(e){}}function SignupEmail(){var email=jQuery("#email").val();if(email==null||email==""){jQuery("#message").html("");jQuery("#message").append("Please enter your E-mail address");return false}if(!echeck(email)){jQuery("#message").html("");jQuery("#message").append("Invalid E-mail address");return false}window.location="/account/NewsletterSignup.aspx?email="+email}jQuery(document).ready(function(){jQuery("#btnSignupBottom").click(function(){var email=jQuery("#signup").val();if(email==null||email==""){jQuery("#message-error-email").text("Please enter your E-mail address");return false}if(!echeck(email)){jQuery("#message-error-email").text("Invalid E-mail address");return false}window.location="/account/NewsletterSignup.aspx?email="+email})});function keyhandlerSignupBottom(evt){evt=evt?evt:window.event?event:null;try{if(evt){var charCode=evt.charCode?evt.charCode:evt.keyCode?evt.keyCode:evt.which?evt.which:0;charCode==13&&jQuery("#btnSignupBottom").click()}}catch(e){}}function echeck(str){var at="@",dot=".",lat=str.indexOf(at),lstr=str.length,ldot=str.indexOf(dot);if(str.indexOf(dot+dot)>0)return false;if(str.indexOf(at)==-1)return false;if(str.indexOf(at)==-1||str.indexOf(at)==0||str.indexOf(at)==lstr)return false;if(str.indexOf(dot)==-1||str.indexOf(dot)==0||str.indexOf(dot)==lstr)return false;if(str.indexOf(at,lat+1)!=-1)return false;if(str.substring(lat-1,lat)==dot||str.substring(lat+1,lat+2)==dot)return false;if(str.indexOf(dot,lat+2)==-1)return false;if(str.indexOf(" ")!=-1)return false;return true}function ShowMore(section,id,i){if(id==1){objSpan=document.getElementById("spanItem-"+section+"-"+i);while(objSpan!=null){if(objSpan.style.display=="none")objSpan.style.display="block";i++;objSpan=document.getElementById("spanItem-"+section+"-"+i)}document.getElementById("lnkMore"+section).style.display="none";document.getElementById("lnkLess"+section).style.display="inline"}if(id==2){objSpan=document.getElementById("spanItem-"+section+"-"+i);while(objSpan!=null){if(objSpan.style.display=="block")objSpan.style.display="none";i++;objSpan=document.getElementById("spanItem-"+section+"-"+i)}document.getElementById("lnkMore"+section).style.display="inline";document.getElementById("lnkLess"+section).style.display="none"}}function AddToCart(){var checkoutUrl=document.getElementById("checkoutUrl").value;if(checkoutUrl==undefined)checkoutUrl="/checkout";var total=parseInt(document.getElementById("txtQuantity").value),productId=document.getElementById("ProductId").value,locationUrl="";if(total>=1&&total<1e3){locationUrl=checkoutUrl+"/add.aspx?a=a&pid="+productId+"&qty="+total;window.location=locationUrl}return false}jQuery(document).ready(function(){jQuery("ul#topnav li a").hover(function(){jQuery(this).parent().find("ul.subnav").css({display:"block"});jQuery(this).parent().hover(function(){},function(){jQuery(this).parent().find("ul.subnav").css({display:"none"})})}).hover(function(){jQuery(this).addClass("subhover")},function(){jQuery(this).removeClass("subhover")})});jQuery(document).ready(function(){jQuery("#btnSaveComment").click(function(){var Product=jQuery("#ProductId").val(),Comment=jQuery("#txtComment").val();if(Comment.trim()!=""){win=confirm("Do you really want to submit this feedback?");win&&jQuery.ajax({url:"/Customer/SaveComment",type:"POST",dataType:"json",data:{productId:Product,comment:Comment},success:function(){alert("Thank you! JUST A REMINDER...We read all submissions but regrettably cannot reply.");jQuery("#txtComment").val("")}})}})});jQuery(document).ready(function(){jQuery("#cartitem").click(function(){var checkoutUrl=jQuery("#checkoutUrl").val();if(checkoutUrl==undefined)checkoutUrl="/checkout";window.location=checkoutUrl+"/ShoppingCart.aspx"})});function switchPages(Url){window.location=Url}function newpopup(events){window.location=events.value}function ChangeImages(imageUrl){var target=document.getElementById("lightwindow_image_0");if(target)target.src=imageUrl;return false}function echeck(str){var at="@",dot=".",lat=str.indexOf(at),lstr=str.length,ldot=str.indexOf(dot);if(str.indexOf(dot+dot)>0)return false;if(str.indexOf(at)==-1)return false;if(str.indexOf(at)==-1||str.indexOf(at)==0||str.indexOf(at)==lstr)return false;if(str.indexOf(dot)==-1||str.indexOf(dot)==0||str.indexOf(dot)==lstr)return false;if(str.indexOf(at,lat+1)!=-1)return false;if(str.substring(lat-1,lat)==dot||str.substring(lat+1,lat+2)==dot)return false;if(str.indexOf(dot,lat+2)==-1)return false;if(str.indexOf(" ")!=-1)return false;return true}var arrOrderInqueries=["Help tracking my order","Order changes/cancellations","Order problems","International orders","Other"],arrNewsletter=["Shopping Newsletter - Subscribe","Shopping Newsletter - Unsubscribe","Change email address"],arrReturns=["How to return products","Credit due on return","Items not received as expected","Other"],arrProductInfo=["Help with product I ordered","Help with replacement parts","Question about our products","Help finding a product","How do I submit a product"],arrShipping=["Problem searching","Problem ordering","Secure ordering/privacy","Other"],arrFeedback=["Product feedback","Site feedback","Other"],arrOthers=["Other comments or questions"];function ChangeTopics(){var subject=document.getElementById("lstSubject").value;clearTopics();if(subject=="200")addTopics(arrOrderInqueries);else if(subject=="300")addTopics(arrNewsletter);else if(subject=="400")addTopics(arrReturns);else if(subject=="500")addTopics(arrProductInfo);else if(subject=="600")addTopics(arrShipping);else if(subject=="700")addTopics(arrFeedback);else subject=="800"&&addTopics(arrOthers)}function addTopics(arrOptions){for(var i=0;i<arrOptions.length;i++){var opt=document.createElement("option");opt.text=arrOptions[i];opt.value=i;document.getElementById("lstTopic").options.add(opt)}if(arrOptions.length>0)document.getElementById("lstTopic").selectedIndex=0}function clearTopics(){for(var i=document.getElementById("lstTopic").options.length-1;i>=0;i--)document.getElementById("lstTopic").options[i]=null;document.getElementById("lstTopic").selectedIndex=-1}jQuery(document).ready(function(){jQuery("#videobox").css({display:"block"});jQuery("#viewlarger").css({display:"block"})});String.prototype.trim=function(){return this.replace(/^\s*/,"").replace(/\s*$/,"")};