$(document).ready(function(){

    var uploader = new qq.FileUploader({
        element: $('#file-uploader')[0],
        action: 'http://www.upload-image.de/upload.php',
        //action: 'http://localhost/upload/2/upload.php',
        params: {},
        allowedExtensions: ['jpg', 'jpeg', 'png', 'gif'],
        sizeLimit: 10 * 1024 * 1024,//0 - no limit
        //onSubmit: function(id, fileName){alert(id+" "+fileName);},
        onComplete: function(id, fileName, responseJSON){

            $(".qq-upload-success:last").append("<span><a href=\"http://s1.upload-image.de/"+responseJSON.filename+"\">Show</a> <pre>http://s1.upload-image.de/"+responseJSON.filename+"</pre></span>");

            //alert(id+" "+fileName+" "+responseJSON.filename);
        },
        messages: {
            typeError: "{file} has invalid extension. Only {extensions} are allowed.",
            sizeError: "{file} is too large, maximum file size is {sizeLimit}.",
            minSizeError: "{file} is too small, minimum file size is {minSizeLimit}.",
            emptyError: "{file} is empty, please select files again without it.",
            onLeave: "The files are being uploaded, if you leave now the upload will be cancelled."
        },
        showMessage: function(message){
            alert(message);
        }
    });

    $(".qq-upload-drop-area").css({"top":((window.innerHeight*0.1)/2)+"px","left":((window.innerWidth * 0.1) / 2)+"px"});

});
