/* Made With Joy by What Cheer */
$(function(){$('#sub_btn').click(function(){$('#sub_btn').attr("disabled","true");$('#sub_btn').attr("value","Please Wait...");$('.form *').removeClass('error');$.post("../postreason.php",{process:'1',reason:$('#reason').val(),name:$('#name').val(),email:$('#email').val(),photo:$('#upped_photo_filename').val()},function(data){var returned_data=data;if(returned_data=='ok'){$('.form').fadeOut(function(){$('.thankyou').fadeIn()})}else{$('#sub_btn').removeAttr("disabled");eval(returned_data);$('#sub_btn').attr("value","That's Why.")}})});var options={success:showResponse,beforeSubmit:showLoading,url:'postphoto.php'};$('#photo_form').ajaxForm(options);function showResponse(responseText,statusText){if(responseText!='twitter_error'&&responseText!='file_error'&&responseText!='url_error'){$('#upped_photo_filename').val(responseText);$('#sub_btn').removeAttr("disabled");tb_remove();$('#up_feedback').html('<img src="images/user_photos/'+responseText+'" height="17" width="17" /> Looking good.');$('#photo_submit').removeAttr("disabled");$('#photo_processing').html('')}if(responseText=='twitter_error'){$('#photo_submit').removeAttr("disabled");$('#photo_processing').html('There was a problem grabbing your Twitter photo.<br />Check your username and try again.<br />If problems persist, it may be due to problems with Twitter.')}if(responseText=='file_error'){$('#photo_submit').removeAttr("disabled");$('#photo_processing').html('There was a problem uploading your photo.')}if(responseText=='url_error'){$('#photo_submit').removeAttr("disabled");$('#photo_processing').html('There was a problem grabbing your photo from your URL.<br />Double check the URL and also make sure it is a valid photo type.')}}function showLoading(){$('#photo_submit').attr("disabled","true");$('#photo_processing').html('<img src="images/loading.gif" />')}});function selectRadio(id){var select_id=id;$('#'+select_id).attr('checked','checked')}function clearDefault(elem){if(elem.value==elem.defaultValue)elem.value=''}function restoreDefault(elem){if(elem.value=='')elem.value=elem.defaultValue}