$(function() {

    swapValues = [];

    $('.swapvalues').each(function(i){

        var text = $(this).prev('label').text();
        $(this).prev('label').css( {'margin-left' : '5px', 'margin-top' : '5px', 'position':'absolute'} );

        if ($(this).val() !== '') {
            $(this).prev('label').css('display', 'none');
        }

        $(this).focus(function(){
            $(this).prev('label').css('display', 'none');
             if ($(this).val() == text) {
                $(this).val("");
            }

        }).blur(function(){

            if ($.trim($(this).val()) == "") {

                // need to ignore if datepicker or colour picker
                if (! $(this).hasClass('iColorPicker', 'datepicker')) {
                    $(this).prev('label').css('display', 'inline');
                }

            }

        });

    });

});

