var t;
var anim=0;
var start=0;
var lastel='';
function disp_not_dsp(elemid,topelement,num) {	
    if (num==1) {
        document.getElementById(elemid).className = 'dsplblock';
		document.getElementById(topelement).className = 'specialoffert curentpagesp';
     }else{
        document.getElementById(elemid).className = 'dsplnone';
		document.getElementById(topelement).className = 'specialoffert';
    }
}
//IMAGE POPUP
function pop_up(pURL, pWidth, pHeight) {
  if (!pURL) {
    return;
  }
  var offsetWidth = 50;
  var offsetHeight = 70;
  var windowFeatures = "toolbar=no,directories=no,location=no,status=no,menubar=no,resizable=yes,scrollbars=yes,"
    + "width=" + (pWidth + offsetWidth) + ",height=" + (pHeight + offsetHeight);
  var popup = window.open(pURL, 'imagePopup', windowFeatures);
  if (popup) {
    popup.focus();
	popup.moveTo(0,0);
  }
}
function startRotate(el,start){
    var count=el.children('a.imglink').children('img').length;
    rotate(el,start,count);
}
function rotate(el,start,count){
    stopRotate(lastel);
    el.children('a.imglink').children('img').eq(start).fadeOut('fast',function(){
         $(this).removeClass('visible');
    });
    if(start==(count-1)){start=-1;}
    start++;
    el.children('a.imglink').children('img').eq(start).fadeIn('fast',function(){
        $(this).addClass('visible');
    });
    t=setTimeout(function(){rotate(el,start,count)},3000);
    lastel=el;
}
function stopRotate(el){
    if(el!=''){
    clearTimeout(t);
    el.children('a.imglink').children('img').each(function(){
        $(this).removeClass('visible');
        $(this).css('display','none');
    });
    el.children('a.imglink').children('img').eq(0).css('display','block');
    el.children('a.imglink').children('img').eq(0).addClass('visible');
    }
}

//END IMAGE POPUP
