/*
 * Author: Mirko Witzmann
 * Date: 12.02.2010
 * Dependencies: jquery-1.4.1.js
 * Package: deevibe
 */

function deevibe() {

    var self = this;

    this.settings = {
        ajaxPath: 'ajax/',
        successColor: 'green',
        errorColor: '#9d310b'
    };

    this.isValidEmail = function( field ){
        var str=$(field).val();
        var filter=/^.+@.+\..{2,3}$/;
        if (filter.test(str)) {
                return true;
        } else {
                return false;
        }
    };

    this.vote = function( f ){
        var data = $( f ).serialize();
        if( data!='' ){
            $.ajax({
                url: self.settings.ajaxPath+'bewerten.php',
                data: 'action=post&'+data,
                type: 'post',
                success: function( html ){
                    if( html=='true' ){
                        window.location.reload();
                    }
                }
            });
        }
    };
}

var deevibe = new deevibe();
