/// <summary>
///  Custom Global variables
/// </summary>


var MenuHighlightedKeyword = "Highlighted";
var RightPanelImagePopupTag;
var RightPanelImagePopupDefaultImageURL;
var GlobalBrowserVariablesSet;
var Opera;
var Opera6;
var Opera7;
var InternetExplorer;
var InternetExplorer6;
var NetscapeNavigator4;
var NetscapeNavigator6;
var W3CCompliant;
var DocumentBody;
var PixelSuffix;

/// <summary>
///  These functions set global browser identification variables and include commonly used routines
///  Significant portions of this code are based on Zorn, W. (2005), "wz_tooltip.js v. 3.37", www.walterzorn.com [http://www.walterzorn.com/tooltip/tooltip_e.htm] cited below
///
///  wz_tooltip.js    v. 3.37
///  The latest version is available at http://www.walterzorn.com or http://www.devira.com or http://www.walterzorn.de
///  Copyright (c) 2002-2005 Walter Zorn. All rights reserved.
///  Created 1.12.2002 by Walter Zorn (Web: http://www.walterzorn.com)
///  Last modified: 2.12.2005
///  Cross-browser tooltips working even in Opera 5 and 6, as well as in NN 4, Gecko-Browsers, IE4+, Opera 7 and Konqueror. No onmouseouts required. Appearance of tooltips can be individually configured via commands within the onmouseovers.
///  LICENSE: LGPL
///  This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
///  This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
///  For more details on the GNU Lesser General Public License, see http://www.gnu.org/copyleft/lesser.html
/// </summary>

function SetGlobalBrowserVariables ()
{
	try
	{
		if (typeof(GlobalBrowserVariablesSet) == "undefined")
		{
			GlobalBrowserVariablesSet = true;
			Opera = !!(window.opera && document.getElementById);
			Opera6 = Opera && !document.defaultView;
			Opera7 = Opera && !Opera6;
			InternetExplorer = navigator.userAgent.toLowerCase().indexOf("msie") != -1 && document.all && ((document.compatMode && document.compatMode != "BackCompat")? document.documentElement : document.body? document.body : null) && !Opera;
			InternetExplorer6 = InternetExplorer && parseFloat(navigator.appVersion.substring(navigator.appVersion.indexOf("MSIE")+5)) >= 5.5;
			NetscapeNavigator4 = (document.layers && typeof document.classes != "undefined");
			NetscapeNavigator6 = (!Opera && document.defaultView && typeof document.defaultView.getComputedStyle != "undefined");
			W3CCompliant = !InternetExplorer && !NetscapeNavigator6 && !Opera && document.getElementById;
			DocumentBody = (((document.compatMode) && (document.compatMode != "BackCompat")) ? document.documentElement : ((document.body) ? document.body : null));
			PixelSuffix = (Opera6 || NetscapeNavigator4) ? "" : "px";
		}
	}
	catch (ExceptionObject)
	{
	}
}

function GetElement (Id)
{
	if (NetscapeNavigator4)
	{
		return((document.layers[Id] || null));
	}
	else
	{
		if (InternetExplorer)
		{
			return((document.all[Id] || null));
		}
		else
		{
			return((document.getElementById(Id) || null));
		}
	}
}

function ParseInteger (StringValue)
{
	var IntegerValue;
	IntegerValue = parseInt(StringValue);
	if (isNaN(IntegerValue))
	{
		return(0);
	}
	else
	{
		return(IntegerValue);
	}
}

/// <summary>
///  These functions check for the existence of the Macromedia Flash Player and publish Flash content
///  Significant portions of this code are based on the javascript code generated by Macromedia Flash Player
///  and Stearns, G. (2005), "FlashObject v1.2.3: Flash detection and embed", [http://blog.deconcept.com/flashobject/] cited below
///
///  FlashObject v1.2.3: Flash detection and embed - http://blog.deconcept.com/flashobject/
///  FlashObject is (c) 2005 Geoff Stearns and is released under the MIT License:
///  http://www.opensource.org/licenses/mit-license.php
/// </summary>

function DetectFlashPlayer (RequiredVersionMajor)
{
	try
	{
		var DetectedVersionMajor;
		if ((navigator.mimeTypes) && (navigator.mimeTypes["application\/x-shockwave-flash"]))
		{
			if (navigator.mimeTypes["application\/x-shockwave-flash"].enabledPlugin)
			{
				DetectedVersionMajor = ParseInteger(navigator.plugins["Shockwave Flash"].description.replace(/([a-z]|[A-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split(".")[0]);
			}
		}
		else if (window.ActiveXObject)
		{
			var FlashPlayer = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			DetectedVersionMajor = ParseInteger(FlashPlayer.GetVariable("$version").split(" ")[1].split(",")[0]);
		}
		return((DetectedVersionMajor > RequiredVersionMajor));
	}
	catch (ExceptionObject)
	{
	}
	return(false);
}

function PublishFlashContent (VersionMajor, Id, Width, Height, Movie, ScriptAccess, Quality, BackgroundColor, ShowMenu, WindowMode, Scale, FlashVariables, HTMLAlternativeTagId)
{
	var FlashContentHTML = "";
	try
	{
		SetGlobalBrowserVariables();
		if (DetectFlashPlayer(VersionMajor))
		{
			FlashContentHTML += "\<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http:\/\/fpdownload.macromedia.com\/pub\/shockwave\/cabs\/flash\/swflash.cab#version=" + VersionMajor + ",0,0,0\" id=\"" + Id + "\" width=\"" + Width + "\" height=\"" + Height + "\"\>\n";
			FlashContentHTML += " \<param name=\"movie\" value=\"" + Movie + "\" \/\>\n";
			FlashContentHTML += " \<param name=\"allowScriptAccess\" value=\"" + ScriptAccess + "\" \/\>\n";
			FlashContentHTML += " \<param name=\"quality\" value=\"" + Quality + "\" \/\>\n";
			FlashContentHTML += " \<param name=\"bgcolor\" value=\"" + BackgroundColor + "\" \/\>\n";
			FlashContentHTML += " \<param name=\"menu\" value=\"" + ShowMenu + "\" \/\>\n";
			FlashContentHTML += " \<param name=\"wmode\" value=\"" + WindowMode + "\" \/\>\n";
			FlashContentHTML += " \<param name=\"scale\" value=\"" + Scale + "\" \/\>\n";
			FlashContentHTML += " \<param name=\"flashvars\" value=\"" + FlashVariables + "\" \/\>\n";
			FlashContentHTML += " \<embed type=\"application\/x-shockwave-flash\" pluginspage=\"http:\/\/www.macromedia.com\/go\/getflashplayer\" id=\"" + Id + "\" name=\"" + Id + "\" width=\"" + Width + "\" height=\"" + Height + "\" src=\"" + Movie + "\" allowScriptAccess=\"" + ScriptAccess + "\" swLiveConnect=\"true\" quality=\"" + Quality + "\" bgcolor=\"" + BackgroundColor + "\" menu=\"" + ShowMenu + "\" wmode=\"" + WindowMode + "\" scale=\"" + Scale + "\" flashvars=\"" + FlashVariables + "\" \/\>\n";
			FlashContentHTML += "\<\/object\>\n";
			if (typeof(HTMLAlternativeTagId) != "undefined")
			{
				if ((HTMLAlternativeTagId != null) && (HTMLAlternativeTagId != ""))
				{
					var HTMLAlternativeTag = GetElement(HTMLAlternativeTagId);
					if (HTMLAlternativeTag != null)
					{
						HTMLAlternativeTag.innerHTML = FlashContentHTML;
					}
					else
					{
						document.write(FlashContentHTML);
					}
				}
				else
				{
					document.write(FlashContentHTML);
				}
			}
			else
			{
				document.write(FlashContentHTML);
			}
		}
	}
	catch (ExceptionObject)
	{
	}
}

/// <summary>
///   Function for hide and show flash popups
/// </summary>


function ShowPersonalInternetBankingFlash()
{
	try
	{
		var popad = null;
		if(document.getElementById("PopAd")) popad=document.getElementById("PopAd");
		var Flag=false;
		var clockID = null;
		popad.style.top = "84px";
	}
	catch (ExceptionObject)
	{
	}
}
function HidePersonalInternetBankingFlash()
{                  
	try
	{
		var popad = null;
		if(document.getElementById("PopAd")) popad=document.getElementById("PopAd");
		var Flag=false;
		var clockID = null;
		popad.style.top = "38px";
	}
	catch (ExceptionObject)
	{
	}
}