setInterval("iframe_resize()", 1000);
var scroll_timeout = 0;

function iframe_resize () {

  var offset_x = 0;
  var offset_y = 0;

  // if iframe is not available, exit
  if( ! parent.document.getElementById("i1_id") ) {
    return false;
  }

  // set new width/height per cookie
  iframe_obj = parent.document.getElementById("i1_id");

  var new_width = 0;
  var new_height = 0;

  var current_width = iframe_obj.width;
  var current_height = iframe_obj.height;

  cookie_width = getCookie("iframe_width");

  if( ! cookie_width )
    return false;

  cookie_height = getCookie("iframe_height");

  if( ! cookie_height )
    return false;

  new_width = parseInt( cookie_width ) + 0;
  new_height = parseInt( cookie_height ) + 32;

  // check scroll settings
  scroll_top = getCookie("scroll_top");

  if( ! scroll_top )
    return false;

  // if scroll_top cookie is set to true
  if( scroll_top == "TRUE" ) {

    setCookie("scroll_top", "FALSE", 8*1000);

    parent.window.scrollTo(offset_x, offset_y);
  }

   // apply new width and height
  if( current_width != new_width )
    iframe_obj.width = new_width;

  if( current_height != new_height )
    iframe_obj.height = new_height;

  return true;
}