// JavaScript Document


  function openWindow1(location,ht,wid) 
  { 

  Effect.Appear('fadescreen',{to:.5});
  var top_pos = f_scrollTop() + 120;
  var left_pos = f_clientWidth()/2 - 310;
  if(document.getElementById('popupwin')!=null)
  {
	 panel.destroy();
 	 /*x.parentNode.removeChild(x);*/
  }
 
  var url = location;
    panel = new UI.Window({show:Element.appear,hide:Element.fade,theme: "black_hud",id:'popupwin', shadow: false,height:ht,width:wid,minimize:false,maximize:false, top:top_pos,left:left_pos}).show()
	panel.setAjaxContent(url,{
    method: "GET"});
	panel.setZIndex(10000);
	panel.focus();
	panel.observe("destroyed",function(){Effect.Fade('fadescreen');});

  }    
  
  
  
  
  /*  if (document.getElementById('anonymous_element_1') !=null)
  {
	
	panel.hide;
	
  }*/
  
  /*
  instructions for implementing:
  
  use <a href="#"onclick="openWindow1('../../showcase2007/writing.htm',700,650); return false;"
  
  */
  
  /*the following code section collects the user's browser position.  (via softcomplex.com)*/
function f_clientWidth() {
	return f_filterResults (
		window.innerWidth ? window.innerWidth : 0,
		document.documentElement ? document.documentElement.clientWidth : 0,
		document.body ? document.body.clientWidth : 0
	);
}
function f_clientHeight() {
	return f_filterResults (
		window.innerHeight ? window.innerHeight : 0,
		document.documentElement ? document.documentElement.clientHeight : 0,
		document.body ? document.body.clientHeight : 0
	);
}
function f_scrollLeft() {
	return f_filterResults (
		window.pageXOffset ? window.pageXOffset : 0,
		document.documentElement ? document.documentElement.scrollLeft : 0,
		document.body ? document.body.scrollLeft : 0
	);
}
function f_scrollTop() {
	return f_filterResults (
		window.pageYOffset ? window.pageYOffset : 0,
		document.documentElement ? document.documentElement.scrollTop : 0,
		document.body ? document.body.scrollTop : 0
	);
}
function f_filterResults(n_win, n_docel, n_body) {
	var n_result = n_win ? n_win : 0;
	if (n_docel && (!n_result || (n_result > n_docel)))
		n_result = n_docel;
	return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
}
