var modalWindowOk,myTimeOut,needToReplaceSmallFonts;var _gaq = _gaq || [];
function f68(){jQuery.ajaxSettings.traditional=true;getCookie("settingsShowNaughtyWords")!="true"&&f58();var a=$("div.wordcloud.expandToFit");f40(a);$(window).resize(function(){var d=$("div.wordcloud.expandToFit:visible");f40(d)});f88($("div.wordcloud>.cloudword"));f98();var c=["...for your favourite word","...for something cool","...for whatever you like"],b=c[Math.round(Math.random()*(c.length-1))];$("#searchFor").attr("value",
b).focus(function(){$(this).attr("value")==b&&$(this).attr("value","")}).blur(function(){if($(this).attr("value")==""){b=c[Math.round(Math.random()*(c.length-1))];$(this).attr("value",b)}});$("html").css("backgroundColor","rgb(50,50,50)")}
function f98(){$(".needScript").show();if($("#zazzleProductsPreview").length==1){setTimeout("f116();",5E3);$("#zazzleProductsPreview>.zazzlePhoto>span").each(function(){$(this).before("<span style='left:2px;right:-2px;bottom:198px;color:rgb(50,50,50);'>"+$(this).html()+"</span>")})}$("#homepageExample").click(function(){window.location+="word-cloud/make-a-new-one"});$("a.aCloseModal").live("click keypress",function(a){if(a.type=="click"||a.which==13){$(this).closest("div.modalWindow").remove();
return false}});$("a.aModalWindowOk").live("click keypress",function(a){if(a.type=="click"||a.which==13){eval(modalWindowOk)&&$(this).closest("div.modalWindow").remove();return false}});$("a.expander").live("click",function(){$(this).remove()});$(".copyPaste").bind("click",function(){this.select();return false});$("#xWriteToUs").click(function(){f64()});$("#headerLogoLink").bind("contextmenu",function(){alertModal("<p>Looking for this?</p><a href='images/worditoutLogoX320Y100.png'><img id='logoForDownloading' src='images/worditoutLogoX320Y100.png' style='margin:10px auto;display:block;'/></a>",
"WordItOut logo");return false})}function f116(){var a=$("#zazzleProductsPreview").children(":visible");if(a.length==0){setTimeout("f116();",5E3);return false}var c=$(a).next();if(c.length==0)c=$(a).siblings(":first");$(a).fadeOut(1E3,function(){$(c).fadeIn(1E3,function(){setTimeout("f116();",5E3)})})}
function f58(){var a="(jack|dumb)?ass(hole|wipe)?s?|bast(a|e)rds?|blow ?jobs?|boob(ies)?s?|butt(head|hole)?s?|clits?|crapp?s?|cunn?ill?inguss?|cunt(lick)?s?|dildos?|fagg?[oei]ts?|fell?atios?|muffs?|nigg(a|er)s?|orgasi?ms?|porno?s?|slags?|s(l|m)uts?|twats?|whores?|wtfs?";a+="|"+["bia?tch","cock(head|suck)?","cum(m|shot)?","ejaculate?","gang ?bang","jizz?","mast(a|er)bate","piss"].join("(ed|er|ing?)?s?|")+"(ed|er|ing?)?s?";a+="|"+["(butt|cyber|finger|fist|moth(a|er))?(f|ph)uck?","(bull ?|dip)?shit(e|ty)?",
"wank"].join("(a|e|ed|er|ing?)?s?|")+"(a|e|ed|er|ing?)?s?";a=a.replace(/[a]/gim,"(a|4|@|\\*)");a=a.replace(/[b]/gim,"(b|8)");a=a.replace(/[c]/gim,"(c|<|k|\\*)");a=a.replace(/[e]/gim,"(e|3|\u20ac|\\*)");a=a.replace(/[i]/gim,"(i|1|!|\\||\\*)");a=a.replace(/[l]/gim,"(l|1|!|\\|)");a=a.replace(/[o]/gim,"(o|0|\\*)");a=a.replace(/[s]/gim,"([sz5$]+)");a=a.replace(/[u]/gim,"(u|\\*)");var c="\\b("+a+")\\b";$("#discoverWrapper .thumbnail").not(".doNotFilterRudeWords").each(function(){var b=$(this).text();b=
b.replace(/\s/gim," ").toLowerCase();if(b.match(c)!=null){$(this).addClass("naughtyWords").hide();if($(".tertiaryContent:first").hasClass("naughtyWordsNotice")!=true){$(".tertiaryContent:first").before("<div class='tertiaryContent naughtyWordsNotice'><p class='highlight note subtle' style='width:70%;float:left;' ><span class='smallIcon problems' style='float:left'></span>Some of the content above has been removed because it seems to include rude Enlglish words. Click <a id='naughtyWordsModal'>here</a> if you would like to remove this filter. <a href='../community/questions#faq-naughtyWords'>More information</a>.</p></div>");
naughtyWordsButtons()}}})}
function naughtyWordsButtons(){$("#naughtyWordsModal").click(function(){modalWindowOk="f8();";f22("<p>By ticking the box below, you will deactivate our rude word filter.<br />We will save this setting for your future visits.</p> <p> <input id='naughtyWordsCheckBox' type='checkbox' name='naughtyWords' value='true'/> I am 18 years or over</p>");$("#naughtyWordsCheckBox").focus()});$("#hideNaughtyWords").click(function(){f95("settingsShowNaughtyWords","false");window.location.reload()})}
function f8(){if($("#naughtyWordsCheckBox:checked").val()!=null){f95("settingsShowNaughtyWords","true");window.location.reload();return true}else{f61("If you agree, tick the box");return false}}
function f76(){$("#wcWrapperFullScreen>div.wordcloud").css("margin-top","");$("#wcWrapperFullScreen").css("position","fixed").css("max-width","").css("max-height","").css("max-width",$("#wcWrapperFullScreen").width()).css("max-height",$("#wcWrapperFullScreen").height()).css("position","relative");f40($("#wcWrapperFullScreen>div.wordcloud"));$("#wcWrapperFullScreen>div.wordcloud").each(function(){$(this).css("margin-top",(parseInt($(this).parent().css("max-height"))-
$(this).height())/2)})}
function f88(a){if(needToReplaceSmallFonts==null||needToReplaceSmallFonts==undefined){$("#footer").append("<div id='needToReplaceSmallFonts' style='position:absolute;bottom:0;left:0;right:0;font-size:5px;text-align:center;color:rgb(50,50,50);'>Testing</div>");var c=parseFloat($("#needToReplaceSmallFonts").get(0).style.fontSize.replace("px",""));needToReplaceSmallFonts=$("#needToReplaceSmallFonts").height()>c+1?true:false;$("#needToReplaceSmallFonts").remove()}if(needToReplaceSmallFonts)a.each(function(){var b=parseFloat(this.style.fontSize.replace("px",
""));b<10&&$(this).height()>b*1.1&&$(this).text($(this).text().replace(/\S/gi,"~")).css("letter-spacing","-3.5px").css("word-spacing","-2px")});else return false}
function f40(a){a.each(function(){var c,b=$(this),d=b.width(),e=b.height();b.css("width","100%");b.css("height","100%");if(b.width()==0&&b.height()!=0){b.css("width",d);c=b.height()/e}else if(b.width()!=0&&b.height()==0){b.css("height",e);c=b.width()/d}else c=b.width()==0&&b.height()==0?1:b.width()/b.height()>d/e?b.height()/e:b.width()/d;b.css("width",d*c);b.css("height",e*c);if(e*c>b.parent().height()){c=b.parent().height()/e;b.css("width",d*c);b.css("height",e*c)}else if(d*c>b.parent().width()){c=
b.parent().width()/d;b.css("width",d*c);b.css("height",e*c)}b.children().each(function(){$(this).css("font-size",parseFloat(this.style.fontSize.replace("px",""))*c+"px");$(this).css("left",parseFloat($(this).css("left").replace("px",""))*c+"px");$(this).css("top",parseFloat($(this).css("top").replace("px",""))*c+"px")})})}
function f66(){f101();$("#wcDownload").bind("submit",function(){if($("#wcDownload").hasClass("submitted"))return false;else{$("#wcDownload").addClass("submitted");f61("Creating image...");_gaq.push(["_trackEvent","Download","Word cloud Normal PNG",location.href]);setTimeout("$('#wcDownload').removeClass('submitted');",5E3)}});$("#wcFullScreen").css("display","inline-block").bind("click",function(){$("#header").hide();$("#quickLinks").hide();$("#mainContentWrapper").hide();
$("#footer").hide();$("body").css("min-width","0").css("background-color","rgb(50,50,50)");var b=$("#wcWrapper").html();$("body").append("<div id='wcWrapperFullScreen'>"+b+"</div>");f76();$(window).resize(f76);f61("Click anywhere or press a button to close");$("html,body").bind("click keypress",function(){$("#wcWrapperFullScreen").remove();$("body").css("min-width","").css("background-color","");$("#wcWrapperFullScreen *").css("cursor","");$("html,body").unbind("click keypress");
$("#header").show();$("#quickLinks").show();$("#mainContentWrapper").show();$("#footer").show();return false});$("html,body").bind("mousemove",function(){clearTimeout(myTimeOut);$("#wcWrapperFullScreen *").each(function(){$(this).css("cursor")=="none"&&$(this).css("cursor","")});myTimeOut=setTimeout("$('#wcWrapperFullScreen *').css('cursor','none');",1500)});$("html,body").mousemove();return false});var a=$("#zazzleLink").attr("href");$.data(document.body,"zazzleLink",a);$("#zazzleLink").removeAttr("href");
var c=false;var countryCode=null;if(google.loader.ClientLocation!=null){countryCode=google.loader.ClientLocation.address.country_code.toLowerCase();}switch(countryCode){case "au":a=".com.au";break;case "br":a=".com.br";break;case "ca":a=".ca";break;case "fr":case "ad":case "mc":a=".fr";break;case "de":a=".de";break;case "nz":a=".co.nz";break;case "pt":a=".pt";break;case "es":a=".es";break;case "gb":case "uk":case "im":a=".co.uk";break;case "us":a=".com";break;case "al":case "at":case "ba":case "be":case "bg":case "by":case "ch":case "cy":case "cz":case "dk":case "ee":case "fi":case "fo":case "gg":case "gi":case "gr":case "hr":case "hu":case "is":case "it":case "je":case "li":case "lu":case "lv":case "md":case "mt":case "nl":case "no":case "pl":case "ro":case "ru":case "se":case "si":case "sj":case "sk":case "sm":case "ua":case "va":case "yu":a=
".eu";break;default:a=".com";c=true}c==false?$('#zazzleArea option[value="'+a+'"]').attr("selected",true):$("#zazzleArea option:last").attr("selected",true);$("#zazzleProductsDiagram").addClass("isLink");f15(a);$("#zazzleArea select").bind("change",function(){f15($(this).val())});a=$("#wcWrapper").html();$("#zazzleCopiedWC").html(a).show();a=$("#zazzleCopiedWC .wordcloud");f40(a);f88($("#zazzleCopiedWC .wordcloud>.cloudword"))}
function f15(a){var 
c=$.data(document.body,"zazzleLink");if(a==".eu"){a=".co.uk";c+="&zcur=EUR"}c=c.replace(".com",a);$("#zazzleLink,#zazzleProductsDiagram").unbind().bind("click keypress",function(b){if(b.type=="click"||b.which==13){f61('Just a moment please...');_gaq.push(["_trackEvent","Zazzle API",location.href,b.target.id]);window.location=c;return false}});$("#zazzleTLD").text(a)}
function f65(){$("a.xChangePrivateLink").click(function(){modalWindowOk="f14("+$(this).closest("tr").attr("id").replace("wordCloud-","")+");";var a="<p>Are you sure you want to change this change this link?</p>";a+="<p>Anybody you have shared the current link to will not be able to access this word cloud anymore.</p>";f22(a);return false});$("a.xDeleteWordCloud").click(function(){modalWindowOk="f35("+$(this).closest("tr").attr("id").replace("wordCloud-",
"")+");";var a="<p>Are you sure you want to delete this word cloud?</p>";a+="<p><b>This action cannot be undone!</b></p>";f22(a);return false});$("a.xChangeAccess").click(function(){var a=$(this).closest("tr").attr("id").replace("wordCloud-","");f13(a);return false});$("#xDeleteUser").click(function(){modalWindowOk="f34("+USERNO+");";var a="<p>Are you sure you want to remove all your information from WordItOut?</p>";a+="<p><b>This action cannot be undone!</b></p>";
f22(a);return false})}function f14(a){f41();f61("Changing private link...");$.post(BASEFILE,{action:"changePrivateLink",wcId:a},function(c,b,d){eval(c)})}function f35(a){f41();f61("Deleting word cloud...");$.post(BASEFILE,{action:"deleteWordCloud",wcId:a},function(c,b,d){eval(c);f42()})}
function f13(a){f41();f61("Changing access...");$.post(BASEFILE,{action:"changeAccess",wcId:a},function(c,b,d){eval(c)})}function f34(a){f41();f61("Removing user...");$.post(BASEFILE,{action:"deleteUser",userId:a},function(c,b,d){eval(c)})}
function f64(){var a="<div><p>Your email address ";if($("#messageForm").hasClass("requiredEmail"))a+="<span style='color:red;font-size:0.9em;'>* required</span>";a+="</p><input id='iEmailMessageFromAddress' class='validateEmail' type='text' maxlength='100' name='email'></input></div>";a+="<div><p>Subject [<span class='maxLengthCheck'>0</span>/100]</p><input id='iEmailMessageSubject' type='text' name='subject'></input></div>";a+="<div><p>Message [<span class='maxLengthCheck'>0</span>/500]</p><textarea id='iEmailMessage' name='message'></textarea></div>";
a+="<a id='xSendUsAMessage' class='button'>Send</a>";$("#messageForm").append(a);$("#messageForm").ready(function(){$("#messageForm").fadeIn(1E3,function(){f115();f11();$("#iEmailMessageFromAddress").focus()});$("#xSendUsAMessage").click(function(){f93()})})}
function f93(){if($("#messageForm").hasClass("requiredEmail")&&$.trim($("#iEmailMessageFromAddress").val())==""){f61("You haven't put in an email address");$("#iEmailMessageFromAddress").focus();return false}if($.trim($("#iEmailMessageFromAddress").val())!=""&&$("#iEmailMessageFromAddress").hasClass("valid")==false){f61("Please check you've typed your email address correctly");$("#iEmailMessageFromAddress").focus();return false}if($("#messageForm span.maxLengthCheck").hasClass("warning")){f61("You've put too many letters here");
$("#messageForm span.maxLengthCheck.warning").parent().next().focus();return false}var a=$.trim($("#iEmailMessageFromAddress").val()),c=$.trim($("#iEmailMessageSubject").val()),b=$.trim($("#iEmailMessage").val());if(c==""&&b==""){f61("You need to write something!");$("#iEmailMessage").focus();return false}f41();f61("Sending...");var d=$("h1.pageHeader").text();$.post(BASEFILE,{action:"messageFromPerson",emailMessageFromAddress:a,emailMessageSubject:c,emailMessage:b,
emailMessagePage:d},function(e,f,g){eval(e);f42()})}function f55(){window.history.back()}function f61(a){f96(a,"informStatus")}
function f96(a,c){var b=$("div.status").stop(true,true).filter(":last").attr("id");if(b==undefined)b=0;else{b=b.replace("status","");b=parseInt(b);b+=1}$("div.status").each(function(){var d=$(this).outerHeight()+5;$(this).animate({top:"+="+d},100).css("background-color","rgb(50,50,50)").css("color","rgb(210,210,225)").css("opacity",1)});$("body").append("<div id='status"+b+"' title='Click to remove' class='status "+c+"'>"+a+"</div>");setTimeout("f87("+b+");",5E3);$("#status"+b).mouseover(function(){$(this).fadeTo("fast",
0.25);return false}).mouseout(function(){$(this).fadeTo("fast",1);return false}).click(function(){$(this).hide();return false}).animate({opacity:"1"},200).animate({opacity:"0.5"},200).animate({opacity:"1"},200).animate({opacity:"0.5"},200).animate({opacity:"1"},200)}function f87(a){a=parseInt(a);$("#status"+a).fadeOut(3E3,function(){$(this).remove()})}
function f22(a,c){if(c==null)c="Please confirm";a+="<div class='buttons'><a title='Continue' class='button important aModalWindowOk'  tabindex='0'><span class='tick'></span>OK</a><a title='Close' class='aCloseModal button' tabindex='0'><span class='cross'></span>Cancel</a></div>";f23(a,c)}
function alertModal(a,c){a+="<div class='buttons'><a title='Continue' class='button important aCloseModal' tabindex='0'><span class='tick'></span>OK</a></div>";f23(a,c)}
function f23(a,c){if(c==undefined||c==null)c="&nbsp;";a="<div class='modalWindow'><a title='Close' class='modalCross aCloseModal'>x</a><h1>"+c+"</h1><div class='modalContent'>"+a+"</div></div>";$("#everywhere").before(a);$(document).ready(function(){var b=$("#everywhere").prev();f102(b)})}
function f100(a){a.css("left",$("body").width()/2-a.width()/2);a.css("top",(typeof window.pageYOffset=="number"?window.pageYOffset:document.documentElement.scrollTop)+window.screen.availHeight*0.1)}function f102(a){f100(a);a.fadeIn("normal",function(){});a.find(".aModalWindowOk").focus()}function f101(){$("#quickLinks").append("<a style='float:right;display:inline;' onclick='f55();'>Go back</a>")}
function f115(){$("span.maxLengthCheck").each(function(){$(this).parent().next().bind("keyup",function(){f16($(this))}).bind("mouseup",function(){f16($(this))}).map(function(){f16($(this))})})}
function f16(a){var c=$(a).parent().find("span.maxLengthCheck"),b;if(a.get(0).tagName.toLowerCase()=="textarea")b=MAXPARALENGTH;else if(a.get(0).tagName.toLowerCase()=="input")b=MAXLINELENGTH;c.text(a.val().length);if(a.val().length>b){c.addClass("warning");a.addClass("warning")}else{c.removeClass("warning");a.removeClass("warning")}}
function f11(){$(".validateEmail").each(function(){$(this).bind("focus",function(){$(this).prev().show()}).bind("blur",function(){$(this).prev().hide()}).bind("keyup mouseup blur",function(){$.trim($(this).val()).match(/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/gi)?$(this).addClass("valid").prev().addClass("tick").removeClass("cross"):$(this).removeClass("valid").prev().addClass("cross").removeClass("tick")});$(this).before("<div style='float:right;display:none;position:relative;top:1em;' title='Format check' class='cross'></div>")})}
function f41(){$("#everywhere").show();$("div.modalWindow").css("z-index","90")}function f42(){$("#everywhere").hide();$("div.modalWindow").css("z-index","")}function f95(a,c){var b=new Date;b.setDate(b.getDate()+2E3);document.cookie=a+"="+escape(c)+";expires="+b.toGMTString()+"; path=/"}
function getCookie(a){if(document.cookie.length>0){var c=document.cookie.indexOf(a);if(c>=0){c=c+a.length+1;a=document.cookie.indexOf(";",c);if(a==-1)a=document.cookie.length;return unescape(document.cookie.substring(c,a))}}return false};
