﻿var jbtp = function ()
{
	this.navsel = arguments[0];
	if(arguments.length > 0)
		this.snavsel = arguments[1];
	if(arguments.length > 1)
		this.ssnavsel = arguments[2];
}

jbtp.prototype =
{
	init: function ()
	{
		if(!isNaN(this.navsel))
		{
			this.nava = $(".nav_container > .top_nav > a").eq(this.navsel);
			if(this.nava != null)
			{
				$(this.nava).addClass("active");
			}
		}

		if(!isNaN(this.snavsel))
		{
			this.suba = $(".left_nav > a.pri_nav").eq(this.snavsel);
			if(this.suba != null && this.suba.length > 0)
			{
				$(this.suba).addClass("active_nav");
				$(this.suba).nextUntil("a.pri_nav").addClass("show");
			}
			else
			{
				this.suba = $(".sub_nav_container > .pri_nav > a").eq(this.snavsel);
				if(this.suba != null && this.suba.length > 0)
				{
					$(this.suba).addClass("active");
				}
			}
		}

		if(!isNaN(this.ssnavsel))
		{
			this.ssuba = $(".left_nav > a.sub_nav.show").eq(this.ssnavsel);
			if(this.ssuba != null && this.ssuba.length > 0)
			{
				$(this.ssuba).addClass("active");
			}
			else
			{
				this.ssuba = $(".sub_nav_container > .sub-nav > a.show").eq(this.ssnavsel);
				if(this.ssuba != null && this.ssuba.length > 0)
				{
					$(this.ssuba).addClass("active");
				}
			}
		}
	},

	initstring: function ()
	{
		if(this.snavsel)
		{
			this.suba = $(".left_nav > a.pri_nav[href='" + this.snavsel + "']").eq(0);
			if(this.suba != null && this.suba.length > 0)
			{
				$(this.suba).addClass("active_nav");
				$(this.suba).nextUntil("a.pri_nav").addClass("show");
			}
		}

		if(this.ssnavsel)
		{
			this.ssuba = $(".left_nav > a.sub_nav.show[href='" + this.ssnavsel + "']").eq(0);
			if(this.ssuba != null && this.ssuba.length > 0)
			{
				$(this.ssuba).addClass("active");
			}
		}
	},

	button: function (sel)
	{
		$(sel).mousedown(function (e)
		{
			$(this).css("background-position", "left");
		});
		$(sel).mouseover(function (e)
		{
			$(this).css("background-position", "center");
		});
		$(sel).mouseout(function (e)
		{
			$(this).css("background-position", "right");
		});
	}
}

// Popup Window
var aOpenWindows = new Array();

function OpenWindow(sURL, sWindowName, bToolbar, bScrollBars, lWidth, lHeight, lTop, lLeft)
{
	if(typeof lTop == 'undefined')
	{
		lTop = (screen.height - lHeight) / 2
	}
	if(typeof lLeft == 'undefined')
	{
		lLeft = (screen.width - lWidth) / 2
	}
	if(bToolbar == true)
	{
		bToolbar = 'yes'
		bMenubar = 'yes'
	} else
	{
		bToolbar = 'no'
		bMenubar = 'no'
	}
	if(bScrollBars == true)
	{
		bScrollBars = 'yes'
	} else
	{
		bScrollBars = 'no'
	}
	var lsFeatures = 'toolbar=' + bToolbar + ',scrollbars=' + bScrollBars + ',resizable=yes,status=yes';
	lsFeatures += ',top=' + lTop
	lsFeatures += ',left=' + lLeft
	if(lWidth > 0) { lsFeatures += ',width=' + lWidth };
	if(lHeight > 0) { lsFeatures += ',height=' + lHeight };
	lsFeatures += ',menubar=' + bMenubar;
	popupWin = window.open(sURL, sWindowName, lsFeatures);
	popupWin.focus();
}

var jbtpuser = function ()
{
	this.FirstName = "";
	this.LastName = "";
	this.EmailAddress = "";
	this.UserID = "";
	this.UserName = "";
}

jbtpuser.prototype =
{
	load: function (fname, lname, email, uid, uname)
	{
		this.FirstName = fname;
		this.LastName = lname;
		this.EmailAddress = email;
		this.UserID = uid;
		this.UserName = uname;
	}
}
