
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//
// orange citron tv
//
// octv.js
//
// Author                       Version     Date        Comments
//
// DIGITIC                      1.0         20/05/2007
// http://www.digitic.fr
// info@digitic.fr
//
// SLOWSIMMER
// http://www.slowsimmer.com
// contact@slowsimmer.com
//
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

var margin, timeout;
var initScroll = 0;

function scrollTopp(myDiv,longScroll,offset) {
  scrolling = initScroll;
  if(scrolling > 0) {
    //document.getElementById(myDiv).style.marginTop = "-"+(scrolling--)+"px";
    document.getElementById(myDiv).style.marginTop = "-"+(scrolling-=5)+"px";
    initScroll = scrolling;
  }
  else {
    return;
  }
  if(longScroll == true) {
    timeout = setTimeout("scrollTopp('"+myDiv+"',true,"+offset+")", 5);
  }
}

function scrollBottom(myDiv,longScroll,offset) {
  scrolling = initScroll;

  if(scrolling < (document.getElementById(myDiv).offsetHeight-offset)) {
    //document.getElementById(myDiv).style.marginTop = "-"+(scrolling++)+"px";
    document.getElementById(myDiv).style.marginTop = "-"+(scrolling+=5)+"px";
    initScroll = scrolling;
  }
  else {
    return;
  }
  if(longScroll == true) {
    timeout = setTimeout("scrollBottom('"+myDiv+"',true,"+offset+")", 5);
  }
}

var selCandidate = 0;

function setOverCandidate(idCandidate,imgOn) {
  if (document.getElementById('imgc'+idCandidate)) {
    document.getElementById('imgc'+idCandidate).src = imgOn;
    document.getElementById('imgc'+idCandidate).style.cursor = "pointer";
  }
}

function setOutCandidate(idCandidate,imgOff) {
  if (selCandidate != idCandidate) {
    if (document.getElementById('imgc'+idCandidate)) {
      document.getElementById('imgc'+idCandidate).src = imgOff;
      document.getElementById('imgc'+idCandidate).style.cursor = "default";
    }
  }
}

function selectCandidate(idCandidate,imgOn) {
  var arrImgOff = Array();
  for (i=2; i<=arguments.length-2; i+=2){
    if (document.getElementById('imgc'+arguments[i])) {
      document.getElementById('imgc'+arguments[i]).src = arguments[i+1];
    }
  }
  selCandidate = 0;
  if (document.getElementById('imgc'+idCandidate)) {
    document.getElementById('imgc'+idCandidate).src = imgOn;
    selCandidate = idCandidate;
    voteForm.V_ID_PRICE_CANDIDATE.value = idCandidate;
    if (document.getElementById('V_ID_PRICE_CANDIDATE')) {
      document.getElementById('V_ID_PRICE_CANDIDATE').value = selCandidate;
    }
  }
}




