/* Copyright (c) 2010 Stephen Richardson, Black Country Caravans */
(function(a){a.fn.carousel=function(b){return this.each(function(){a.carousel(a(this),b)})};a.carousel=function(b,d){function e(){k.css({overflow:"hidden",position:"relative"});c.autoContainerHeight&&k.css({height:u+c.extraContainerHeight});c.autoItemsHeight&&g.css({height:u-c.sizeBelowMax});b.css("overflow","hidden");if(c.transition=="slide")v>1&&k.width(n*v);else if(c.transition=="fade"){g.css({position:"absolute",top:0,left:0,width:"100%"});g.hide();p.show().css({zIndex:10})}m();if(c.doesResize&&
c.transition=="slide"){var j=null;a(window).bind("resize",function(){j&&clearTimeout(j);j=setTimeout(h,100)})}g.each(function(){d.clickThrough&&a(this).click(function(x){window.location=a(this).find("a").attr("href");x.preventDefault()});c.transition=="slide"&&a(this).hover(function(){a(this).addClass("hover")},function(){a(this).removeClass("hover")});if(c.shrinkTo==null&&c.autoShrink)c.shrinkTo=u-c.sizeBelowMax;if(c.shrinkTo!=null){var l=a(this).height();if(l>c.shrinkTo){var w=a(this).find("a img");
w.css({marginTop:-(l-c.shrinkTo)/2,marginBottom:-(l-c.shrinkTo)/2});w.hover(function(){a(this).stop().animate({marginTop:0,marginBottom:0},500)},function(){a(this).stop().animate({marginTop:-(l-c.shrinkTo)/2,marginBottom:-(l-c.shrinkTo)/2},500)})}}});c.autoheight&&k.css({height:p.outerHeight(true)+c.extraContainerHeight})}function f(j){y&&clearInterval(y);y=setInterval(function(){z=true;c.controls.find("a.next").trigger("click");z=false},j)}function h(){m();var j=parseInt(k.width())-b.width();if(b.scrollLeft()+
10>j)Math.ceil(s)>1?b.animate({scrollLeft:j}):b.animate({scrollLeft:0})}function m(){s=q();if(Math.ceil(s)>1){c.controls.show();c.controls.html('<a href="javascript:void(0);" class="prev">&laquo;</a><a href="javascript:void(0);" class="next">&raquo;</a>');for(i=0;i<Math.ceil(s);i++)c.controls.find("a.next").before('<a href="javascript:void(0);" class="pager">'+(i+1)+"</a>");t();if(c.transition=="fade"){c.controls.find("a.pager:eq(0)").addClass("active");f(c.autocycle_delay)}}else{c.controls.hide();
c.controls.html("")}}function q(){if(c.transition=="slide")return k.width()/b.width();else if(c.transition=="fade")return v;return 0}function t(){c.controls.find("a.prev").unbind().click(function(){if(c.transition=="slide"){var j=parseInt(k.width())-b.width(),l=b.scrollLeft();if(l>0)n>l?b.animate({scrollLeft:0}):b.animate({scrollLeft:"-="+n});else b.animate({scrollLeft:j})}else if(c.transition=="fade"){f(c.autocycle_userclickdelay);j=g.index(g.filter(":visible"));if(j==0){g.filter(":visible").stop(false,
true).fadeOut();g.filter(":last").stop(false,true).fadeIn();c.controls.find("a.pager").removeClass("active");c.controls.find("a.pager:last").addClass("active")}else{g.filter(":visible").stop(false,true).fadeOut();g.filter(":eq("+(j-1)+")").stop(false,true).fadeIn();c.controls.find("a.pager").removeClass("active");c.controls.find("a.pager:eq("+(j-1)+")").addClass("active")}}return false});c.controls.find("a.next").unbind().click(function(){if(c.transition=="slide"){var j=parseInt(k.width())-b.width(),
l=b.scrollLeft(),w=j-l;if(l+10<j)n<w?b.animate({scrollLeft:"+="+n}):b.animate({scrollLeft:j});else b.animate({scrollLeft:0})}else if(c.transition=="fade"){z?f(c.autocycle_delay):f(c.autocycle_userclickdelay);j=g.index(g.filter(":visible"));if(j==v-1){g.filter(":visible").stop(false,true).fadeOut();g.filter(":first").stop(false,true).fadeIn();c.controls.find("a.pager").removeClass("active");c.controls.find("a.pager:first").addClass("active")}else{g.filter(":visible").stop(false,true).fadeOut();g.filter(":eq("+
(j+1)+")").stop(false,true).fadeIn();c.controls.find("a.pager").removeClass("active");c.controls.find("a.pager:eq("+(j+1)+")").addClass("active")}}return false});c.controls.find("a.pager").unbind().click(function(){var j=c.controls.find("a.pager").index(this);if(c.transition=="slide"){var l=Math.floor(j/Math.ceil(s)*v)*n;if(j+1==Math.ceil(s))l=parseInt(k.width()-b.width());b.animate({scrollLeft:l})}else if(c.transition=="fade"){f(c.autocycle_userclickdelay);l=g.index(g.filter(":visible"));if(j!=l){g.filter(":eq("+
l+")").stop(false,true).fadeOut();g.filter(":eq("+j+")").stop(false,true).fadeIn();c.controls.find("a.pager").removeClass("active");c.controls.find("a.pager:eq("+j+")").addClass("active")}}return false})}var c={controls:null,doesResize:true,container:"ul",items:"li",transition:"slide",extraContainerHeight:0,autocycle:false,autocycle_delay:3E3,autocycle_userclickdelay:15E3,autoContainerHeight:false,autoItemsHeight:false,shrinkTo:null,autoShrink:false,sizeBelowMax:30,clickThrough:false,setItemWidth:null};
d&&a.extend(c,d);var k=b.children(c.container),g=k.children(c.items),p=g.filter(":eq(0)"),v=g.length,n=c.setItemWidth==null?p.outerWidth(true):c.setItemWidth,s=1,y=null,z=false,u=g.getMaxHeight();e();return this}})(jQuery);
(function(a){function b(){r=jQuery("<div>",{id:"preview"}).text("&nbsp;").appendTo("body").hide();C=r.outerWidth(true)/2;F=r.outerHeight(true);a(window).unload(function(){r.remove()});d();var B=null;a(window).bind("scroll resize",function(){B&&clearTimeout(B);B=setTimeout(function(){d()},100)});G=true}function d(){if(jQuery.browser.msie){w=a(window).scrollLeft();x=a(window).scrollTop()}else{w=window.pageXOffset;x=window.pageYOffset}v=a(window).width();n=a(window).height()}var e=0,f=0,h=0,m=0,q=0,
t=0,c=0,k=0,g=null,p=null,v=0,n=0,s=null,y=null,z=null,u=null,j=0,l=0,w=0,x=0,D=true,G=false,r=null,C=10,F=34;a.fn.preview=function(B){function I(){s=o.content==null?u:a(u).find(o.content);p=null;y=a(s).find("img");if(y.length>0)if(o.useRelAsTargetImg)p=a(s).attr("rel");else{p=a(y).attr("src");if(o.findLinkImgString!=null)p=p.replace(o.findLinkImgString,o.replaceLinkImgString);if(o.alsoRemoveLinkImgString!=null)p=p.replace(o.alsoRemoveLinkImgString,"")}o.maxPreviewWidth!=null?r.css("width",o.maxPreviewWidth):
r.css("width","auto");if(p!=null){g=new Image;a(r).removeClass("text");var A=null;if(o.captionAttr!=null)A=a(y).attr(o.captionAttr);a(g).load(function(){if(g!=null){f=g.width+C;e=g.height+F;k=Math.round(e/2);q=o.xOffset+f-w;c=k-x;t=k+x;E();a(r).html('<img src="'+p+'" />'+(A==null?"":'<br /><span id="name">'+A+"</span>")).css({padding:2,top:m,left:h}).fadeIn("fast")}}).attr("src",p)}else{g=null;var H=s.html();a(r).addClass("text").html(H);o.header!=null&&a(r).prepend(a(u).children(o.header).clone());
f=a(r).outerWidth(true);if(o.maxPreviewWidth!=null)f=o.maxPreviewWidth+C;e=a(r).outerHeight(true);k=Math.round(e/2);q=o.xOffset+f-w;c=k-x;t=k+x;E();H.length>5&&a(r).css({padding:8,top:m,left:h}).fadeIn("fast")}}function J(){E();a(r).css({top:m,left:h})}function E(){if(o.checkBounds){h=j+q>v?j-q:j+o.xOffset;m=l+c>n?l-e:t>l?l:l-k}else{h=j+o.xOffset;m=l-k}}var o=a.extend({xOffset:40,showDelay:200,content:null,maxPreviewWidth:null,useRelAsTargetImg:false,header:null,findLinkImgString:null,replaceLinkImgString:null,
alsoRemoveLinkImgString:null,checkBounds:true,captionAttr:"alt"},B);G==false&&b();a(this).hover(function(){u=a(this);D=false;a(u).attr("title","");clearTimeout(z);z=setTimeout(function(){I()},o.showDelay)},function(){g=null;D=true;clearTimeout(z);a(r).hide()});a(this).bind("mousemove",function(A){j=A.pageX;l=A.pageY;D||J()})}})(jQuery);var products=null,nonefound=null,pTypeList=null,filters=null,prodContainer=null,prodSize="min",equalisingHeights=false,combineTypesInput=null;
function setupFilter(){products=prodList.find("div.prodCont");nonefound=$("#nonefound");products.hover(function(){$(this).addClass("hover")},function(){$(this).removeClass("hover")});products.click(function(a){window.location=$(this).find("a").attr("href");a.preventDefault()})}
function ToMin(){if(prodSize!="min"){prodSize="min";equalisingHeights=true;prodContainer.addClass("min");var a=prodList.find("div.prodImgCont a img");a.css("height",100);prodList.each(function(){$.each($(this).find("div.prodCont"),function(b){b%6==0&&b>0?$(this).addClass("cleft"):$(this).removeClass("cleft")})});equalHeightImgs(a,true)}}
function ToMax(){if(prodSize!="max"){prodSize="max";equalisingHeights=true;prodContainer.removeClass("min");var a=prodList.find("div.prodImgCont a img");a.css("height","");prodList.each(function(){$.each($(this).find("div.prodCont"),function(b){b%3==0&&b>0?$(this).addClass("cleft"):$(this).removeClass("cleft")})});equalHeightImgs(a,false)}}
function equalHeightImgs(a,b){var d=0;d=a.length;a.each(function(){var e=$(this).attr("src");e=b?e.replace("images/products/","images/thumbs/products/"):e.replace("thumbs/","");$(this).attr("src",e)});equalisingHeights=false;equalHeights()}var pageChanged=false;
function Combine(){combined=true;createCookie("productView-Combined","true",1);ajaxFilterCall(0,0,"",3);prodContainer.css("padding","5px 0 0 0");nonefound.css("padding-top",5);var a=prodContainer.find(".prodHeader");a.hide();a.find(".pager").hide();var b=prodList.first();prodList.filter(":gt(0)").each(function(){$(this).hide();$(this).find("div.prodCont").appendTo(b)})}
function Separate(){combined=false;createCookie("productView-Combined","false",1);$("#combinedHeader").remove();ajaxFilterCall(0,0,"",3);pageChanged=false;prodContainer.css("padding","");nonefound.css("padding-top",10);var a=prodContainer.find(".prodHeader");a.show();a.find(".pager").show();prodList.filter(":gt(0)").show();var b=prodList.first().prev(".prodHeader").attr("id");prodList.first().find("div.prodCont").each(function(){var d=$(this).attr("rel");d!=b&&$(this).appendTo($("#"+d))})}
function runFilter(a,b){$("body").prepend('<style type="text/css">.prodDescText{display:none}</style>');prodList.parent().append('<p style="padding:10px; margin:0; display:none" id="nonefound">No products found, try removing a filter from the left-hand navigation.</p>');$.browser.msie?prodContainer.css("padding","0 0 6px 0"):prodContainer.css("padding","");prodList.find("div.prodCont").each(function(){var h=$(this).attr("title");$(this).removeAttr("title");$(this).attr("rel",h)});setupFilter();filters=
$("#filters");pTypeList=$("#pTypeList li a");var d=readCookie("productView");if(d=="min"){prodSize="max";ToMin()}else if(d=="max"){prodSize="min";ToMax()}$("#minView").click(function(){ToMin();createCookie("productView","min",1);return false});$("#maxView").click(function(){ToMax();createCookie("productView","max",1);return false});var e=null;$(window).bind("resize",function(){e&&clearTimeout(e);e=setTimeout(function(){equalHeights()},100)});combineTypesInput=$("#combineTypes input");if(combineTypesInput.length>
0){if(readCookie("productView-Combined")=="true"){Combine();combineTypesInput.attr("checked","checked")}else combineTypesInput.attr("checked","");combineTypesInput.change(function(){if($(this).is(":checked")){$(this).attr("disabled","disabled");Combine()}else Separate();equalHeights()})}if(filters.length==0)equalHeights();else{pTypeList.attr("href","#");var f=null;if(b)f=ajaxFilterCall(0,0,"",0);else equalHeights();d=filters.find("input");d.each(function(){$(this).next("a").hasClass("active")||$(this).attr("checked",
"")});d.change(function(){$(this).next("a").trigger("click")});filters.find("A.filterAtt").click(function(){f!=null&&f.abort();prodList.find("div.prodImgCont img").stop().css({opacity:""}).animate({opacity:0.4},1E3);var h=$(this).attr("rel").split(","),m=h[0],q=h[1],t=h[2];h=h[3];if(h==1){$(this).addClass("active").attr("rel",m+","+q+","+t+",2");$(this).prev("input").attr("checked","checked")}else if(h==2){$(this).attr("rel",m+","+q+","+t+",1").removeClass("active");$(this).prev("input").removeAttr("checked")}f=
ajaxFilterCall(m,q,t,h);$(this).blur();return false});pTypeList.click(function(){$(this).toggleClass("active");f!=null&&f.abort();f=ajaxFilterCall(0,0,"",3);$(this).blur();return false})}}function equalHeights(){prodList.each(function(){doEqualHeights($(this))})}function doEqualHeights(a){var b=a.find("div.prodCont:visible");combined||(b.length==0?a.prev("div.prodHeader").hide():a.prev("div.prodHeader").show())}
function ajaxFilterCall(a,b,d,e){if(e>0||pageChanged){var f="";pTypeList.filter(".active").each(function(){f+=$(this).attr("rel")+";"});f.length==0&&pTypeList.each(function(){f+=$(this).attr("rel")+";"})}else f=pTypeIDs;return $.ajax({url:"/DataService.asmx/getFilteredProducts",data:{cID:cID,manufacturerID:manufacturerID,cTypeID:cTypeID,poID:a,povID:b,povGroupValue:"'"+d+"'",type:e,pTypeIDs:"'"+f+"'",path:"'"+pagePath+"'",takeX:takeX,isFeatured:isFeatured,page:1,isCombined:combined},contentType:"application/json; charset=utf-8",
dataType:"json",success:function(h){receiveProdData(h,1,true);combined&&combineTypesInput.removeAttr("disabled")}})}
function ChangePage(a,b){pageChanged=true;if(b.length==0){var d="";pTypeList.filter(".active").each(function(){d+=$(this).attr("rel")+";"});b=d;b.length==0&&pTypeList.each(function(){d+=$(this).attr("rel")+";"})}$.ajax({cache:true,url:"/DataService.asmx/getFilteredProducts",data:{cID:cID,manufacturerID:manufacturerID,cTypeID:cTypeID,poID:0,povID:0,povGroupValue:"''",type:0,pTypeIDs:"'"+b+"'",path:"'"+pagePath+"'",takeX:takeX,isFeatured:isFeatured,page:a,isCombined:combined},contentType:"application/json; charset=utf-8",
dataType:"json",success:function(e){receiveProdData(e,a,false)}})}
function receiveProdData(a,b,d){if(a.d!=null){var e=0,f=[],h="",m=null,q=0,t=0;t=0;if(d){products.remove();prodList.prev(".prodHeader").find(".pager").remove();prodContainer.find("div.prodList").hide()}$("#combinedHeader").remove();$.each(a.d.productSet,function(c,k){var g=null;g=combined?k:k.products;if(g!=null){var p=null;if(combined){if(m==null)m=prodContainer.find("div.prodList:eq(0)")}else{h="";p=k.ptID;m=$("#pt"+p)}m.empty();$.each(g,function(v,n){e++;if(combined){p=n.ptID;f.push(p)}h+='<div rel="pt'+
p+'" id="p'+n.id+'" class="prodCont"> <div class="prodImgCont">  <a href="'+n.url+'"><img alt="'+n.name+'" src="/images/products/'+n.img+'"></a> </div> <div class="prodDesc">  <h3><a href="'+n.url+'">'+n.name+'</a></h3>  <div class="prodDescText">'+n.desc+'</div>  <div class="prodCost">';h+=n.pRRP!=null&&n.pRRP>0?'   <span class="jPrice"><span class="RRP">&pound;'+n.pRRP.toFixed(2)+"</span><span>&pound;"+n.price.toFixed(2)+"</span></span>":'   <span class="jPrice">&pound;'+n.price.toFixed(2)+"</span>";
h+="  </div> </div></div>"});m.prepend(h);m.show();q+=combined?a.d.productCount:k.productCount;if(!combined){g=takeX;m.prev(".prodHeader").find(".pager").remove();q>g&&m.prev(".prodHeader").prepend(GetPagerHTML(b,g,q,k.ptID));q=0}}});if(combined){d=takeX*$.unique(f).length;q>d&&m.before('<div id="combinedHeader" class="prodHeader">'+GetPagerHTML(b,d,q,"")+"Combined Products</div>")}if(prodSize=="min"){prodSize="max";ToMin()}if(e==0)nonefound.show();else{nonefound.hide();setupPreview();setupFilter()}prodList.find("div.prodImgCont img").stop().css("opacity",
"");equalHeights()}}
function GetPagerHTML(a,b,d,e){var f='<ul class="pager">';f+=a>1?'   <li><a href="javascript:ChangePage('+(a-1)+", '"+e+"')\">&laquo;</a></li>":'   <li class="inactive">&laquo;</li>';for(var h=1;h<a;h++)f+='   <li><a href="javascript:ChangePage('+h+", '"+e+"')\">"+h+"</a></li>";f+='   <li class="active">'+a+"</a></li>";var m=Math.ceil(d/b);for(h=a+1;h<=m;h++)f+='   <li><a href="javascript:ChangePage('+h+", '"+e+"')\">"+h+"</a></li>";f+=a*b<d?'   <li><a href="javascript:ChangePage('+(a+1)+", '"+e+
"')\">&raquo;</a></li>":'   <li class="inactive">&raquo;</li>';f+="</ul>";return f}$.fn.setAllToMaxHeight=function(){return this.height(Math.max.apply(this,$.map(this,function(a){return $(a).outerHeight(false)})))};$.fn.getMaxHeight=function(){return Math.max.apply(this,$.map(this,function(a){return $(a).outerHeight(false)}))};
$(function(){if(typeof categoryPage!="undefined"){var a=$("#catImgs div"),b=$("#ptImgs div"),d=b.add(a);d.click(function(e){window.location=$(this).find("a").attr("href");e.preventDefault()});d.hover(function(){$(this).addClass("hover")},function(){$(this).removeClass("hover")});a.find("span").setAllToMaxHeight();b.find("span").setAllToMaxHeight()}});var basketSelectLists=null;
$(function(){basketSelectLists=$("#atb .optionList select");if(basketSelectLists.length>0){updatePrice();basketSelectLists.find("option").removeAttr("selected");basketSelectLists.each(function(){$(this).find("option:eq(0)").attr("selected","selected");$(this).change(function(){updatePrice()})})}});
function updatePrice(){if(typeof basePrice!="undefined"){var a=0,b="";basketSelectLists.filter(":not(.groupOption)").find("option:selected").each(function(){b=$(this).attr("title");if(b.indexOf("+")>-1)a+=parseFloat(b.substr(1,b.length-1));else if(b.indexOf("-")>-1)a-=parseFloat(b.substr(1,b.length-1));var d=(basePrice+a).toFixed(2),e="";e=d>999?d.toString().substr(0,1)+","+d.toString().substr(1,d.length-1):d.toString();d=$("#price SPAN.price");if(d.length==0)d=$("#price SPAN.jPrice");d.text("\u00a3"+
e)})}}function populateOptionList(a,b,d,e){$.ajax({type:"POST",url:"/DataService.asmx/populateOptionList",data:'{ "poName":"'+a+'", "parName":"'+b+'", "parValue":"'+d+'", "poID":"'+e+'"}',contentType:"application/json; charset=utf-8",dataType:"json",success:function(f){basketSelectLists.find("#ctl00_cph1_"+a).replaceWith(f.d);basketSelectLists.each(function(){$(this).change(function(){updatePrice()})});updatePrice()}})}
function createCookie(a,b,d){if(d){var e=new Date;e.setTime(e.getTime()+d*24*60*60*1E3);d="; expires="+e.toGMTString()}else d="";document.cookie=a+"="+b+d+"; path=/"}function readCookie(a){var b=document.cookie.split(";");a=a+"=";for(var d=0;d<b.length;d++){for(var e=b[d];e.charAt(0)==" ";)e=e.substring(1,e.length);if(e.indexOf(a)==0)return e.substring(a.length,e.length)}return null}function eraseCookie(a){createCookie(a,"",-1)}var rating=1,whichStar=0,ratingList=null,writeReviewBox=null;
$(function(){ratingList=$("#ratingList");if(ratingList.length>0){writeReviewBox=$("#writeReviewBox");writeReviewBox.hide();ratingList.empty();for(var a=0;a<5;a++){whichStar=a==0?1:0;ratingList.append('<img onclick="setRating('+(a+1)+');" alt="'+(a+1)+' out of 5" />')}setStars();$("#reviewForm").submit(function(){$("#recaptcha_instructions_error").hide();var b=$("#reviewName").val(),d=$("#reviewEmail").val(),e=$("#reviewText").val().replace(/\=/g,"%3D").replace(/\x26/g,"%26");if(b==null||b=="")$("#reviewMsgBox").attr("class",
"error").empty().text("Error: You must enter a name!");else if(d==null||d=="")$("#reviewMsgBox").attr("class","error").empty().text("Error: You must enter an e-mail address!");else if(e==null||e=="")$("#reviewMsgBox").attr("class","error").empty().text("Error: You must enter review text!");else{$("#ratingPH").html('<input type="hidden" name="reviewRating" value="'+rating+'" />');var f="";$("#reviewForm input[type!='submit']").each(function(){f+=$(this).attr("name")+"="+$(this).val().replace(/\=/g,
"%3D").replace(/\x26/g,"%26")+"&"});f+="reviewText="+escapeVal(e,"<br />");$.ajax({type:"post",url:"/addreview.aspx",data:f,cache:false,success:function(h){handleResponse(h)}})}return false});$("#writeReviewLink").click(function(){$(this).blur();if(writeReviewBox.is(":hidden")){writeReviewBox.slideDown("slow");$("#reviewMsgBox").show();$("#writeReviewLink").html("Close review form").attr("title","Close review form")}else{writeReviewBox.slideUp("slow");$("#writeReviewLink").html("Write a review").attr("title",
"Write a review")}})}});
function handleResponse(a){if(a=="Success"){$("#recaptcha_instructions_error").attr("style","display:none");$("#recaptcha_instructions_image").attr("style","display:inline !important");Recaptcha.reload();writeReviewBox.before('<p class="yellowbg" id="thanksMsg">Thank you for your review! Your entry should be displayed here within the next few days.</p>');$("#reviewMsgBox").attr("class","yellowbg").empty().text("Please fill in the information below to submit your review for authentication");$("#reviewMsgBox").hide();
$("#thanksMsg").fadeIn("slow");writeReviewBox.slideUp("slow");$("#writeReviewLink").html("Write a review").attr("title","Write a review");setTimeout('$("#thanksMsg").fadeOut("slow", function (){ $(this).remove() })',6E3)}else{if(a.indexOf("Error Code 1")>-1)writeReviewBox.before('<p class="yellowbg" id="errorMsg">'+a.replace("Error Code 1: ","")+"</p>");else if(a.indexOf("Error Code 2")>-1){$("#recaptcha_instructions_error").attr("style","display:inline !important");$("#recaptcha_instructions_image").attr("style",
"display:none");Recaptcha.reload()}else a.indexOf("Error Code 3")>-1&&writeReviewBox.before('<p class="yellowbg" id="errorMsg">'+a.replace("Error Code 3: ","")+"</p>");setTimeout('$("#errorMsg").fadeOut("slow", function (){ $(this).remove() })',6E3)}}function setRating(a){rating=a;setStars()}function setStars(){var a,b;b=0;ratingList.find("img").each(function(){b++;a=rating>=b?1:0;$(this).attr("src","http://cdn.blackcountrycaravans.co.uk/images/layout/stars/"+a+"star-single.png")})}
function escapeVal(a,b){a=escape(a);for(i=0;i<a.length;i++)if(a.indexOf("%0D%0A")>-1)a=a.replace("%0D%0A",b);else if(a.indexOf("%0A")>-1)a=a.replace("%0A",b);else if(a.indexOf("%0D")>-1)a=a.replace("%0D",b);return unescape(a)};
