function pressCoverageChange() {
  el_id = pressCoverageActive;
  isactive = found = false;
  pressCoverage.each ( function (index) {
    if (isactive) {
      pressCoverageActive = index;
      isactive = false;
    } 
    if (index == el_id) { isactive = found = true; }
  });
  if (isactive && found) pressCoverage.each ( function (index) {
    if (isactive) {
      pressCoverageActive = index;
      isactive = false;
    } 
    if (index == el_id) { isactive = found = true; }
  });
  $(el_id).hide();
  new Effect.Appear(pressCoverageActive);
  setTimeout('pressCoverageChange()',5000);
}

function popup ( url ) {
    window.open(url,'Product','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=760,height=500,top=30,left=20');
}
function closewindow() {
    window.close();
}
var arrTemp=self.location.href.split("?");
var picUrl = (arrTemp.length>0)?arrTemp[1]:"";
var NS = (navigator.appName=="Netscape")?true:false;
var NS = ((!document.all)||window.opera)?true:false;
function AutoSize() {
	var iWidth = (NS)?window.innerWidth:document.documentElement.clientWidth;
	var iHeight = (NS)?window.innerHeight:document.documentElement.clientHeight;
	iWidth = document.images[0].width - iWidth + 30;
	//iHeight = document.images[0].height - iHeight;
	iHeight = 700-iHeight;
	window.resizeBy(iWidth, iHeight);
	self.focus();
	window.focus();
};


function javascript_on() {
    $('nojavascript').hide();
}

/********** offers slideshow sidebar *********/ 
function offers_slideshow(n,m) {
  if (!$('offer_first_'+n) ) alert('n=' + n + ', m='+ m + ' ' + $('offer_first_'+n)); 
  //alert(n);
  if ($('offer_first_'+n).iamactive) {
    newoffer = 'offer_second_'+n;
    oldoffer = 'offer_first_'+n;
    
  } else {
    newoffer = 'offer_first_'+n;
    oldoffer = 'offer_second_'+n;
  }
  newoffer_el = $(newoffer);
  oldoffer_el = $(oldoffer);

  newoffer_el.style.zIndex = 101;
  oldoffer_el.style.zIndex = 100;
  
  newoffer_el.iamactive = true;
  oldoffer_el.iamactive = false;
  
  //for (i = 0; i < offers_number; i++) if (newoffer_el.hasClassName('logo_'+i)) newlogo_el.removeClassName('logo_'+i);
  //newlogo_el.addClassName('logo_'+m);
  
  if (!offers['offer_'+m]) a=0;
  else newoffer_el.innerHTML = offers['offer_'+m];
  
  //alert(offers['offer_'+m]);
  
  newoffer_el.hide();
  new Effect.Appear(newoffer);
  new Effect.Fade(oldoffer);
  
  timeouts[n] = [];
  m = 1 + Math.floor( Math.random() * (offers_number));
  while (timeouts[1]['v'] == m || timeouts[2]['v'] == m || timeouts[3]['v'] == m || timeouts[4]['v'] == m || timeouts[5]['v'] == m) m = 1 + Math.floor( Math.random() * (offers_number));
  //alert(n+','+m+','+logos_number);
  timeouts[n]['v'] = m;
  
  if (n == 1) {
    timeouts[n]['t'] = setTimeout("offers_slideshow(1,timeouts[1]['v'])",period+Math.floor( Math.random() * period / 2));
  } else if (n == 2) {
    timeouts[n]['t'] = setTimeout("offers_slideshow(2,timeouts[2]['v'])",period+Math.floor( Math.random() * period / 2));
  } else if (n == 3) {
    timeouts[n]['t'] = setTimeout("offers_slideshow(3,timeouts[3]['v'])",period+Math.floor( Math.random() * period / 2));
  } else if (n == 4) {
    timeouts[n]['t'] = setTimeout("offers_slideshow(4,timeouts[4]['v'])",period+Math.floor( Math.random() * period / 2));
  } else if (n == 5) {
    timeouts[n]['t'] = setTimeout("offers_slideshow(5,timeouts[5]['v'])",period+Math.floor( Math.random() * period / 2));
  }
      
}