var num_offerte=3;
var pos =0;
var imm_sx=1;
var imm_ce = 2;
var imm_dx=3;
var num_offerte=3;
var zoom=0;
var num_sco = 2;
sco_left=  parseInt(document.getElementById("con_sco").style.left)+30;
sco_top=parseInt(document.getElementById("con_sco").style.top)+30;
var attiva_su = 0;
var attiva_giu = 0;
var altezza_tot= parseInt(document.getElementById("cont_scri_sco").style.height);
var altezza_con= parseInt(document.getElementById("cont_cont_scri").style.height);
var punto_fin = -890;
var pos_vert= parseInt(document.getElementById("cont_scri_sco").style.top);
function su_on(){
if (pos_vert > punto_fin) {attiva_su=1
sposta_scri_su();
}
};
function sposta_scri_su(){
if (attiva_su==1) {pos_vert=pos_vert - 5;
document.getElementById("cont_scri_sco").style.top = pos_vert + "px";
if (pos_vert > punto_fin) {setTimeout("sposta_scri_su()",50)};
}
}
function su_off(){
attiva_su=0;
};
function giu_on(){
if (pos_vert < 0 ) {attiva_giu=1
sposta_scri_giu();
}
};
function sposta_scri_giu(){
if (attiva_giu==1) {
pos_vert=pos_vert + 5;
document.getElementById("cont_scri_sco").style.top = pos_vert + "px";
if (pos_vert < 0) {setTimeout("sposta_scri_giu()",50)};
}
}
function giu_off(){
attiva_giu=0;
};
function sposta_dx()
{num_sco = num_sco+1;
if (num_sco==num_offerte+1) {num_sco=1 };
document.getElementById("imm_sco").style.width = 0;
document.getElementById("imm_sco").style.height = 0;
document.getElementById("imm_sco").src='http://www.camasistemi.it/assets/images/offerte/sconto' + num_sco+ '.png'
for (e=0; e< 300; e=e+10) {
var delay = (e);
setTimeout("vis_spo_dx()", delay);
}
}		  
function vis_spo_dx()
{pos=pos-10
document.getElementById("off_dx").style.left = pos+300+"px";
document.getElementById("off_ce").style.left = pos+"px";
zoom=zoom+2;
sco_left=sco_left-1;
sco_top=sco_top-1;
document.getElementById("con_sco").style.left = sco_left+"px";
document.getElementById("con_sco").style.top = sco_top+"px";
document.getElementById("imm_sco").style.width = zoom+"px";
document.getElementById("imm_sco").style.height = zoom+"px";
if (pos==-300) {pos=0;
zoom=0;
sco_left=  parseInt(document.getElementById("con_sco").style.left)+30;
sco_top=parseInt(document.getElementById("con_sco").style.top)+30;
imm_sx=imm_ce;
imm_ce=imm_dx;
imm_dx= imm_dx + 1;
if (imm_dx==num_offerte+1) {imm_dx=1 };
document.getElementById("off_dx").style.left = 300+"px";
document.getElementById("off_ce").style.left = 0+"px";
document.getElementById("pic_sx").src='http://www.camasistemi.it/assets/images/offerte/offerta' + imm_sx + '.gif'
document.getElementById('pic_ce').src= 'http://www.camasistemi.it/assets/images/offerte/offerta' + imm_ce + '.gif'
document.getElementById("pic_dx").src='http://www.camasistemi.it/assets/images/offerte/offerta' + imm_dx + '.gif'
setTimeout("sposta_dx()",5000);
}
}
window.onLoad=setTimeout("sposta_dx()",14000);
