/**
 * @author baumann
 */
$(document).ready(function(){
   $('#id-checkbox-copy').bind('click', function() {
        $('#contact_copy').click();
   }).css({'cursor':'pointer', 'display':'inline'});
   
   Captcha.init();
   
 });
 
Captcha = {};

Captcha.init = function()
{
	//alert('captcha.init');
	$('div.captcha img').bind('click', function() {
		//alert(this.src);
		var url = "getnewcaptcha";
		//alert(url);
		//$.get(url ,  function(json) {  alert(json);
	    $.getJSON(url ,  function(json) {
		    if (json.isSuccess == true) {
				$('#customer_captcha-input').attr('value', '');
				$('#customer_captcha-id').attr('value', json.newId);
				$('div.captcha img').attr('src', json.newImageSrc);
			}
		})
	})
	.css({
			'cursor':'pointer'
		});
		/*
	$('#id_captcha div.image')
	.tooltip({'bodyHandler':function() {
			return $('<img/>').attr({'src':'default/index/tooltip/localeId/' + Locales.localeId + '/moduleTmx/registration/captionKey/_key_captcha_Click'});
	 }});
	 */

	 $('#id_captcha div.image').tooltip({
		'showURL':false,
		'id': 'SecteoInputHelp'
	});
}