function wDswapImgRestore(el, i) { //v3.0
  $(el).find('img').attr('src', i);
}

function wDswapImage(el, i) { //v3.0
  $(el).find('img').attr('src', i);
}

$(document).ready(function(){	
	// init auto-clear inputs
	$("*[rel='auto-clear-value']").focus(function(){
	  if ($(this).val() == $(this).attr('alt')) $(this).val('');
	});
	
	$("*[rel='auto-clear-value']").blur(function(){
	  if ($(this).val() == '') $(this).val($(this).attr('alt'));
	})
	
	$("a.fbox-image").hover(function(){
	  $(this).css('position', 'relative');
    $(this).append('<img src="/images/ico-zoom.png" alt="" class="zoom-ico" />');
	}, function(){
	  $(this).find('.zoom-ico').remove();
	});
	
	$("a.fbox-image").fancybox({
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'elastic'
	});
	
	// Pre-Load images
	var images = [
	  '/images/ico-wsd-logo-ovr.png'
	  ];

  $(images).each(function(key, value) {
    var img = new Image();
    $(img).attr('src', value).error(function (){
      alert('Error preloading image ' + value);
    })
  });
});

