$(document).ready(function(){$("#imgHelp").click(function(){dialog("To add images to your listing please follow the steps below<br/><br/>1.  From the html editor click on the tree icon.<br/><br/>2. In the general tab click on the little box to the right of the URL field.<br/><br/>3. Click on upload.<br/><br/>4.  Upload images<br/><br/>5. Double click the image you want.<br/><br/>6. Enter Image Description and Title if needed and edit the options in the Appearence tab if you want to get perfect placment.<br/><br/> 7.  Click Insert<br/><br/>8.  WARNING - Images will be entered in the size you upload them.<br/>Please cut images down to size before uploading.<br/><br/>","info");return false});$(".confirm").click(function(){if(confirm("Are you sure?")){return true}else{return false}});$("input[type=file]").change(function(){$(this).parent("div").parent("div").find("input[type=text]").attr("value",$(this).val())});$("#subscribe").submit(function(){var e=trim($("#subscribe input").val());if(e=="enter.your@email.com"){dialog("Please enter your e-mail address","err")}else{if(e==""){dialog("Please enter your e-mail address","err")}else{if(!isEmail(e)){dialog("Please enter a valid e-mail address","err")}else{return true}}}return false});var b=function(){var e=$(".adv");for(var f=0;f<e.length;f++){if(!e[f].checked){$(".checkall").removeAttr("checked");$(".check input").removeAttr("checked");return true}else{if(f==e.length-1&&e[f].checked){$(".checkall").attr("checked",true);$(".check input").attr("checked",true)}}}};$(".adv").click(b);$("form.catsListings").submit(function(){var e=$("input.adv");for(var f=0;f<e.length;f++){if(e[f].checked){return true}}dialog("Please select a franchise to request an information pack on by ticking the checkbox next to their listing","err");return false});$("#adverts:not(.home) td").attr("valign","top");$("#adverts td").hover(function(){$(this).addClass("hover")},function(){$(this).removeClass("hover")});$("#subscribe input").focus(function(){var e=trim($(this).val());if(e=="enter.your@email.com"){$(this).attr("value","")}});$("#subscribe input").blur(function(){var e=trim($(this).val());if(e==""){$(this).attr("value","enter.your@email.com")}});$("#franInfoTbl tr").attr("valign","top");$("select[name=comp_sel]").change(function(){$.ajax({type:"POST",url:"ajax.php",data:"intro="+$("select[name=comp_sel]").val(),success:function(e){if(trim($("textarea[name=text2]").val())!=""){if(confirm("Do you want to change Text2?")==true){$("textarea[name=text2]").text(e)}}else{$("textarea[name=text2]").text(e)}}})});$(".titleHelp").click(function(){dialog("<img src='images/Adv-BrowserTitleHelp.gif' alt=''/>","suc");return false});$(".metaDescHelp").click(function(){dialog("<img src='images/Adv-MetaDescHelp.jpg' alt=''/>","suc");return false});$(".h1Help").click(function(){dialog("<img src='images/Adv-H1Help.png' alt=''/>","suc");return false});$(".h2Help").click(function(){dialog("<img src='images/Adv-H2Help.jpg' alt=''/>","suc");return false});$(".text1Help").click(function(){dialog("<img src='images/Adv-Text1Help.jpg' alt=''/>","suc");return false});$(".text2Help").click(function(){dialog("<img src='images/Adv-Text2Help.jpg' alt=''/>","suc");return false});$(".metaKwHelp").click(function(){dialog("Meta keywords are keywords designed for the search engine to judge the relevance of you page on.<br/>If you are a cleaning franchise you could enter something like:<br/><br/>cleaning franchises,domestic cleaning franchise,franchise for sale<br/><br/>Please enter commas between each keyword/phrase you enter","suc");return false});$("#right .colapse").click(function(){var e=$(this).next("ul").css("display");if(e=="none"){$(this).next("ul").show("normal")}else{$(this).next("ul").hide("normal")}return false});$(".showTestimonials").click(function(){dialog($(".testimonials").html(),"");return false});$("#moreContacts").click(function(){$("#joinForm label.text:last").after('<label><input type="text" name="contacts[]"/>Contact ('+($("#joinForm label.text").size()+1)+"):</label>");return false});$("#userNewsletter").keyup(function(){var f=$(this).val().length;var e=500;if(f>e){$("#remainingChars").html("You cannot write more then "+e+" characters!");$("#userNewsletter").val($(this).val().substr(0,e));return false}else{$("#remainingChars").html("You have "+(e-f)+" characters left.");return true}});$("#adverts img").error(function(){this.src="/images/blank.png";this.onerror="";return true});createEditor("article");$(".add2Cart").click(function(){var e=$(this).attr("class").replace(/add2Cart id_/,"");$.ajax({type:"POST",url:"ajax.php",data:"add2basket="+e,success:function(f){$("#basket .count").html(f);$("#basket small").html(f==0?"You have not selected any companies":"You have "+f+" Company selected")}});$("a.add2Cart.id_"+e).hide();$("a.removeFromCart.id_"+e).show();$("#basket").fadeIn("slow");return false});$(".removeFromCart").click(function(){var e=$(this).attr("class").replace(/removeFromCart id_/,"");$.ajax({type:"POST",url:"ajax.php",data:"removeFromCart="+e,success:function(f){$("#basket .count").html(f);$("#basket small").html(f==0?"You have not selected any companies":"You have "+f+" Company selected");if(f==0){$("#basket").fadeOut("slow")}}});$("a.removeFromCart.id_"+e).hide();$("a.add2Cart.id_"+e).show();if($("#theList").html()!=null){$(this).parents("tr").prev().fadeOut("slow",function(){$(this).remove()});$(this).parents("tr").next().fadeOut("slow",function(){$(this).remove()});$(this).parents("tr").fadeOut("slow",function(){$(this).remove();if($("#catItems").find("tr").size()==0){$("#mid").html('<h2 id="theList">Request List</h2>There are no items in your request list')}})}return false});$("#basket .leftArrow").disableTextSelect();$("#basket .leftArrow").click(function(){if($("#basket .current").prev().html()!=null){$("#basket .current").prev().removeClass("hidden");$("#basket .current").addClass("hidden");$("#basket .current").prev().addClass("current");$("#basket .hidden").removeClass("current")}else{$("#basket .current").addClass("hidden");$("#basket .current").removeClass("current");$("#basket .item:last").removeClass("hidden");$("#basket .item:last").addClass("current")}});$("#basket .rightArrow").click(function(){if($("#basket .current").next().html()!=null){$("#basket .current").next().removeClass("hidden");$("#basket .current").addClass("hidden");$("#basket .current").next().addClass("current");$("#basket .hidden").removeClass("current")}else{$("#basket .current").addClass("hidden");$("#basket .current").removeClass("current");$("#basket .item:first").removeClass("hidden");$("#basket .item:first").addClass("current")}});$("#basket .rightArrow").disableTextSelect();$("#hearAboutUs").change(function(){if($(this).val()=="Other"){$("label.hearOther").css("display","block")}else{$("label.hearOther").css("display","none")}});$("#joinForm input").keydown(function(f){if(goBaby){goBaby=false;$.ajax({type:"POST",url:"ajax.php",data:"unSentForm="+window.location,success:function(e){}})}});if(!readCookie("popup")){if(typeof(showMatchPointPopup)!="undefined"){createCookie("popup",1,7);tb_show("MatchPoint Franchise Finding Service","http://"+document.domain+"/matchpoint.html?KeepThis=true&TB_iframe=true&height=580&width=445",false)}}if(typeof(showRecommendedPopup)!="undefined"){tb_show("Recommended","http://"+document.domain+"/recommended.html?KeepThis=true&TB_iframe=true&height=450&width=545",false)}$("#cna-franchise-overview").click(function(){tb_show("Franchise overview","http://"+document.domain+"/cna-franchise-overview.html?KeepThis=true&TB_iframe=true&height=300&width=545",false)});$("#cna-franchise-video-testimonial").click(function(){tb_show("Franchise Video Testimonial","http://"+document.domain+"/cna-franchise-video-testimonial.html?KeepThis=true&TB_iframe=true&height=300&width=545",false)});$(".video-link").click(function(){var e=$(this).attr("href");tb_show("Video",e+"&KeepThis=true&TB_iframe=true&height=400&width=580",false);return false});$("#basket").draggable({stop:function(e,f){createCookie("basketPosition",$("#basket").css("left")+", "+$("#basket").css("top"),30)}});var d=readCookie("basketPosition");if(d){var c=d.split(",");$("#basket").css({left:c[0],top:c[1]})}$("#resultsAddAll").click(function(){var e="";$("#adverts .add2Cart:visible").each(function(){var f=$(this).attr("class").replace(/add2Cart id_/,"");e+="&id[]="+f;$("a.add2Cart.id_"+f).hide();$("a.removeFromCart.id_"+f).show()});$.ajax({type:"POST",url:"ajax.php",data:"resultsAddAll=1"+e,success:function(f){$("#basket .count").html(f);$("#basket small").html(f==0?"You have not selected any companies":"You have "+f+" Company selected");window.location="request-list.html#form"}});return false});try{$(".advertsSlider").slider({animate:true,max:12,slide:handleSliderSlide})}catch(a){alert(a)}$(".slidingAdverts a").click(function(){var e=$(this).attr("id").replace(/id_/,"");$.ajax({type:"GET",url:"ajax.php",data:"advertClick=1&type=sliding_adverts&refferal="+encodeURIComponent(window.location)+"&id="+e})});$(".slidingAdverts a").tooltip({track:true,opacity:1,bodyHandler:function(){return $(".slidingAdvertsDesc div").eq($(this).index()).html()},showURL:false})});function handleSliderSlide(c,b){try{$(".slidingAdverts a").filter(function(d){return d<b.value}).hide();$(".slidingAdverts a").filter(function(d){return d>=b.value}).show()}catch(a){alert(a)}}var goBaby=true;