function makeenquiry(tab){
    
    if(document.getElementById("state" + tab).value == "open"){
        Effect.BlindDown("list" + tab, { duration: 0.5 });
        document.getElementById("state" + tab).value = "close";
    }else if(document.getElementById("state" + tab).value == "close"){
        Effect.BlindUp("list" + tab, { duration: 0.5 });
        document.getElementById("state" + tab).value = "open";
    }
    
}

function viewcats(tab){
    
    if(document.getElementById("state" + tab).value == "open"){
        Effect.BlindDown("block" + tab, { duration: 0.5 });
        document.getElementById("state" + tab).value = "close";
        document.getElementById("blockarrow" + tab).innerHTML = "<img src='./images/uparrow.jpg' border='0'>";
    }else if(document.getElementById("state" + tab).value == "close"){
        Effect.BlindUp("block" + tab, { duration: 0.5 });
        document.getElementById("state" + tab).value = "open";
        document.getElementById("blockarrow" + tab).innerHTML = "<img src='./images/droparrow.jpg' border='0'>";
    }
    
}

start_slideshow(1, 5, 3000);
    
function start_slideshow(start_frame, end_frame, delay) {
    id = setTimeout(switch_slides(start_frame,start_frame,end_frame, delay), delay);
}

function switch_slides(frame, start_frame, end_frame, delay) {
    return (function() {
        Effect.Fade('slideshow' + frame, { duration: 1.0 });
        if (frame == end_frame) { frame = start_frame; } else { frame = frame + 1; }
        Effect.Appear('slideshow' + frame, { duration: 1.0 });
        if (delay == 1000) { delay = 3000; }
        id = setTimeout(switch_slides(frame, start_frame, end_frame, delay), delay);
    })
}

function waitfirst(){
     t=setTimeout("timedCount()",6000);
}

var c=0;
var t;
var timer_is_on=0;
var timerwork = 0;

function timedCount(){
    if(timerwork != 1){
        if(c == 2){
            new Effect.Parallel([
            new Effect.Move('specials-inner', { sync: true, x: -442, y: 0, mode: 'relative' }), 
            new Effect.Opacity('specials-inner', { sync: true, from: 1, to: 1 }) 
            ], { 
              duration: 1,
              delay: 0.5
            });
            c=0;
            t=setTimeout("timedCount()",6000);
        }else{
            new Effect.Parallel([
            new Effect.Move('specials-inner', { sync: true, x: 221, y: 0, mode: 'relative' }), 
            new Effect.Opacity('specials-inner', { sync: true, from: 1, to: 1 })
            ], { 
              duration: 0.8,
              delay: 0.5
            });
            c=c+1;
            t=setTimeout("timedCount()",6000);
        }
    }
}

function doTimer(){
    if (!timer_is_on){
        timer_is_on=1;
        timedCount();
    }
}

position = 0;
function moveleft(width){
    
    if(position != width){
        timerwork = 1;
        new Effect.Parallel([
        new Effect.Move('clients-inner', { sync: true, x: 311, y: 0, mode: 'relative' })
        ], { 
          duration: 0.5,
          delay: 0
        });
        position = position + 311;
        
    }        
}

function moveright(width){
    
    if(position !=0){
        timerwork = 1;
        new Effect.Parallel([
        new Effect.Move('clients-inner', { sync: true, x: -311, y: 0, mode: 'relative' })
        ], { 
          duration: 0.5,
          delay: 0
        }); 
        position = position - 311;
        
    }

}
