function window_opener(w,h,page,pagename){
	if (typeof(pagename) == 'undefined')
	 pagename='openedpage';
	 
	//ah = available screen height, aw = available screen width
	var ah = screen.availHeight
	var aw = screen.availWidth
	//ph - where the window horizontal top will be positioned to
	//pw - where the window left edge will be positioned to
	var ph = ah/2-(h/2)
	var pw = aw/2-(w/2)
	
	return window.open(page,pagename,'width='+w+',height='+h+',status=no,toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no,left='+pw+',top='+ph);
}

function window_opener_s(w,h,page,pagename){  
	if (typeof(pagename) == 'undefined')
    pagename='openedpage';

	//ah = available screen height, aw = available screen width
	var ah = screen.availHeight
	var aw = screen.availWidth
	//ph - where the window horizontal top will be positioned to
	//pw - where the window left edge will be positioned to
	var ph = ah/2-(h/2)
	var pw = aw/2-(w/2)
	
	return window.open(page,pagename,'width='+w+',height='+h+',status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no,left='+pw+',top='+ph);
}

function window_opener_s_resize(w,h,page,pagename,resize){  
	if (typeof(pagename) == 'undefined')
    pagename='openedpage';
    
  if (typeof(resize) == 'undefined')
    resize = 'no';
   
  if(pagename.indexOf(' ') > -1) {
    pagename='openedpage';
  }
   
	//ah = available screen height, aw = available screen width
	var ah = screen.availHeight
	var aw = screen.availWidth
	//ph - where the window horizontal top will be positioned to
	//pw - where the window left edge will be positioned to
	var ph = ah/2-(h/2)
	var pw = aw/2-(w/2)
	
	return window.open(page,pagename,'width='+w+',height='+h+',status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=' + resize + ',left='+pw+',top='+ph);
}

/* Opens up a window with resizable and status bar properties. */
function window_opener_s_r(w,h,page){

	//ah = available screen height, aw = available screen width
	var ah = screen.availHeight
	var aw = screen.availWidth
	//ph - where the window horizontal top will be positioned to
	//pw - where the window left edge will be positioned to
	var ph = ah/2-(h/2)
	var pw = aw/2-(w/2)
	
	return window.open(page,'openedpage','width='+w+',height='+h+',status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes,left='+pw+',top='+ph);
}
