$(document).ready(function(){if(getCookie("toaster")==1){$("body").append('<div id="toaster"><div id="toaster_close">close</div><div id="toaster_content"><div id="toaster_title">Help us improve! <u>Answer 1 question!</u></div><div id="toaster_question"><span>What\'s one thing we could do to help you create your account?</span><br> <small>Include your email if you\'d like follow-up.</small><form id="toaster_form" name="toaster_form"><textarea name="message" id="message"></textarea><br><input type="submit" value="Submit!"></form></div></div></div>');setTimeout("setToasterState('minimize', 1)",1500);$("#toaster_close").click(function(){setToasterState("minimize",1);return false});$("#toaster_content").click(function(){if(toasterState==1){setToasterState("show",2);return false}});$("#toaster_title").click(function(){if(toasterState==2){setToasterState("minimize",1);return false}else{if(toasterState==3){setToasterState("hide",3);return false}}});$('#toaster_form input[type="submit"]').click(function(){var a=$("#toaster_form #message").val();if(a==""){$("#toaster_form #message").css("border","2px solid red");$("#toaster_form #message").focus();return false}$.post("http://"+window.location.host+"/toaster_email.php",{message:a},function(b){if(b=="Success"){setToasterState("minimize",3);$("#toaster_title").text("Thanks!");setTimeout("setToasterState('hide', 3)",2000)}else{$("#toaster_title").text(b)}});return false})}});function setToasterState(a,b){$("#toaster_form #message").css("border","0px");if(a=="show"){toasterState=b;$("#toaster").animate({bottom:"0"},500,function(){$("#toaster_content").css("cursor","auto");$("#toaster_close").fadeIn(500)})}else{if(a=="minimize"){toasterState=b;$("#toaster_close").hide();$("#toaster").animate({bottom:"-155"},500);$("#toaster_content").css("cursor","pointer")}else{if(a=="hide"){toasterState=b;$("#toaster_close").fadeOut(500);$("#toaster").animate({bottom:"-235"},500)}}}}function getCookie(a){if(document.cookie.length>0){c_start=document.cookie.indexOf(a+"=");if(c_start!=-1){c_start=c_start+a.length+1;c_end=document.cookie.indexOf(";",c_start);if(c_end==-1){c_end=document.cookie.length}return unescape(document.cookie.substring(c_start,c_end))}}return""};
