window.addEvent("domready",function(){$$(".pinkinput").each(function(a){a.getChildren().addEvent("focus",function(){a.addClass("piactive")});a.getChildren().addEvent("blur",function(){a.removeClass("piactive")})});$$(".pinktextarea").each(function(a){a.getChildren().addEvent("focus",function(){a.addClass("ptactive")});a.getChildren().addEvent("blur",function(){a.removeClass("ptactive")})});$("creative-brief-form").addEvent("submit",function(d){d.stop();var b=$$(".pinktextarea");var a="false";b.reverse();b.each(function(e){var g=e.getChildren();g=g[0];if(g.get("value")==""){g.focus();e.addClass("ptmissing");a="true"}else{e.removeClass("ptmissing")}});if(a=="false"){$("send_creative-brief").addClass("pinkdisabled");$("send_creative-brief").set("disabled","disabled");var c=new Request({url:$("creative-brief-form").action,onSuccess:function(e){$("send_creative-brief").set("disabled","");$("send_creative-brief").removeClass("pinkdisabled");if(e.substr(0,6)=="Error:"){var g='<span class="red">'+e+"<span>";$("cb-error").set("html",g);$("cb-error").setStyle("display","block")}else{$("creative-brief-form").reset();$("cb-error").set("html","");$("cb-error").setStyle("display","none");$("content").set("html",e);Cufon.refresh()}}}).post($("creative-brief-form"))}else{var f='<span class="red">Please fill in the red fields<span>';$("cb-error").set("html",f);$("cb-error").setStyle("display","block")}})});