// --------------------------------------------------------------------------------------------------------------------------------
// --------------------------------------------------------------------------------------------------------------------------------
// toggling code;
// depends: 	jQuery library;
// author:		mdja;
// --------------------------------------------------------------------------------------------------------------------------------
// --------------------------------------------------------------------------------------------------------------------------------

// -- define namespace;
if (typeof Barclaycard !== 'object') var Barclaycard={};
if (typeof Barclaycard.RRP !== 'object') Barclaycard.RRP={};

Barclaycard.RRP.replace = function(el) {
	var root_el = el;
	var fieldValue = $(root_el).attr('value');
	
	var replace = function() {
		if (fieldValue == $(root_el).attr('value')) {
			$(root_el).attr('value','');
		} else if ($(root_el).attr('value') == '') {
			$(root_el).attr('value',fieldValue);
		}
	};
	
	$(root_el).focus(replace);	
	$(root_el).blur(replace);
};


$(function() {
	$('input.replace').each(function() {new Barclaycard.RRP.replace(this);});
})

// --------------------------------------------------------------------------------------------------------------------------------
// --- end of file --- 
// -------------------------------------------------------------------------------------------------------------------------------

