setInterval("iframe_resize()", 2500);
var scroll_break = false;
var scroll_timeout = 0;

function iframe_resize () {

  // if iframe is not available

  if( ! parent.document.getElementById("i1_id") ) {
    return false;
  }
  
  iframe_obj = parent.document.getElementById("i1_id");

  var cookie_str = "";
  var_cookie_arr = new Array();
  
  var new_width = 0;
  var new_height = 0;

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

  cookie_str = getCookie("xy");
  
  if( ! cookie_str )
    return false;

  cookie_arr = cookie_str.split(".");

  if( cookie_arr.length != 2 )
    return false;

  new_width = parseInt( cookie_arr[0] ) + 0;
  new_height = parseInt( cookie_arr[1] ) + 32;

  if( current_width != new_width )
    iframe_obj.width = new_width;

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

  if( (current_height != new_height || current_width != new_width) && ( scroll_break == false ) ) {

    scroll_break = true;

    scroll_timeout = window.setTimeout("scroll_break = false", 5000);

    parent.window.scrollTo(0, 0);
  }
  
  return true;
}