Change the sequence of background images
<p>I have this JavaScript function to display a sequence of background images.
What I want is to change to sequence for every page with php. In this case I want to substitute the x in bg_x_ps.jpg with a number in the range of 1 to 8.
Each background must have an unique number.  </p>

<pre><code>$.vegas( 'slideshow', {
    delay: 34000,
    backgrounds: [
        { src: "http://sionvalais.com/images/bg_2_ps.jpg", fade: 4000 },
        { src: 'http://sionvalais.com/images/bg_4_ps.jpg', fade: 4000 },
        { src: 'http://sionvalais.com/images/bg_5_ps.jpg', fade: 4000 },
        { src: 'http://sionvalais.com/images/bg_7_ps.jpg', fade: 4000 }
    ]
} )( 'overlay' );
</code></pre>
