/*<![CDATA[*/

jQuery.noConflict();

// SIMPLE FONT COLOR CHANGER/ANIMATIONS
// // @param   bg      CSS:background-color
// // @param   col     CSS:color
// // @param   sp      animate.speed
jQuery.fn.colorPitch = function(bg, col, sp) {

    var colors = { 
        bg : jQuery(this).css('background-color'),
        col : jQuery(this).css('color')
    }   
    jQuery(this).hover(function(){
        jQuery(this).stop().animate({
            'background-color': bg, 
            'color': col 
        }, sp);
    }, function() {
        jQuery(this).stop().animate({
            'background-color': colors.bg,
            'color': colors.col
        }); 
    }, sp);
};

// DOCUMENT READY
jQuery(document).ready(function(){

//    jQuery('.content a').colorPitch('#F2F7FC', '#537184', 120);

    jQuery("#newsletter1, #newsletter2").submit(function(event) {

        event.preventDefault();

        var jQueryform = jQuery( this ),
            url = jQueryform.attr( 'action' ),
            dat = jQueryform.serialize();

        jQuery.ajax({
            type: "POST",
            url: url,
            data: dat,
            success: function(ret) {
                jQuery('.result').html(ret);
                jQuery('.result').stop(true, true).fadeIn(800).delay(5000).fadeOut(1000);
            }
        });
        return false;
    });


    jQuery(':input.inputField').textFieldPlaceholder();
});

(function( jQuery ){
    jQuery.fn.textFieldPlaceholder = function() {

        var colorVal = '#A0A0A0';

        this.css({color:colorVal});
        var value = this.val();
        this.focus(function(){ 
            jQuery(this).css({color:'#232323'});
            if(jQuery(this).val() == value){
                jQuery(this).val('');
            }
        });
        this.focusout(function(){
            if(jQuery(this).val() == ''){
                jQuery(this).css({color:colorVal}).val(value);
            }
        });
    };
})( jQuery );

