/*
  $Id: contentFcs.js,v 1.4 2006/03/02 10:01:00 Tomas Exp $
  
  ************************************************************
  *** common javascript functions for content templates    ***
  ************************************************************
*/


    var vWidthMax;
    var notResizedImgs = new Array();
    function checkImgSize(docImg, contentType) {
      if(!contentType) return;
      if(contentType=="V2Standard") vWidthMax=258;
      else if (contentType=="V2StandardMax") vWidthMax=716;
      else if (contentType=="Activity") vWidthMax=200;
      else if (contentType=="News") vWidthMax=200;
      else if (contentType=="NewsMax") vWidthMax=507;
      else if (contentType=="NewProd") vWidthMax=507;
      else if (contentType=="PressRoom") vWidthMax=200;
      else if (contentType=="RegFormOnLine") vWidthMax=254;
      else if (contentType=="WelcomeToOr2") vWidthMax=335;

      var vImgIndex=notResizedImgs.length;
      notResizedImgs[vImgIndex] = new Image();
      notResizedImgs[vImgIndex].onload=setImgSize;
      notResizedImgs[vImgIndex].partnerDocImg=docImg;
      notResizedImgs[vImgIndex].src=docImg.src; // load the original image
    }

  function setImgSize() {
    if (this.width!=0 && this.width > vWidthMax) {
      this.partnerDocImg.width = vWidthMax;
      this.partnerDocImg.height = Math.round( this.height * (vWidthMax / this.width) );
    }
  }


