function WebTab(wId, pTabPos, pPercentFromTop, pImgURL, pStart, pType, pTitle, pImgHeight) 
{
	this._defaultheight = "50%";
	this._dialogwidth = 350;
	this._dialogheight  = 250;
	this._imageURL = "";
	this._imageWidth = 35;
	this._imageHeight = 75; 
	this.jre = "";
	this._language = "en";
	this._overTabOffset = "-4px";
	this._pagename = '';
	this._startstat = 'CLOSED';
	this._tabPosition = "right";
	this.tipobj;
	this.title = '';
	this._type = '';
	this._winposx = 0;
	this._winposy = 0;
	this.wID = "";
	

	if (typeof(wId) != "undefined")
		this.wID = wId;

	if (typeof(pTabPos) != "undefined")
		this._tabPosition = pTabPos.toLowerCase();

	if (typeof(pPercentFromTop) != "undefined") 
		this._defaultheight = pPercentFromTop;

	if (typeof(pImgURL) != "undefined") 
		this._imageURL = pImgURL;
		
	if (typeof(pStart) != "undefined") 
		this._startstate = pStart;
		
	if (typeof(pType) != "undefined") 
		this._type = pType;
	
	if (typeof(pTitle) != "undefined") 
		this._title = pTitle;

	if (typeof(pImgHeight) != "undefined") 
		this._imageHeight = pImgHeight;

     this.showDialog = function() 
	{
		if (this.tipobj.dialog("isOpen"))
			this.tipobj.dialog("close");
		else
			this.tipobj.dialog("open");

   	};
	   
        
	this.getWindowWidth = function () 
	{

		var w = 0;
		if (window.innerWidth) 
			w = window.innerWidth;
		else 
		{
			if (self.innerWidth) 
				w = self.innerWidth;
			else 
			{
				if (document.documentElement && document.documentElement.clientWidth)
					w = document.documentElement.clientWidth;
				else 
				{
					if (document.body)
					  w = document.body.clientWidth;
				}
			}
		}
		return w
	};
	
	
	this.getWindowHeight = function () 
	{
		var h = 0;
		if (window.innerHeight) 
			h = window.innerHeight;
		else 
		{
			if (self.innerHeight)
			h = self.innerHeight;
			else 
			{
				if (document.documentElement && document.documentElement.clientHeight)
					h = document.documentElement.clientHeight;
				else 
				{
					if (document.body)
						h = document.body.clientHeight;
				}
			}
		}
		return h
	};

	this.getOSBarHeight = function () 
	{
		try 
		{
			if (navigator.appVersion.indexOf("Win") != -1)
				return 28;
	
			if (navigator.appVersion.indexOf("Mac") != -1) 
				return 75;
		} 
		catch (e) {};
		return 0;
	};

	this.isIE6 = function () 
	{
		try 
		{
			return navigator.userAgent.toLowerCase().indexOf("msie 6") != -1;
		} 
		catch (e) 
		{
			return false;
		}
	};
	
	this.isIE = function () 
	{
		try 
		{
			return navigator.appName("Microsoft Internet Explorer") != -1;
		} 
		catch (e) 
		{
			return false;
		}
	};

	this.displayTab = function () 
	{
		var _winposy = this._defaultheight;
		var _winposx;
		if (_winposy.substr(_winposy.length - 1, 1) == "%") 
			_winposx = Math.round(_winposy.substr(0, _winposy.length - 1) * this.getWindowHeight() / 100);
		else
			_winposx = _winposy.substr(0, _winposy.length - 2);

		switch (this._tabPosition) 
		{
			case "left":
				document.write('<style type="text/css">body .WebTabsButton_' + this.wID + '{cursor:pointer;cursor:hand;overflow:hidden;position:fixed;_position:absolute;display:block;top:' + _winposy + ";_top:expression(eval(document.body.scrollTop)+" + _winposx + ");left:0px;z-index:2147000000;margin:0;padding:0;border-collapse:collapse;border-spacing:0;border:none;outline:none;font-size:0px;line-height:0px;}</style>");
				break;
			case "right":
				document.write('<style type="text/css">body .WebTabsButton_' + this.wID + '{cursor:pointer;cursor:hand;overflow:hidden;position:fixed;_position:absolute;display:block;top:' + _winposy + ";_top:expression(eval(document.body.scrollTop)+" + _winposx + ");right:0px;z-index:2147000000;margin:0;padding:0;border-collapse:collapse;border-spacing:0;border:none;outline:none;font-size:0px;line-height:0px;}</style>");
				break;
			case "top":
				document.write('<style type="text/css">body .WebTabsButton_' + this.wID + '{cursor:pointer;cursor:hand;overflow:hidden;position:fixed;_position:absolute;display:block;top:0px;left:' + _winposy + ";_left:expression(eval(document.body.scrollLeft)+" + _winposx + ");z-index:2147000000;margin:0;padding:0;border-collapse:collapse;border-spacing:0;border:none;outline:none;font-size:0px;line-height:0px;}</style>");
				break;
			case "bottom":
				document.write('<style type="text/css">body .WebTabsButton_' + this.wID + '{cursor:pointer;cursor:hand;overflow:hidden;position:fixed;_position:absolute;display:block;bottom:0px;left:' + _winposy + ";_left:expression(eval(document.body.scrollLeft)+" + _winposx + ");z-index:2147000000;margin:0;padding:0;border-collapse:collapse;border-spacing:0;border:none;outline:none;font-size:0px;line-height:0px;}</style>");
				break;
		}
		document.write('<style type="text/css">@media print{body .' + this.wID + '{display:none;}}</style>');
		document.write('<div id="webtabsbutton_' + this.wID + '" class="WebTabsButton_' + this.wID + '" onClick="' + this.wID + '.showDialog();"><img id="webtabs_image_' + this.wID + '" style="position:relative;" src="' + this._imageURL + '" alt="" border="0" width="' + this._imageWidth + '" height="' + this._imageHeight + '" onmouseover="' + this.wID + '.overTab();" onmouseout="' + this.wID + '.outTab();" /></div>');
		this.outTab();
	};

	this.overTab = function () 
	{
		var _localTab = document.getElementById("webtabs_image_" + this.wID).style;
		switch (this._tabPosition) 
		{
			case "left":
				_localTab.left = "0px";
				break;
			case "right":
				_localTab.right = "0px";
				break;
			case "top":
				_localTab.top = "0px";
				break;
			case "bottom":
				_localTab.bottom = "0px";
				break;
		}
	};
	
	this.outTab = function () 
	{

		try 
		{
			var _localTab = document.getElementById("webtabs_image_" + this.wID).style;
			switch (this._tabPosition) 
			{
				case "left":
					_localTab.left = this._overTabOffset;
					break;
				case "right":
					_localTab.right = this._overTabOffset;
					break;
				case "top":
					_localTab.top = this._overTabOffset;
					break;
				case "bottom":
					_localTab.bottom = this._overTabOffset;
					break;
			}
		} 
		catch (e) {}
	};
	
	
	this.hideTab = function () 
	{

		var btn = document.getElementById("webtabs_image_" + this.wID);
		if (btn) 
			btn.style.display = "none";
	};
	
	
	this.showTab = function () 
	{

		var btn = document.getElementById("webtabs_image_" + this.wID);
		if (btn)
			btn.style.display = "inline";
	};

	if (this._type == 'Video')
	{
		this._dialogwidth = 500;
		this._dialogheight  = 400;
		_winposx = this.getWindowWidth()/2 - this._dialogwidth/2;
		_winposy = this.getWindowHeight()/2 - this._dialogheight/2;
	}                                                                                                                	
	else
	{
		if (this._tabPosition == 'right')
			_winposx = this.getWindowWidth() - (this._dialogwidth + this._imageWidth + 5);
		else
			_winposx = 0;
		
		_winposy = this.getWindowHeight()/2 - this._dialogheight - 60;
	}

	var dialogname = "#" + this.wID;
	this.tipobj = $(dialogname);
	this.tipobj.dialog(
		{
			autoOpen: false,
			draggable: true,  
			resizable: true, 
			title: this._type,
			closeText: 'close', 
			width: this._dialogwidth,
			minwidth: 200,
			maxwidth: 700, 
			height: this._dialogheight,
			minHeight: 120,
			maxHeight: 800,
			position: [_winposx, _winposy],
			modal: false,
		});

	this.displayTab();

	if (this._startstate == "OPEN")
		this.showDialog();
};

																							   
