function Set_Cookie( name, value, expires, path, domain, secure ) {
    // set time, it's in milliseconds
    var today = new Date();
    today.setTime( today.getTime() );

    if ( expires ) {
        expires = expires * 1000 * 60 * 60 * 24;
    }
    var expires_date = new Date( today.getTime() + (expires) );

    document.cookie = name + "=" +escape( value ) +
        ( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) +
        ( ( path ) ? ";path=" + path : "" ) +
        ( ( domain ) ? ";domain=" + domain : "" ) +
        ( ( secure ) ? ";secure" : "" );
}




jQuery(document).ready(function() { 
    // define your own settings 
    var settings = { 
        cols: 3,
        rows: 3, 
        hole: 3, 
        language: 'en',
        numbers: false,
        shuffle: false, 
        confirmShuffle: true,
        confirmOriginal: false,
        confirmNumbers: true,
        control: { 
            shufflePieces: true,
            toggleNumbers: false, 
            toggleOriginal: false,
            counter: true, 
            timer: true 
        }, 
        animation: { 
            shuffleRounds: 3, 
            slidingSpeed: 400,          
            shuffleSpeed: 500 
        },      
        success: { 
                fadeOriginal: true, 
                callback: function(results) {  
                    //alert('Gelöst in ' + results.moves + ' Zügen und ' + results.seconds/10 + ' Sekunden.');
                    
                    /*
                    var a = new Date();
                    a = new Date(a.getTime() + 1000*60);
                    
                    document.cookie         = 'gamedata='+results.seconds+'#'+results.moves + '; expires='+ a.toGMTString()+';';
                    */
                    
                    Set_Cookie('gamedata', results.seconds+'-'+results.moves, false, '/');
                                             
                    document.location.href  = "http://www.schlauschleifen.de/index.php?id=65";
                                                                                 
                    },
                    
                callbackTimeout: 800 
        }        
                               
    }; 
    
    
     var myTexts = {  
            toggleOriginalLabel: 'Originalbild anzeigen',
            shuffleLabel: '' 
     };    
    
    // call jqPuzzle with mySettings on an image with id 'myImage' 
    jQuery('#puzzle').jqPuzzle(settings, myTexts);         
});