/**
 * this script sets up the thickbox for generic edit in place.
 * functions are still custom, but they all use this basic box.
 */

jQuery(function($){    

$('body').append('<div id="inputModal" class="modal" style="display:none;overflow:none;">' +
'<form class="yellow_form">' +
'<fieldset>' +
'<label></label>' +
'<input id="inputModalId" type="hidden" name="inputModalId">' +
'<input id="inputModalText" type="text" style="display:none" name="name">' +
'<textarea id="inputModalTextArea" style="display:none" class="textwide" name="name"></textarea>' +
'<p class="submit taller" style="clear:both">' +
'<a id="inputModalSave" class="desc" href="#"><img src="/images/buttons/save.gif" ></a>' +
' or <a id="inputModalCancel" href="#">Cancel</a>' +
'</p>' +
'</fieldset>' +
'</form>' +
'</div>');
    
$('#inputModalCancel').click(function(){
    $('#inputModalId').val('');
    $('#inputModalText').val('');
    $('#inputModalText').css('display','none');
    $('#inputModalTextArea').val('');
    $('#inputModalTextArea').css('display','none');
    tb_remove(); 
    return false;
 });


$('body').append('<div id="processingModal" class="modal" style="display:none">' +
'<div>Processing... Please Wait...</div>' +
'<img src="/images/loadingAnimation.gif" /> ' +
'</div>');

/* disable submitting form by hitting enter. important for all ajax modals!!! */
$('.modal :text').keypress(function (e) { 
  if(e.which == 13)  return false;
  return true;
});


});

