
function refreshClick(event)
{
	//$('.cap_img').attr('src','/images/spacer.gif');
	$('.cap_img').attr('alt','wird geladen...');
	$.ajax({
			type:		"GET",
			url:		"refreshcap.php"+event.data.ssid,
			dataType:	"text",
			async: true,
			success:	function(jData){
								$('.cap_img').attr('src','/captch.php'+event.data.ssid+ (event.data.ssid ?'&':'?')+'tkn='+((new Date()).getTime()));
								$('.cap_img').attr('alt','');
					},
			error:		function(xhr, ajaxOptions, thrownError){
								$('.cap_img').attr('src','/captch.php'+event.data.ssid+ (event.data.ssid ?'&':'?')+'tkn='+((new Date()).getTime()));
								$('.cap_img').attr('alt','');
							//	alert(xhr.status);
								alert(ajaxOptions);
			}
			
	 });
	 return false;
}

function refreshCaptcha(sid)
{
	$(document).ready(function() {
		
		try {
				$('.refresh').attr('type','button');
				$('.refresh').bind( 'click',{ssid:sid},refreshClick );
				
				
		} catch (e)
		{  /*
			* it seems ie has a problem with a changing of  button's attributes
			*/
			$('.refresh').each( function() {
			var obj = $(this).parent();
			$(this).remove();
			button = $('<button type="button"  class="refresh" style="float:right;border:none;" name="refresh" value="refresh">	&nbsp; </button>');
			button.bind( 'click',{ssid:sid},refreshClick );
			obj.append(button);
			$(button).hover (
										function() {$(this).css('background',' url(images/refresh2.jpg) no-repeat')},
										function() {$(this).css('background',' url(images/refresh1.jpg) no-repeat')}
									);
			});
		}
		});
	}


