/******************************/
/*  Utazok.hu Advert   */
/*    All rights reserved     */
/*           2009             */
/******************************/

function hungaryroomsAdvert(code, card, num, align, bordercolor)
{

  //code: adsense code (ADS001)
  //card: tiny, big or 1 / 2
  //num: number of items
  //align: vertical, horizontal or 2 / 1
  //bordercolor: border-color

  var iframewidth = 10;
  var iframeheight = 14;
  var basewidth = 0;
  var baseheight = 0;

  switch(card) {
    case 'tiny':
    case 1:
        basewidth = 208;
        baseheight = 49;
      break;
    case 'big':
    case 2:
        basewidth = 101;
        baseheight = 130;
      break;
    default:
      break;
  }

  switch(align) {
    case 'horizontal':
    case 1:
        iframewidth+= basewidth*num;
        iframeheight+= baseheight;
      break;
    case 'vertical':
    case 2:
    default:
        iframeheight+= 10;
        iframewidth+= basewidth;
        iframeheight+= baseheight*num;
      break;
  }

  var iframesrc = 'http://www.utazok.hu/advert/show?code='+code;
  //var iframesrc = 'http://utazok.localhost/index_dev.php/advert/show?code='+code;
  var iframeborder = '0';
  if (bordercolor) {
    iframeborder = '1px solid #'+bordercolor;
  }
  var iframestyle = 'border:'+iframeborder+';';
  iframestyle+= 'width:'+iframewidth+'px;';
  iframestyle+= 'height:'+iframeheight+'px;';

  document.write('<iframe frameborder="0" src="'+iframesrc+'" scrolling="no" style="'+iframestyle+';"></iframe>');
}

