 /*function submitFormAjax(F, AjaxUrl, ToCallOnSuccess){   
   
   // prepare Options Object 
   alert(AjaxUrl);
var options = { 
    url: AjaxUrl,
    success:getServerResponse   
    };
   
    F.ajaxSubmit(options);
    alert('submit2'); 
    return false;    
    /*{
      
      success: function(t) {
          alert("Form submission a success. The server has returned: " + t); 
          }}*/
  /*}
  */
  function goToURL(toURL){
    document.location.href = toURL;
    return false; 
  }
  
  function getServerResponse(t){
    alert("Form submission a success. The server has returned: "+t);     
  }

  
  function resetErrorDisplay(ID){
    jQuery('#errorBox'+ID).hide();    
  }
  
  function disableForm(ID, ClassToDraw){
		jQuery('input[type="submit"]', '#'+ID ).attr("disabled", "true"); 
		jQuery('#'+ID).fadeOut('fast', function(){					
					jQuery('#'+ID+'').after('<div class="formWaitingMargin" id="fwm'+ID+'"><div class="'+ClassToDraw+'" id=\'fw'+ID+'\'><div class=\'formWaitingPad\'><img src=\''+pfk.pathToGeneric+'/images/ajax-loader.gif\'></div></div></div>');    
					jQuery('#fwm'+ID).css('height',(jQuery('#'+ID+'').height())+'px');
					jQuery('#fwm'+ID).css('width',(jQuery('#'+ID+'').width()-4)+'px');
					var borderW = jQuery('#'+ID+'').css('border');
					if(borderW == '')
						 jQuery('#fw'+ID).css('border', '0px solid #fff !important');				
			}); 
  }
	
	
	  function enableForm(ID){	  
		jQuery('input[type="submit"]', '#'+ID ).removeAttr("disabled"); 
	  jQuery('#fwm'+ID).hide(2, function(){ 
			  	jQuery('#fwm'+ID).remove();
			  	jQuery('#'+ID+'').show();
			 });
  }
	
	jQuery.fn.disableFormJQ = function(){		
		var fH = $(this).closest('div.newBox').height() + 'px';
		var fW = $(this).closest('div.newBox').width() + 'px';
		var borderW = $(this).closest('div.newBox').css('border');
		if(jQuery(this).closest('div.newBox').size() == 0){
			jQuery(this).wrap('<div class="newBox"></div>');			
		}
		jQuery(this).closest('div.newBox').children().hide();	
		$(this).attr('disabled', true);	
		$(this).closest('div.newBox').append('<div class="formWaitingMargin" id="fwm"><div class="" id="fw"><div class=\'formWaitingPad\'><img src="'+pfk.pathToGeneric+'/images/ajax-loader.gif"></div></div></div>');    
		$(this).closest('div.newBox').find('.formWaitingMargin').css('height',fH);
		$(this).closest('div.newBox').find('.formWaitingMargin').css('width',fW);
		
		$(this).closest('div.newBox').find('.formWaitingMargin').show();
		$(this).closest('div.newBox').find('.formWaitingMargin').children().show();
	}
  

	
	jQuery.fn.enableFormJQ = function(){
		$(this).attr('disabled', false);
		jQuery('input[type="submit"]', this ).removeAttr("disabled");		
		if($(this).closest('div.newBox').find('.formWaitingMargin').size() >0){				
				jQuery(this).closest('table').show();
				$(this).closest('div.newBox').find('.formWaitingMargin').remove();
		}
		else{
			jQuery(this).closest('table').show();
		}
		return this;
	}
	
	var i = 1;
	function removeKeyValue(e){
		jQuery(e).parent().parent("tr").remove();	
		i--;
		renumberKeyValueItem();           
	}
	
	function renumberKeyValueItem(){				
		i = 1;		
		jQuery('.keyvalueNumber').each(function(){
			jQuery(this).html('<b>'+(i++)+'</b>');
		})
	}
	
	function addKeyValue(){
		i++;
		jQuery('#keyvalueTable').append('<tr><td class="keyvalueNumber"> <b>' + i + '</b></td><td><input type="text" name="key[]" id="key1" value="" size ="20" maxlength="75"/ class="inputText "  ></td><td><input type="text" name="value[]" id="value1" value="" size ="20" maxlength="75"/ class="inputText "  ></td> <td><span class="removeKeyValue">X</span></td></tr>');             
		jQuery(".removeKeyValue").click(function() {
			removeKeyValue(this);	
		});
		 renumberKeyValueItem();      
	}
	      

	function renumberItem(ItemClass){
	  var i = 1;
	  jQuery(ItemClass).each(function (){
	    jQuery(this).html(i);
	    i++;
	  });
	  
	}