$(document).ready(function(b){window.se={suggestionWindow:null};$("#suggest-a-company").click(function(f){f.preventDefault();var d=$(this).attr("href")||false;if(d){if(window.se.suggestionWindow===null){$.ajax({type:"GET",url:d,success:function(e){window.se.suggestionWindow=e;c();a()}})}else{a()}}});var a=function(){tb_show("Suggest a company","?#TB_inline&inlineId=company-suggestion-window")};var c=function(){$(document.getElementsByTagName("body")[0]).append(window.se.suggestionWindow);$("#suggestion-form-submit").click(function(h){h.preventDefault();var f=$("#company-name");var d=$("#company-website");var i=$("#company-country");if(f.val().trim()==""&&f.val().length<3){alert("Error: Please provide a company name with at least 3 letters.");return}if(d.val().length>0){var g=/((http|https):\/\/)?(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;if(!g.test(d.val())){alert("Error: Please provide a valid website address.");return}}if(i[0].selectedIndex<1){alert("Error: Please select a country.");return}$.ajax({type:"POST",url:$("#sform").attr("action"),data:$("#sform").serialize(),success:function(e){if(e.status){if(e.status==="failure"){alert("Failure: "+e.message);return}else{if(e.status==="success"){$("#company-name").val("");$("#company-website").val("");$("#company-country").selectedIndex=0;alert("Company successfully submitted.")}}}tb_remove()}})})}});
