
  function openGB(v_url) {
    // get the containing div
    var v_divElem = document.getElementById("gbDiv");
    if(!v_divElem) {
      alert("Guestbook unavailable. Please check back later.");
      return;
    }

    // already open?
    if (v_divElem.style.display == "block") {
		return;
	}

    // create the iframe
    var v_frameElem = document.createElement("iframe");

    // set the iframe properties
    v_frameElem.frameBorder="0";
    v_frameElem.scrolling="no";
    v_frameElem.height="390px";
    v_frameElem.width="610px";
    v_frameElem.id = "gbFrame";
    v_frameElem.src = v_url;

    v_divElem.appendChild(v_frameElem);

	// let the div take up space, but still be invisible
    v_divElem.style.visibility = "hidden";
    v_divElem.style.display = "block";


    // position to center of browser viewport

    //get viewport's width and height
	var v_vpWidth=0;
	var v_vpHeight=0;
    if( typeof( window.innerWidth ) == 'number' ) {
	    //Non-IE
	    v_vpWidth = window.innerWidth;
	    v_vpHeight = window.innerHeight;
	  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
	    //IE 6+ in 'standards compliant mode'
	    v_vpWidth = document.documentElement.clientWidth;
	    v_vpHeight = document.documentElement.clientHeight;
	  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
	    //IE 4 compatible
	    v_vpWidth = document.body.clientWidth;
	    v_vpHeight = document.body.clientHeight;
	  }

	// take any scrolling into account
	var v_scrollHeight = 0;
	var v_scrollWidth = 0;
	try {
		if (self.pageYOffset) {
			v_scrollHeight = self.pageYOffset;
			v_scrollWidth = self.pageXOffset;
		} else if (document.documentElement.scrollTop) {
			v_scrollHeight = document.documentElement.scrollTop;
			v_scrollWidth = document.documentElement.scrollLeft;
		}
	} catch (e) {
	}

	//get dialog's width and height
	var v_dialogWidth=v_divElem.offsetWidth;
	var v_dialogHeight=v_divElem.offsetHeight;

	//calculate position
	var v_dialogTop = (v_vpHeight/2) - (v_dialogHeight/2) + v_scrollHeight;
	var v_dialogLeft = (v_vpWidth/2) - (v_dialogWidth/2) + v_scrollWidth;


	//Position the Dialog
	v_divElem.style.top =v_dialogTop+"px";
	v_divElem.style.left =v_dialogLeft+"px";

    // now make div visible
//    v_divElem.style.display = "block";
    v_divElem.style.visibility = "visible";
  }

  function closeGB() {
    // get the containing div and the iframe
    var v_divElem = document.getElementById("gbDiv");
    var v_frameElem = document.getElementById("gbFrame");
    if(!v_divElem || !v_frameElem) {
       return;
    }
    // now make div invisible
    v_divElem.style.display = "none";
    v_divElem.removeChild(v_frameElem);
    delete v_frameElem;	
  }

