window.addEvent('domready', function(){
    $('page1').setStyle('width', screen.availWidth);
    $('page2').setStyle('width', screen.availWidth);
    $('page3').setStyle('width', screen.availWidth);
    $('page4').setStyle('width', screen.availWidth);
    div = $('slide');
    div.setStyle('width', screen.availWidth*4+200);
    div.setStyle('left',0);
});

function scrSlide(s, t) {
window.location='#top';
var myEffect = new Fx.Morph('slide', {duration: 500, transition: Fx.Transitions.Sine.easeOut});
 
myEffect.start({
    'left': (s-t)*screen.availWidth //Morphs the height from the current to 100px.
    //'width': 300   //Morphs the width from the current to 300px.
});

}

function edit(id) {
    window.open("?ac=edit&id="+id, "editwin", "fullscreen=yes");
}
var temp_p = 0;
function page(p) {
    if(p>3||p<0) p = 0;
    if(temp_p == p) {
        scrSlide(0, 0);
        setTimeout("scrSlide(0, "+p+");", 500);
    } else {
        scrSlide(0, p);
        temp_p = p;
    }
}