/* Author: Jong Ho Ju                                     */
/* © 2005 Value Tours Pty Ltd. All rights reserved        */
/* Unauthorized use of this script is strictly prohibitted*/ 
/* 
    __PageBase_Trim is copied from ValidatorTrim function just in case the current page does not 
    use validator API, thus ValidatorTrim is not defined. 
*/
function __PageBase_Trim(s) {
    var m = s.match(/^\s*(\S+(\s+\S+)*)\s*$/);
    return (m == null) ? "" : m[1];
}
  
/*
	0		: by default
	1		: use exact size
	2		: use location
	4		: use ratio size (of parent)
	8		: show wait page
	16		: center window
	
	128		: show menu bar
	256 	: show tool bar
	512 	: show scrollbars
	1024	: show status bar
	2048	: resizable 
	4096	: modal
	8192	: show location
*/
var WS_COMMON = 1|8|16|512|2048;
var WS_DIALOG = 4|8|16|512|2048;
var WS_POPUP  = 1|8|16|2048;

function __PageBase_OpenPopupWindow(url, _l, _t, _w, _h, flag)
{
	var l, t, w, h;
	
	if((flag & 1) > 0)
	{
		w = _w;
		h = _h;
	}
	else if((flag & 4) > 0)
	{
		w = screen.availWidth * _w; 
		h = screen.availHeight * _h;		
	}
	
	if((flag & 2) > 0)
	{
		l = _l;
		t = _t;
	}
	
	else if((flag & 16) > 0)
	{
		l = (screen.availWidth - w) / 2;
		t = (screen.availHeight - h) / 2; 
	}
	
	var options;
	options  = "left=" + l;
	options += ",top=" + t;
	options += ",width=" + w;
	options += ",height=" + h;
	options += ",menubar=" + (((flag & 128) > 0)? "yes": "no");
	options += ",toolbar=" + (((flag & 256) > 0)? "yes": "no");
	options += ",scrollbars=" + (((flag & 512) > 0)? "yes": "no");
	options += ",status=" + (((flag & 1024) > 0)? "yes": "no");
	options += ",resizable=" + (((flag & 2048) > 0)? "yes": "no");
	options += ",modal=" + (((flag & 4096) > 0)? "yes": "no");
	options += ",location=" + (((flag & 8192) > 0)? "yes": "no");
	if((flag & 8) > 0)
	{
		var wnd = window.open(url, "_blank" ,options);
		wnd.document.write("<CENTER><DIV STYLE=\"FONT-FAMILY: Verdana, Arial\">Please wait...</DIV></CENTER>");
		wnd.location = url;	
	}
	else
		var wnd = window.open(url, "_blank", options);	
} 

//function __Page_FadeIn(control)
//{
//    control.style.filter = "blendTrans(duration=0.5)"; 
//    control.filters.blendTrans.apply();
//    control.style.visibility = "visible";
//    control.filters.blendTrans.play();
//} 