function ChildWindow(Fname, Title)
{
// Open generic child window with fname 
// Fname is mandatory, others optional

	Title = ( (""+Title) == "undefined" || Title=="" ) ? "_blank" : Title;

	window.open(Fname, Title, 'resizeable=yes,scrollbars=yes,width=800,height=500,screenX=0,screenY=0,top=0,left=0');
}

//=========================================================

function SiteEmail(EKey)
{
	OpenWindow("Email.php?Action=DispForm&EmailID=" + EKey, 850, 650,'yes', 'yes', 'Email1', 20, 20);
}

//=========================================================

function ShowPhoto(PName, Fname)
{
	OpenWindow("DispPhoto.php?Action=Show&PhotoFile=" + Fname + "&PhotoName=" + PName,  600, 380,'yes', 'yes', 'Photo1', 20, 20);
}

//=========================================================

function OpenWindow()
{

	// order of arguments:
	// PageToLoad,Width,Height,ScollBars,Resizable,WindowName,left,top
	//
	// scrollbars(yes/no),resizable(yes/no)
	// PageToLoad is mandatory, all other optional


	var PageToLoad = arguments[0];
	var Width = arguments[1];
	var Height = arguments[2];
	var ScollBars = arguments[3];
	var Resizable = arguments[4];
	var WindowName = arguments[5];
	var Left = arguments[6];
	var Top = arguments[7];
	var WindowVars = "";


	Width = ( (""+Width) == "undefined" || Width=="" || (""+Width) == "0" ) ? "640" : Width;
	Height = ( (""+Height) == "undefined" || Height=="" || (""+Height) == "0" ) ? "400" : Height;
	ScrollBar = ( (""+ScollBars) == "undefined" || ScollBars=="" ) ? "yes" : ScollBars;
	Resize = ( (""+Resizable) == "undefined" || Resizable=="" ) ? "yes" : Resizable;
	Left = (("" + Left) == "undefined" || Left == "" ) ? "0" : Left; 
	Top = (("" + Top) == "undefined" || Top == "") ? "0" : Top; 
	WindowVars = "width="+Width+",height="+Height+",scrollbars="+ScrollBar+",resizable="+Resize+",screenX=0,screenY=0,top="+Top+",left="+Left+",menubar=no,toolbar=no,location=no,status=no,directories=no,titlebar=no";
	WindowName = ( (""+WindowName) == "undefined" || WindowName=="" ) ? "_blank" : WindowName;
	PopUpWindow = window.open(PageToLoad,WindowName,WindowVars);
}

//=========================================================

function BrowserInfo()
{
	this.ver=navigator.appVersion;
	this.dom=document.getElementById?1:0;
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
	this.ie4=(document.all && !this.dom)?1:0;
	this.ns6=(this.dom && parseInt(this.ver) >= 5)?1:0;
	this.ns4=(document.layers && !this.dom)?1:0;
	this.w3c=(this.ie5 || this.ie6 || this.ns6);
	this.ie=(this.ie4 || this.ie5 || this.ie6);
	this.ns=(this.ns4 || this.ns6);
	this.bw=(this.ie4 || this.ie5 || this.ie6 || this.ns4 || this.ns6);
	return this;
}

var UserBrowser = new BrowserInfo();

