/// <summary>
///  Custom Global variables
/// </summary>

var MenuHighlightedKeyword = "Active";
var ShowRequestedImageDelay = 50;

/// <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 chk(id)
{

switch (id)
{
case 1: {document.getElementById('ImageHolder').innerHTML = "<img id='img' src='<%=Request.ApplicationPath%>$Common/Image/Background/1.jpg' />";break;}
case 2: {document.getElementById('ImageHolder').innerHTML = "<img id='img' src='<%=Request.ApplicationPath%>$Common/Image/Background/2.jpg' />";break;}
case 3: {document.getElementById('ImageHolder').innerHTML = "<img id='img' src='<%=Request.ApplicationPath%>$Common/Image/Background/3.jpg' />";break;}
case 4: {document.getElementById('ImageHolder').innerHTML = "<img id='img' src='<%=Request.ApplicationPath%>$Common/Image/Background/4.jpg' />";break;}
case 5: {document.getElementById('ImageHolder').innerHTML = "<img id='img' src='<%=Request.ApplicationPath%>$Common/Image/Background/5.jpg' />";break;}
case 6: {document.getElementById('ImageHolder').innerHTML = "<img id='img' src='<%=Request.ApplicationPath%>$Common/Image/Background/6.jpg' />";break;}
case 7: {document.getElementById('ImageHolder').innerHTML = "<img id='img' src='<%=Request.ApplicationPath%>$Common/Image/Background/7.jpg' />";break;}
default: {document.getElementById('ImageHolder').innerHTML = "<img id='img' src='<%=Request.ApplicationPath%>$Common/Image/Background/menu-bg.jpg' />";}
}

//img.src = "./images/background/" + id + ".jpg"; 
}
	    
function deft()
{
var sPath = window.location.pathname.toUpperCase();

if (sPath.match("ABOUTDUBAI"))
{
//var img1 = 5;
document.getElementById('ImageHolder').innerHTML = "<img id='img' src='<%=Request.ApplicationPath%>$Common/Image/Background/5.jpg' />";
}

if (sPath.match("ABOUTDWTC"))
{
//var img1 = 5;
document.getElementById('ImageHolder').innerHTML = "<img id='img' src='<%=Request.ApplicationPath%>$Common/Image/Background/3.jpg' />";
}

if (sPath.match("EVENTCALENDAR"))
{
//var img1 = 5;
document.getElementById('ImageHolder').innerHTML = "<img id='img' src='<%=Request.ApplicationPath%>$Common/Image/Background/7.jpg' />";
}

if (sPath.match("MEDIACENTER"))
{
//var img1 = 5;
document.getElementById('ImageHolder').innerHTML = "<img id='img' src='<%=Request.ApplicationPath%>$Common/Image/Background/6.jpg' />";
}

if (sPath.match("DWTCGROUP"))
{
//var img1 = 5;
document.getElementById('ImageHolder').innerHTML = "<img id='img' src='<%=Request.ApplicationPath%>$Common/Image/Background/4.jpg' />";
}

if (sPath.match("HOME"))
{
//var img1 = 5;
document.getElementById('ImageHolder').innerHTML = "<img id='img' src='<%=Request.ApplicationPath%>$Common/Image/Background/menu-bg.jpg' />";
}
          //document.getElementById('ImageHolder').innerHTML = "<img id='img' src='./images/background/menu-bg.jpg' />";
          //img.src = "./images/background/menu-bg.jpg"; 
}

function chk1(id)
{

switch (id)
{
case 1: {document.getElementById('ImageHolder').innerHTML = "<img id='img' src='<%=Request.ApplicationPath%>$Common/Image/Background/1.jpg' />";break;}
case 2: {document.getElementById('ImageHolder').innerHTML = "<img id='img' src='<%=Request.ApplicationPath%>$Common/Image/Background/2.jpg' />";break;}
case 3: {document.getElementById('ImageHolder').innerHTML = "<img id='img' src='<%=Request.ApplicationPath%>$Common/Image/Background/3.jpg' />";break;}
case 4: {document.getElementById('ImageHolder').innerHTML = "<img id='img' src='<%=Request.ApplicationPath%>$Common/Image/Background/4.jpg' />";break;}
case 5: {document.getElementById('ImageHolder').innerHTML = "<img id='img' src='<%=Request.ApplicationPath%>$Common/Image/Background/5.jpg' />";break;}
case 6: {document.getElementById('ImageHolder').innerHTML = "<img id='img' src='<%=Request.ApplicationPath%>$Common/Image/Background/6.jpg' />";break;}
case 7: {document.getElementById('ImageHolder').innerHTML = "<img id='img' src='<%=Request.ApplicationPath%>$Common/Image/Background/7.jpg' />";break;}

default: {document.getElementById('ImageHolder').innerHTML = "<img id='img' src='<%=Request.ApplicationPath%>$Common/Image/Background/menu-bg.jpg' />";}
}

//img.src = "./images/background/" + id + ".jpg"; 
}
	    
function deft1()
{

var sPath = window.location.pathname;

if (sPath.match("ABOUTDUBAI"))
{
//var img1 = 5;
document.getElementById('ImageHolder').innerHTML = "<img id='img' src='<%=Request.ApplicationPath%>$Common/Image/Background/5.jpg' />";
}

if (sPath.match("ABOUTDWTC"))
{
//var img1 = 5;
document.getElementById('ImageHolder').innerHTML = "<img id='img' src='<%=Request.ApplicationPath%>$Common/Image/Background/3.jpg' />";
}

if (sPath.match("EVENTCALENDAR"))
{
//var img1 = 5;
document.getElementById('ImageHolder').innerHTML = "<img id='img' src='<%=Request.ApplicationPath%>$Common/Image/Background/6.jpg' />";
}

if (sPath.match("MEDIACENTER"))
{
//var img1 = 5;
document.getElementById('ImageHolder').innerHTML = "<img id='img' src='<%=Request.ApplicationPath%>$Common/Image/Background/7.jpg' />";
}


          //document.getElementById('ImageHolder').innerHTML = "<img id='img' src='../../images/background/menu-bg.jpg' />";
          //img.src = "./images/background/menu-bg.jpg"; 
}

function chk2(id)
{

switch (id)
{
case 1: {document.getElementById('ImageHolder').innerHTML = "<img id='img' src='<%=Request.ApplicationPath%>$Common/Image/Background/1.jpg' />";break;}
case 2: {document.getElementById('ImageHolder').innerHTML = "<img id='img' src='<%=Request.ApplicationPath%>$Common/Image/Background/2.jpg' />";break;}
case 3: {document.getElementById('ImageHolder').innerHTML = "<img id='img' src='<%=Request.ApplicationPath%>$Common/Image/Background/3.jpg' />";break;}
case 4: {document.getElementById('ImageHolder').innerHTML = "<img id='img' src='<%=Request.ApplicationPath%>$Common/Image/Background/4.jpg' />";break;}
case 5: {document.getElementById('ImageHolder').innerHTML = "<img id='img' src='<%=Request.ApplicationPath%>$Common/Image/Background/5.jpg' />";break;}
case 6: {document.getElementById('ImageHolder').innerHTML = "<img id='img' src='<%=Request.ApplicationPath%>$Common/Image/Background/6.jpg' />";break;}
case 7: {document.getElementById('ImageHolder').innerHTML = "<img id='img' src='<%=Request.ApplicationPath%>$Common/Image/Background/7.jpg' />";break;}

default: {document.getElementById('ImageHolder').innerHTML = "<img id='img' src='<%=Request.ApplicationPath%>$Common/Image/Background/menu-bg.jpg' />";}
}

//img.src = "./images/background/" + id + ".jpg"; 
}
	    
function deft2()
{
          document.getElementById('ImageHolder').innerHTML = "<img id='img' src='<%=Request.ApplicationPath%>$Common/Image/Background/menu-bg.jpg' />";
          //img.src = "./images/background/menu-bg.jpg"; 
}





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);
	}
}

function GetWidth (Tag)
{
	return(ParseInteger(NetscapeNavigator4 ? Tag.clip.width : (Tag.style.pixelWidth || Tag.offsetWidth)));
}

function GetHeight (Tag)
{
	return(ParseInteger(NetscapeNavigator4 ? Tag.clip.height : (Tag.style.pixelHeight || Tag.offsetHeight)));
}

/// <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, 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=\"opaque\" \/\>\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=\"opaque\" 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>
///  These functions enable drop-down menus
///  Significant portions of this code are based on Koivisto, J. (2004), "KOIVI Nearly Pure CSS Drop-down Menus", KOIVI [http://koivi.com/css-menus/] cited below
///
///  KOIVI Nearly Pure CSS Drop-down Menus (C) 2004 Justin Koivisto
///  Version 3.0
///  Last Modified: 4/27/2005
///  This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License 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. See the GNU Lesser General Public License for more details.
///  You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
///  For more details on the GNU Lesser General Public License, see http://www.gnu.org/copyleft/lesser.html
/// </summary>
function ShowRequestedImage ()
{
	try
	{
		if (typeof(ShowRequestedImageInterval) != "undefined")
		{
			if (ShowRequestedImageInterval != null)
			{
				window.clearTimeout(ShowRequestedImageInterval);
				ShowRequestedImageInterval = null;
			}
		}
		RequestedImageTag.src = RequestedImageSourceURL;
	}
	catch (ExceptionObject)
	{
	}
}

function RequestShowImage (ImageTag, ImageSourceURL)
{
	if ((typeof(RequestedImageTag) == "undefined") || (typeof(RequestedImageSourceURL) == "undefined"))
	{
		RequestedImageTag = ImageTag;
		RequestedImageSourceURL = ImageSourceURL;
		ShowRequestedImage();
	}
	else if (RequestedImageTag != ImageTag)
	{
		ShowRequestedImage();
		RequestedImageTag = ImageTag;
		RequestedImageSourceURL = ImageSourceURL;
		ShowRequestedImage();
	}
	else
	{
		RequestedImageTag = ImageTag;
		RequestedImageSourceURL = ImageSourceURL;
		if (typeof(ShowRequestedImageInterval) != "undefined")
		{
			if (ShowRequestedImageInterval != null)
			{
				window.clearTimeout(ShowRequestedImageInterval);
				ShowRequestedImageInterval = null;
			}
		}
		ShowRequestedImageInterval = window.setTimeout(("ShowRequestedImage();"), ShowRequestedImageDelay);
	}
}

function ShowMenu (MenuNodeTag)
{
	try
	{
		if ((MenuNodeTag.MenuNodeImageTag) && (MenuNodeTag.MenuNodeImageTag.RegularSource) && (MenuNodeTag.MenuNodeImageTag.HighlightedSource))
		{
			RequestShowImage(MenuNodeTag.MenuNodeImageTag, MenuNodeTag.MenuNodeImageTag.HighlightedSource);
		}
		if (InternetExplorer)
		{
			if (MenuNodeTag.MenuChildNodeGroupTag)
			{
				MenuNodeTag.MenuChildNodeGroupTag.style.display = "block";
			}
		}
	}
	catch (ExceptionObject)
	{
	}
}

function HideMenu (MenuNodeTag)
{
	try
	{
		if ((MenuNodeTag.MenuNodeImageTag) && (MenuNodeTag.MenuNodeImageTag.RegularSource) && (MenuNodeTag.MenuNodeImageTag.HighlightedSource))
		{
			RequestShowImage(MenuNodeTag.MenuNodeImageTag, MenuNodeTag.MenuNodeImageTag.RegularSource);
		}
		if (InternetExplorer)
		{
			if (MenuNodeTag.MenuChildNodeGroupTag)
			{
				MenuNodeTag.MenuChildNodeGroupTag.style.display = "none";
			}
		}
	}
	catch (ExceptionObject)
	{
	}
}

function InitializeMenu (MenuRootNodeGroupTagId)
{
	try
	{
		SetGlobalBrowserVariables();
		if (document.getElementById(MenuRootNodeGroupTagId))
		{
			var MenuRootNodeGroupTag = document.getElementById(MenuRootNodeGroupTagId);
			var MenuNodeTag = MenuRootNodeGroupTag.getElementsByTagName("LI");
			if (MenuNodeTag.length > 0)
			{
				MenuNodeTag[0].className = "FirstChild";
			}
			for (var i = 0; i < MenuNodeTag.length; i++)
			{
				var MenuNodeImageTag = MenuNodeTag[i].getElementsByTagName("IMG");
				if (MenuNodeImageTag.length > 0)
				{
					MenuNodeTag[i].MenuNodeImageTag = MenuNodeImageTag[0];
					if (MenuNodeImageTag[0].src.indexOf(MenuHighlightedKeyword + ".") == -1)
					{
						MenuNodeTag[i].MenuNodeImageTag.RegularSource = MenuNodeImageTag[0].src;
						MenuNodeTag[i].MenuNodeImageTag.HighlightedSource = MenuNodeImageTag[0].src.substring(0, MenuNodeImageTag[0].src.lastIndexOf(".")) + MenuHighlightedKeyword + ".gif";
					}
				}
				var MenuChildNodeGroupTag = MenuNodeTag[i].getElementsByTagName("UL");
				if (MenuChildNodeGroupTag.length > 0)
				{
					MenuNodeTag[i].MenuChildNodeGroupTag = MenuChildNodeGroupTag[0];
					var MenuChildNodeTag = MenuChildNodeGroupTag[0].getElementsByTagName("LI");
					if (MenuChildNodeTag.length > 0)
					{
						MenuChildNodeTag[0].className = "FirstChild";
					}
				}
				MenuNodeTag[i].onmouseover = new Function("ShowMenu(this);");
				MenuNodeTag[i].onmouseout = new Function("HideMenu(this);");
			}
		}
	}
	catch (ExceptionObject)
	{
	}
}






/// <summary>
/// <summary>
///  These function parses the DOM and assigns CSS selectors for IE
/// </summary>

function AssignClassNameSuffix (Tag, ClassNameSuffix)
{
	try
	{
		if (typeof(Tag.className) == "undefined")
		{
			Tag.className = ClassNameSuffix;
		}
		else
		{
			Tag.className = Tag.className + " " + ClassNameSuffix;
		}
	}
	catch (ExceptionObject)
	{
	}
}

function AssignCSSSelectors ()
{
	try
	{
		SetGlobalBrowserVariables();
		if (InternetExplorer)
		{
			var ListTag = document.getElementsByTagName("UL");
			var ListFirstChildTag = null;
			var ListLastChildTag = null;
			var ListItemTag = null;
			for (var i = 0; i < ListTag.length; i++)
			{
				ListFirstChildTag = null;
				ListLastChildTag = null;
				if (ListTag[i].hasChildNodes)
				{
					ListItemTag = ListTag[i].childNodes;
					for (var j = 0; j < ListItemTag.length; j++)
					{
						if (ListItemTag[j].tagName.toLowerCase() == "li")
						{
							if (ListFirstChildTag == null)
							{
								ListFirstChildTag = ListItemTag[j];
							}
							ListLastChildTag = ListItemTag[j];
						}
					}
				}
				if (ListFirstChildTag != null)
				{
					AssignClassNameSuffix(ListFirstChildTag, "FirstChild");
					if (ListFirstChildTag != ListLastChildTag)
					{
						AssignClassNameSuffix(ListLastChildTag, "LastChild");
					}
				}
			}
		}
	}
	catch (ExceptionObject)
	{
	}
}

/// <summary>
///  These functions handle events generated by an Input Text box
/// </summary>
function InputTextOnFocusHandler (InputTag, DefaultText)
{
 try
 {
  if (InputTag.value == DefaultText)
  {
   InputTag.value = "";
  }
 }
 catch (ExceptionObject)
 {
 }
}
function InputTextOnBlurHandler (InputTag, DefaultText)
{
 try
 {
  if (InputTag.value == "")
  {
   InputTag.value = DefaultText;
  }
 }
 catch (ExceptionObject)
 {
 }
}

/// <summary>
///  This function Scrolls the page up.
/// </summary>
function pageTop()
{
 try
 {
 window.scrollTo(0,0)
 }
 catch (ExceptionObject)
 {
 }
}

/// <summary>
///  This function goes back a page from history.
/// </summary>
function pageBack()
{
 try
 {
  history.back();
 }
 catch (ExceptionObject)
 {
 }
}

/// <summary>
///  This function Toggles Display style none or block.
/// </summary>
function Display(Tagid)
{
 try
 {
 var Toggle = document.getElementById(Tagid);
 if (Toggle.style.display == "block")
  {
   Toggle.style.display = "none";
  }
 else
  {
   Toggle.style.display = "block";
  }   
 }
 catch (ExceptionObject)
 {
 }
 return false;
}


/// <summary>
///  This function opens a new window
/// </summary>
function NewWindow(URL)
{
 try
 {
  window.open(URL);
 }
 catch (ExceptionObject)
 {
 }
 return false;
}

/// <summary>
///  This function opens a Maximized popup
/// </summary>

function PopupMax(URL, Width, Height, Scrollable, Resizable)
{
	try
	{
		var PopupMax;
		if ((typeof(Width) == "number") && (typeof(Height) == "number"))
		{
			PopupMax = window.open(URL, "PopupMax", "width = " + Width + ", height = " + Height + ", top = " + ((screen.height - Height) / 2) + ", left = " + ((screen.width - Width) / 2) + ", resizable = " + (Resizable ? "yes" : "no") + ", scrollbars = " + (Scrollable ? "yes" : "no") + ", status = no, menubar = yes");
		}
		else
		{
			PopupMax = window.open(URL, "PopupMax");
		}
  window.moveTo(0, 0);
		PopupMax.window.focus();
	}
	catch (ExceptionObject)
	{
		alert("Your browser or a piece of software installed on your\ncomputer appears to be blocking popups on this page.\n\nPlease enable popups and refresh this page to continue.");
	}
}
 function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  
  if (restore) selObj.selectedIndex=0;
}

function ToggleDisplay(id)
  {
    var elem = document.getElementById(id);
   
    if (elem) 
    {
      if (elem.style.display != 'block') 
      {
        elem.style.display = 'block';
        elem.style.visibility = 'visible';
      } 
      else
      {
        elem.style.display = 'none';
        elem.style.visibility = 'hidden';
       
      }
    }
  
  }
  
  function ToggleDisplay2(id,name1)
  {
    var elem = document.getElementById(id).innerHTML = "<table cellpadding=0 cellspacing=0 border=0 width=520 height=405 bgcolor=#ffffff align=center><tr><td align=right><a href=javascript:close('"+id+"');>Close</a></td></tr><tr><td><img src='../PhotoGalleryImages/"+name1+"' /></td></tr></table>";
   
    if (elem) 
    {
      if (elem.style.display != 'block') 
      {
        elem.style.display = 'block';
        elem.style.visibility = 'visible';
      } 
      else
      {
        elem.style.display = 'none';
        elem.style.visibility = 'hidden';
       
      }
    }
  
  }
  
  function ToggleDisplay3(id,name1)
  {
	document.getElementById(id).style.display = 'block';
	document.getElementById(id).style.visibility = 'visible';
    var elem = document.getElementById(id).innerHTML = "<table cellpadding=0 cellspacing=0 border=0 width=428 height=278 bgcolor=#ffffff align=center><tr><td align=right><a href=javascript:close('"+id+"');><b>Close</b></a></td></tr><tr><td><a href=javascript:close('"+id+"');><img src='../PhotoGalleryImages/"+name1+"' /></a></td></tr></table>";
  }
  
  function ToggleDisplay4(id,name1,id2,id3,id4)
  {
	document.getElementById(id).style.display = 'block';
	document.getElementById(id).style.visibility = 'visible';
	document.getElementById(id2).style.display = 'none';
	document.getElementById(id2).style.visibility = 'hidden';
    var elem = document.getElementById(id).innerHTML = "<table cellpadding=0 cellspacing=0 border=0 width=428 height=278 bgcolor=#ffffff align=center><tr><td align=right><a href=javascript:close('"+id+"');open('"+id2+"');open('"+id3+"');open('"+id4+"');><b>Close</b></a></td></tr><tr><td><a href=javascript:close('"+id+"');open('"+id2+"');open('"+id3+"');open('"+id4+"');><img src='"+name1+"' /></a></td></tr><tr><td height='20'></td></tr></table>";
  }
  
  function open(id)
  {
	document.getElementById(id).style.display = 'block';
	document.getElementById(id).style.visibility = 'visible';
	//document.getElementById(id2).style.display = 'none';
	//document.getElementById(id2).style.visibility = 'hidden';
    //var elem = document.getElementById(id).innerHTML = "<table cellpadding=0 cellspacing=0 border=0 width=428 height=278 bgcolor=#ffffff align=center><tr><td align=right><a href=javascript:close('"+id+"');><b>Close</b></a></td></tr><tr><td><a href=javascript:close('"+id+"');><img src='"+name1+"' /></a></td></tr></table>";
  }
  
  function close(id)
  {
  document.getElementById(id).style.display = 'none';
  document.getElementById(id).style.visibility = 'hidden';
  }

  function MM_preloadImages() { //v3.0
	var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function clearfield(id)
{
if (document.getElementById(id).value == "Enter Email here")
	document.getElementById(id).value=""
	
}

function fillfield(id)
{
if (document.getElementById(id).value == "")
	document.getElementById(id).value="Enter Email here"
	
}


function EmbedFlash (VersionMajor, Id, Width, Height, Movie, ScriptAccess, Quality, BackgroundColor, ShowMenu, 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=\"opaque\" \/\>\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=\"opaque\" 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)
	{
	}
}

function onkeypress_numericfilter(event,reference)
 {
	var keycode;
	if (document.all)
		keycode=event.keyCode;
	else
		keycode=event.which;

	if((keycode == 8) || (keycode == 127) || (keycode == 9)  || (keycode == 0) || (keycode == 32) || (keycode == 45))
		return(true);
  
	if (((keycode > 47) && (keycode < 58)))
		return(true);
	else
		return(false);
 }
 
function OpenPopup(URL, ImageWidth, ImageHeight)
{
	var ScreenWidth = screen.availWidth;
	var ScreenHeight = screen.availHeight;
		
	if ((ImageWidth > ScreenWidth) || (ImageHeight > ScreenHeight))
	{					
		window.open(URL, "Popup", "width=" + ScreenWidth + ",height=" + ScreenHeight + ",top=" + ((screen.height - ScreenHeight) / 2) + ",left=" + ((screen.width - ScreenWidth) / 2) + ",resizable=yes,scrollbars=yes,status=no,menubar=no");
		return;
	}
	else
	{
		window.open(URL, "Popup", "width =" + ImageWidth + ",height=" + ImageHeight + ",top=" + ((screen.height - ImageHeight) / 2) + ",left=" + ((screen.width - ImageWidth) / 2) + ",resizable=no,scrollbars=yes,status=no,menubar=no");
		return;
	}
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 
/// <summary>
///  Below functions are required by component art to work
/// </summary>
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function PickerFrom_OnDateChange()
      {
        var fromDate = PickerFrom.GetSelectedDate();
        var toDate = PickerTo.GetSelectedDate();
        CalendarFrom.SetSelectedDate(fromDate);
        if (fromDate > toDate)
        {
          PickerTo.SetSelectedDate(fromDate);
          CalendarTo.SetSelectedDate(fromDate);
        }
      }
      function PickerTo_OnDateChange()
      {
        var fromDate = PickerFrom.GetSelectedDate();
        var toDate = PickerTo.GetSelectedDate();
        CalendarTo.SetSelectedDate(toDate);
        if (fromDate > toDate)
        {
          PickerFrom.SetSelectedDate(toDate);
          CalendarFrom.SetSelectedDate(toDate);
        }
      }
      function CalendarFrom_OnChange()
      {
        var fromDate = CalendarFrom.GetSelectedDate();
        var toDate = PickerTo.GetSelectedDate();
        PickerFrom.SetSelectedDate(fromDate);
        if (fromDate > toDate)
        {
          PickerTo.SetSelectedDate(fromDate);
          CalendarTo.SetSelectedDate(fromDate);
        }
      }
      function CalendarTo_OnChange()
      {
        var fromDate = PickerFrom.GetSelectedDate();
        var toDate = CalendarTo.GetSelectedDate();
        PickerTo.SetSelectedDate(toDate);
        if (fromDate > toDate)
        {
          PickerFrom.SetSelectedDate(toDate);
          CalendarFrom.SetSelectedDate(toDate);
        }
      }
      function ButtonFrom_OnClick()
      {
        if (CalendarFrom.PopUpObjectShowing)
        {
          CalendarFrom.Hide();
        }
        else
        {
          CalendarFrom.SetSelectedDate(PickerFrom.GetSelectedDate());
          CalendarFrom.Show();
        }
      }
      function ButtonTo_OnClick()
      {
        if (CalendarTo.PopUpObjectShowing)
        {
          CalendarTo.Hide();
        }
        else
        {
          CalendarTo.SetSelectedDate(PickerTo.GetSelectedDate());
          CalendarTo.Show();
        }
      }
      function ButtonFrom_OnMouseUp()
      {
        if (CalendarFrom.PopUpObjectShowing)
        {
          event.cancelBubble=true;
          event.returnValue=false;
          return false;
        }
        else
        {
          return true;
        }
      }
      function ButtonTo_OnMouseUp()
      {
        if (CalendarTo.PopUpObjectShowing)
        {
          event.cancelBubble=true;
          event.returnValue=false;
          return false;
        }
        else
        {
          return true;
        }
      }