/* LiquiTech API - Popups **********************************
 *	
 *	This API contains all the functions needed to genreate Javascript
 *	popup windows.
 *
 *	Assumptions:	This API assumes that there are the following
 *					DOM elements already in existence in the header file:
 *					- glassPane
 *					- shadedPane
 *
 *	Required APIs:	- brdApiElement.js
 *					- brdApiWindow.js
 *	
 *********************************************************************/
 
 /* API Variables * *******************************************************
 *
 *	NOTES:		These variables are used as global references for all BRD
 *				API functions that are included after this API file.
 *				Consequently this creates a dependency that this API file
 *				must be included before any other BRD API. 
 *
 *************************************************************************/
 
 	var shadedElement 	= getElement("shadedPane");
	var shaderEnabled 	= false;
	
/*  Shade Page Background* *******************************************************
 *
 *	TAKES:		Shade Color value (e.g. #000000), Shade Opacity value (0-100)
 * 	RETURNS:	NOTHING
 *	NOTE:		This function uses the GLOBAL varible shading element object to 
 *				overlay the website with the shade color and opacity specified.
 *
 *************************************************************************/
 
	function shadePageBackground(shadeColor, shadeOpacity)
	{
		if (shadedElement)
		{
			shaderEnabled = true;
			
			if (parseInt(navigator.appVersion)>3)
			{
				var IE = document.all ? true : false;
				
				 if (!IE)
				 {
					  windowWidth 	= window.innerWidth-16;
					  windowHeight 	= window.innerHeight+300;
					  windowTop		= document.body.scrollTop-150;
					  windowLeft	= document.body.scrollLeft;
				 }
				 else
				 {
					  windowWidth 	= document.body.offsetWidth-20;
					  windowHeight 	= document.body.offsetHeight+300;
					  windowTop		= document.body.scrollTop-150;
					  windowLeft	= document.body.scrollLeft;
				 }
			}
			
			shadedElement.style.top = windowTop;
			shadedElement.style.left = 0;
			shadedElement.style.width = windowWidth;
			shadedElement.style.height = windowHeight;
			
			shadedElement.style.backgroundColor = shadeColor;
			shadedElement.style.filter = "alpha(opacity=" + shadeOpacity + ");"; // IE
			shadedElement.style.MozOpacity = shadeOpacity/100; // FireFox, Safari
			shadedElement.style.display = "block";
		}
		else
		{
			alert("ERROR brdApiPopup >> shadePageBackground(shadedElement, shadeColor, shadeOpacity):\n- shadedElement is undefined.");	
		}
	}


/*  Restore Page Background* *******************************************************
 *
 *	TAKES:		NOTHING
 * 	RETURNS:	NOTHING
 *	NOTE:		Hides the shading element object.
 *
 *************************************************************************/
 
	function restorePageBackground()
	{
		shadedElement.style.display = "none";
		glassElement.style.display = "none";
		shaderEnabled = false;
	}


/*  Set Glass Pane Content * *******************************************************
 *
 *	TAKES:		Popup Content (includes HTML)
 * 	RETURNS:	NOTHING
 *	NOTE:		Generates a popup with a dropshadow using the GLOBAL glass pane object.
 *
 ***********************************************************************************/
 
	function setGlassPaneContent(contentValue)
	{
		if (glassElement)
		{
			var content;
			
			content = "<table cellpadding=\"0\" cellspacing=\"0\">"
			content = content + "<tr><td background=\"/images/shadowLeftUp.png\" height=\"9\"></td><td background=\"/images/shadowUp.png\" height=\"9\"></td><td background=\"/images/shadowRightUp.png\" height=\"9\"></td></tr>";
			content = content + "<tr><td background=\"/images/shadowLeft.png\" width=\"9\"></td><td align=\"center\" bgcolor=\"#FFFFFF\">";
			content = content + contentValue;
			content = content + "</td><td background=\"/images/shadowRight.png\" width=\"9\"></td></tr>";
			content = content + "<tr><td background=\"/images/shadowLeftDown.png\" height=\"9\"></td><td background=\"/images/shadowDown.png\" height=\"9\"></td><td background=\"/images/shadowRightDown.png\" height=\"9\"></td></tr>";
			content = content + "</table>";
			
			glassElement.innerHTML = content;
			glassElement.style.display = "block";
			updateShadedPopupPosition(glassElement.id);
		}
		else
		{
			alert("ERROR brdApiPopup >> setGlassPaneContent(content, posX, posY):\n- glassElement is undefined.");	
		}
	}
	

/*  Set Pane Content * *******************************************************
 *
 *	TAKES:		Popup Content (includes HTML)
 * 	RETURNS:	NOTHING
 *	NOTE:		Generates a popup with a dropshadow using the provided pane object.
 *
 ***********************************************************************************/
 
	function setPaneContent(paneObject, contentValue)
	{
		if (paneObject)
		{
			var content;
			
			content = "<table cellpadding=\"0\" cellspacing=\"0\">"
			content = content + "<tr><td background=\"/images/shadowLeftUp.png\" height=\"9\"></td><td background=\"/images/shadowUp.png\" height=\"9\"></td><td background=\"/images/shadowRightUp.png\" height=\"9\"></td></tr>";
			content = content + "<tr><td background=\"/images/shadowLeft.png\" width=\"9\"></td><td align=\"center\" bgcolor=\"#FFFFFF\">";
			content = content + contentValue;
			content = content + "</td><td background=\"/images/shadowRight.png\" width=\"9\"></td></tr>";
			content = content + "<tr><td background=\"/images/shadowLeftDown.png\" height=\"9\"></td><td background=\"/images/shadowDown.png\" height=\"9\"></td><td background=\"/images/shadowRightDown.png\" height=\"9\"></td></tr>";
			content = content + "</table>";
			
			paneObject.innerHTML = content;
			paneObject.style.display = "block";
		}
		else
		{
			alert("ERROR brdApiPopup >> setPaneContent(paneObject, contentValue):\n- paneObject is undefined.");	
		}
	}


/*  Set Glass Pane Content * *******************************************************
 *
 *	TAKES:		Popup Content (includes HTML)
 * 	RETURNS:	NOTHING
 *	NOTE:		Generates a popup with a dropshadow using the GLOBAL glass pane object.
 *
 ***********************************************************************************/
 
	function shadedPopup(content)
	{
		shadePageBackground("#000000", 70);
		setGlassPaneContent(content);	
	}


/*  Set Popup Position * *******************************************************
 *
 *	TAKES:		Popup Element Object, Position X, Position Y
 * 	RETURNS:	NOTHING
 *	NOTE:		Set the postion of the popup object to the specific x and y positions
 *				on the live area of the browser starting from the upper left hand corner
 *
 ***********************************************************************************/
 
	function setPopupPosition(popupElement, posX, posY)
	{
		if (popupElement)
		{
			popupElement.style.left = posX;
			popupElement.style.top	= posY + getPageYOffset();
		}
		else
		{
			alert("ERROR brdApiPopup >> setPopupPosition():\n- popupElement is undefined.");	
		}
	}


/*  Updated Shaded Popup Position * *******************************************************
 *
 *	TAKES:		Popup Element Object
 * 	RETURNS:	NOTHING
 *	NOTE:		Repositions the popup object to be centered with the webpage, both
 *				vertically and horizontally.
 *
 ***********************************************************************************/
 
	function updateShadedPopupPosition(popupElementId)
	{
		var popupElement = getElement(popupElementId);
		
		if (popupElement)
		{
			popupElement.style.left = getPosX(popupElement);
			popupElement.style.top	= ((getWindowHeight() - getHeight(popupElement)) / 2) + getPageYOffset();
		}
		else
		{
			alert("ERROR brdApiPopup >> updateShadedPopupPosition():\n- glassElement is undefined.");	
		}
	}


/*  Update Popup Shader * *******************************************************
 *
 *	TAKES:		NOTHING
 * 	RETURNS:	NOTHING
 *	NOTE:		Repaints the page background, and updates the position of the popup.
 *
 ***********************************************************************************/
 
	function updatePopupShader()
	{
		if (shaderEnabled)
		{
			shadePageBackground('#000000', 70);
			updateShadedPopupPosition(glassElement.id);
		}
	}


/*  Update Shader * *******************************************************
 *
 *	TAKES:		NOTHING
 * 	RETURNS:	NOTHING
 *	NOTE:		Repaints the page background.
 *
 ***********************************************************************************/
 
	function updateShader()
	{
		if (shaderEnabled)
		{
			shadePageBackground('#000000', 70);
		}
	}
	

/*  Image View Popup * *******************************************************
 *
 *	TAKES:		Image Name, Image URL
 * 	RETURNS:	NOTHING
 *	NOTE:		Generates an image popup with the image name as the header description
 *				and image URL as the image.
 *
 ***********************************************************************************/
 
	function imageViewPopup(imageName, imageUrl)
	{
		shadePageBackground("#000000", 70);
		glassElement.style.display = "none";
		//showLoadingGraphic();
		var content;
			
		content = "<table cellpadding=\"0\" cellspacing=\"0\">";
		content = content + "<tr><td background=\"/images/shadowLeftUp.png\" height=\"9\"></td><td background=\"/images/shadowUp.png\" height=\"9\"></td><td background=\"/images/shadowRightUp.png\" height=\"9\"></td></tr>";
		content = content + "<tr><td background=\"/images/shadowLeft.png\" width=\"9\"></td><td height=\"45\" bgcolor=\"#EEEEEE\">";
		content = content + "	<div style=\"padding-left: 15px; padding-right: 15px; background-image: url(http://www.blueriverdigital.com/images/divGradGrayDropShadow.jpg); background-repeat: repeat-x; border-bottom: solid; border-bottom-width: 1px; border-bottom-color: #BBBBBB;\">"
		content = content + "	<table><col width=\"95%\"><col width=\"5%\"><tr>";
		content = content + "		<td><font color=\"#000000\"><b>" + imageName + "</b></td>";
		content = content + "		<td align=\"right\" valign=\"center\"><span onMouseOver=\"this.style.cursor='pointer'; getElement('closeBtn').src='/images/close_icon_on.png';\" onMouseOut=\"getElement('closeBtn').src='/images/close_icon.png';\" onClick=\"restorePageBackground();\">";
        content = content + "			<img src=\"/images/close_icon.png\" id=\"closeBtn\" border=\"0\"/>";
        content = content + "		</span></td>";
		content = content + "	</tr></table>";
		content = content + "	</div>";
		content = content + "	<div style=\"margin: 10px; padding: 15px; border: solid; border-width: 1px; border-color: #AAAAAA; background-color: #FFFFFF;\" align=\"center\">";
		content = content + "		<img src=\"" + imageUrl + "\" onLoad=\"glassElement.style.display='block'; updateShadedPopupPosition(glassElement.id);\">";
		content = content + "	</div>";
		content = content + "</td><td background=\"/images/shadowRight.png\" width=\"9\"></td></tr>";
		content = content + "<tr><td background=\"/images/shadowLeftDown.png\" height=\"9\"></td><td background=\"/images/shadowDown.png\" height=\"9\"></td><td background=\"/images/shadowRightDown.png\" height=\"9\"></td></tr>";
		content = content + "</table>";
		
		glassElement.innerHTML = content;
		updateShadedPopupPosition(glassElement.id);
	}
	
/*  Text Content Popup * *******************************************************
 *
 *	TAKES:		Image Name, Image URL
 * 	RETURNS:	NOTHING
 *	NOTE:		Generates an image popup with the image name as the header description
 *				and image URL as the image.
 *
 ***********************************************************************************/
 
	function textPopup(contentTitle, contentText)
	{
		shadePageBackground("#000000", 70);
		glassElement.style.display = "none";
		
		var content;
		
		content = "<table cellpadding=\"0\" cellspacing=\"0\">";
		content = content + "<tr><td background=\"/images/shadowLeftUp.png\" height=\"9\"></td><td background=\"/images/shadowUp.png\" height=\"9\"></td><td background=\"/images/shadowRightUp.png\" height=\"9\"></td></tr>";
		content = content + "<tr><td background=\"/images/shadowLeft.png\" width=\"9\"></td><td height=\"45\" bgcolor=\"#EEEEEE\">";
		content = content + "	<div style=\"padding-left: 15px; padding-right: 15px; background-image: url(http://www.blueriverdigital.com/images/divGradGrayDropShadow.jpg); background-repeat: repeat-x; border-bottom: solid; border-bottom-width: 1px; border-bottom-color: #BBBBBB;\">"
		content = content + "	<table><col width=\"95%\"><col width=\"5%\"><tr>";
		content = content + "		<td><font color=\"#000000\"><b>" + contentTitle + "</b></td>";
		content = content + "		<td align=\"right\" valign=\"center\"><span onMouseOver=\"this.style.cursor='pointer'; getElement('closeBtn').src='/images/close_icon_on.png';\" onMouseOut=\"getElement('closeBtn').src='/images/close_icon.png';\" onClick=\"restorePageBackground();\">";
        content = content + "			<img src=\"/images/close_icon.png\" id=\"closeBtn\" border=\"0\"/>";
        content = content + "		</span></td>";
		content = content + "	</tr></table>";
		content = content + "	</div>";
		content = content + "	<div style=\"margin: 10px; padding: 15px; border: solid; border-width: 1px; border-color: #AAAAAA; background-color: #FFFFFF;\">";
		content = content + contentText;
		content = content + "	</div>";
		content = content + "</td><td background=\"/images/shadowRight.png\" width=\"9\"></td></tr>";
		content = content + "<tr><td background=\"/images/shadowLeftDown.png\" height=\"9\"></td><td background=\"/images/shadowDown.png\" height=\"9\"></td><td background=\"/images/shadowRightDown.png\" height=\"9\"></td></tr>";
		content = content + "</table>";
		
		glassElement.innerHTML = content;
		glassElement.style.display = "block";
		updateShadedPopupPosition(glassElement.id);
	}
	
/*  Yes No Cancel Popup * *******************************************************
 *
 *	TAKES:		Popup Content (includes HTML), Yes button action, No button action
 *				Cancel button action
 * 	RETURNS:	NOTHING
 *	NOTE:		Generates a popup with a dropshadow using the GLOBAL glass pane object.
 *
 ***********************************************************************************/
 
	function yesNoCancelPopup(popupTitle, popupText, yesAction, noAction, cancelAction)
	{
		if (glassElement)
		{
			var content;
			var buttonActions 	= "onMouseOver=\"this.style.cursor='pointer'; this.style.color='#FFFFFF';\" ";
			buttonActions		= buttonActions + "onMouseout=\"this.style.cursor=''; this.style.color='#000000';\" ";
			
			var buttonStyles	= "style=\"text-align: center; height: 28px; background: url(/images/btnGlassGray1.jpg); border: solid; border-color: #888888; border-width: 1px; padding: 5px;\"";
			
			content = "<table cellpadding=\"0\" cellspacing=\"0\">";
			content = content + "<tr><td background=\"/images/shadowLeftUp.png\" height=\"9\"></td><td background=\"/images/shadowUp.png\" height=\"9\"></td><td background=\"/images/shadowRightUp.png\" height=\"9\"></td></tr>";
			content = content + "<tr><td background=\"/images/shadowLeft.png\" width=\"9\"></td><td align=\"center\" valign=\"center\" bgcolor=\"#FFFFFF\">";
			
			content = content + "<div style=\"padding: 15px; background-image: url(http://www.blueriverdigital.com/images/divGradGrayDropShadow.jpg); background-repeat: repeat-x; border-bottom: solid; border-bottom-width: 1px; border-bottom-color: #BBBBBB; font-size: 12px; font-weight: bold;\">";
			content = content + popupTitle;
			content = content + "<div/>";
			content = content + "<div style=\"padding: 25px 10px 25px 10px; font-size: 11px; font-weight: normal;\">";
			content = content + popupText;
			content = content + "<div/>";
			content = content + "<div style=\"margin-top: 15px; border-top: solid; border-top-color: #BBBBBB; border-top-width: 1px; padding-top: 15px;\">";
			content = content + "	<span " + buttonActions + " onClick=\"" + yesAction + " glassElement.style.display='none';\" " + buttonStyles + ">&nbsp;&nbsp;&nbsp;Yes&nbsp;&nbsp;&nbsp;</span> &nbsp;";
			content = content + "	<span " + buttonActions + " onClick=\"" + noAction + " glassElement.style.display='none';\" " + buttonStyles + ">&nbsp;&nbsp;&nbsp;No&nbsp;&nbsp;&nbsp;</span> &nbsp;";
			content = content + "	<span " + buttonActions + " onClick=\"" + cancelAction + " glassElement.style.display='none';\" " + buttonStyles + ">Cancel</span>";
			content = content + "</div>";
			
			content = content + "</td><td background=\"/images/shadowRight.png\" width=\"9\"></td></tr>";
			content = content + "<tr><td background=\"/images/shadowLeftDown.png\" height=\"9\"></td><td background=\"/images/shadowDown.png\" height=\"9\"></td><td background=\"/images/shadowRightDown.png\" height=\"9\"></td></tr>";
			content = content + "</table>";
			
			glassElement.innerHTML = content;
			glassElement.style.display = "block";
		}
		else
		{
			alert("ERROR brdApiPopup >> yesNoCancelPopup(popupTitle, popupText, yesAction, noAction, cancelAction):\n- glassElement is undefined.");	
		}
	}
	
/*  Sub Menu Popup * *******************************************************
 *
 *	TAKES:		Menu Item Array, Menu Actions Array
 * 	RETURNS:	NOTHING
 *	NOTE:		The arrays provided must be of the same length, so that for each
 *				menu item in the menuItemsArray, there is a corresponding menu action
 *				in the menuActionsArray.
 *
 ***********************************************************************************/
 
	function subMenuPopup(menuItemsArray, menuActionsArray)
	{
		// Check arrays
		if (menuItemsArray.isArray() & menuActionsArray.isArray())
		{
			if (menuItemsArray.length == menuActionsArray.length)
			{
				// Build the sub menu content
				var contentValue = "<div id=\"subMenuPopup\" style=\"font-family: Arial, Helvetica, sans-serif; font-size: 11px; color: #000000;\" align=\"left\" onMouseUp=\"hideElement(this);\">";
				
				for(var ctr=0; ctr<menuItemsArray.length; ctr++)
				{
					contentValue = contentValue + "<div id=\"submenu" + ctr + "\" style=\"padding: 2px 15px 2px 15px ;\" onMouseOver=\"this.style.cursor='pointer'; this.style.backgroundColor='yellow';\" onMouseOut=\"this.style.cursor=''; this.style.backgroundColor='';\" onMouseUp=\"" + menuActionsArray[ctr] + "\">" + menuItemsArray[ctr] + "</div>";	
				}
				
				contentValue = contentValue + "</div>";
				
				setPaneContent(glassElement, contentValue)
			}
			else //Errors
			{
				if (menuItemsArray.length > menuActionsArray.length)
				{
					alert("ERROR brdApiPopup >> subMenuPopup(menuItemsArray, menuActionsArray):\n- There are not enough menuActionsArray actions for all the menuItemsArray items specified.");	
				}
				else
				{
					alert("ERROR brdApiPopup >> subMenuPopup(menuItemsArray, menuActionsArray):\n- There are not enough menuItemsArray items for all the menuActionsArray actions specified.");	
				}
			}
		}
		else
		{
			alert("ERROR brdApiPopup >> subMenuPopup(menuItemsArray, menuActionsArray):\n- menuItemsArray and menuActionsArray are not arrays.");	
		}
		
	}
	
/*  Alert Shaded Popup * *******************************************************
 *
 *	TAKES:		Alert Title, Alert Message, Callback function
 * 	RETURNS:	NOTHING
 *	NOTE:		Generates a page-centered alert popup, with a shaded background
 *
 ***********************************************************************************/
 
	function alertShadedPopup(alertTitle, alertMessage)
	{
		shadePageBackground("#000000", 70);
		glassElement.style.display = "none";
		showLoadingGraphic();
		
		content = "<table cellpadding=\"0\" cellspacing=\"0\" width=\"400\">";
		content = content + "<tr><td background=\"/images/shadowLeftUp.png\" height=\"9\"></td><td background=\"/images/shadowUp.png\" height=\"9\"></td><td background=\"/images/shadowRightUp.png\" height=\"9\"></td></tr>";
		content = content + "<tr><td background=\"/images/shadowLeft.png\" width=\"9\"></td><td height=\"45\" bgcolor=\"#EEEEEE\">";
		content = content + "	<div align=\"center\" style=\"padding-left: 15px; padding-right: 15px; background-image: url(http://www.blueriverdigital.com/images/divGradGrayDropShadow.jpg); background-repeat: repeat-x; border-bottom: solid; border-bottom-width: 1px; border-bottom-color: #BBBBBB;\">"
		content = content + "		<table><tr><td valign=\"center\" height=\"35\">" + alertTitle + "</td></tr></table>";
		content = content + "	</div>";
		content = content + "	<div style=\"margin: 10px; padding: 15px; border: solid; border-width: 1px; border-color: #AAAAAA; background-color: #FFFFFF;\" align=\"center\">";
		content = content + "		<div>" + alertMessage + "<\div>";
		content = content + "		<div style=\"margin-top: 15px;\" onMouseOver=\"this.style.cursor='pointer'; getElement('closeBtn').src='/images/ok_icon_on.png';\" onMouseOut=\"getElement('closeBtn').src='/images/ok_icon_off.png';\" onClick=\"restorePageBackground();\">";
        content = content + "			<img src=\"/images/ok_icon_off.png\" id=\"closeBtn\" border=\"0\"/>";
        content = content + "		</div>";
		content = content + "	</div>";
		content = content + "</td><td background=\"/images/shadowRight.png\" width=\"9\"></td></tr>";
		content = content + "<tr><td background=\"/images/shadowLeftDown.png\" height=\"9\"></td><td background=\"/images/shadowDown.png\" height=\"9\"></td><td background=\"/images/shadowRightDown.png\" height=\"9\"></td></tr>";
		content = content + "</table>";
		
		glassElement.innerHTML = content;
		hideLoadingGraphic();
		glassElement.style.display = "block";
		
	}
	
/*  Loading Bar Popup * *******************************************************
 *
 *	TAKES:		Loading Title
 * 	RETURNS:	NOTHING
 *	NOTE:		Generates a page-centered alert popup, with a shaded background
 *
 ***********************************************************************************/
 
	function loadingBarPopup(popupTitle)
	{
		content = "<table cellpadding=\"0\" cellspacing=\"0\" width=\"400\">";
		content = content + "<tr><td background=\"/images/shadowLeftUp.png\" height=\"9\"></td><td background=\"/images/shadowUp.png\" height=\"9\"></td><td background=\"/images/shadowRightUp.png\" height=\"9\"></td></tr>";
		content = content + "<tr><td background=\"/images/shadowLeft.png\" width=\"9\"></td><td height=\"45\" bgcolor=\"#EEEEEE\">";
		content = content + "	<div align=\"center\" style=\"padding-left: 15px; padding-right: 15px; background-image: url(http://www.blueriverdigital.com/images/divGradGrayDropShadow.jpg); background-repeat: repeat-x; border-bottom: solid; border-bottom-width: 1px; border-bottom-color: #BBBBBB;\">"
		content = content + "		<table><tr><td valign=\"center\" height=\"35\"><span style=\"font-size: 11px;\">" + popupTitle + "</span></td></tr></table>";
		content = content + "	</div>";
		content = content + "	<div style=\"margin: 10px; padding: 15px; border: solid; border-width: 1px; border-color: #AAAAAA; background-color: #FFFFFF;\" align=\"center\">";
		content = content + "		<img src=\"http://www.blueriverdigital.com/images/loadingGraphicBar1.gif\">";
		content = content + "	</div>";
		content = content + "</td><td background=\"/images/shadowRight.png\" width=\"9\"></td></tr>";
		content = content + "<tr><td background=\"/images/shadowLeftDown.png\" height=\"9\"></td><td background=\"/images/shadowDown.png\" height=\"9\"></td><td background=\"/images/shadowRightDown.png\" height=\"9\"></td></tr>";
		content = content + "</table>";
		
		showElement("loadingPane");
		getElement("loadingPane").innerHTML = content;
		
		updateShadedPopupPosition("loadingPane");
		
	}
	
	
/*  Alt Text Popup * *******************************************************
 *
 *	TAKES:		Alt Text
 * 	RETURNS:	NOTHING
 *	NOTE:		Generates a tool-tip alt tag popup, set at the mouse position,
 *				requires that the "getMousePosition" event is triggeed onMouseMove.
 *
 ***********************************************************************************/
 
	function altTextPopup(altText)
	{
		setPosX(glassElement, mousePositionX+10);
		setPosY(glassElement, mousePositionY+15);
		
		glassElement.innerHTML = "<div style=\"border: solid 1px #666666; padding: 3px 8px 3px 8px; background-color: #FFFFFF;\">" + altText + "</div>";
		glassElement.style.display = "block";
	}
	
/* Video Popup * *******************************************************
 *
 *	TAKES:		Video Title, Video File
 * 	RETURNS:	NOTHING
 *	NOTE:		Generates a page-centered video popup, with a shaded background
 *
 ***********************************************************************************/
 
	function videoPopup(videoTitle, videoFile)
	{
		shadePageBackground("#000000", 70);
		glassElement.style.display = "none";
		showLoadingGraphic();
		
		content = "<table cellpadding=\"0\" cellspacing=\"0\">";
		content = content + "<tr><td background=\"/images/shadowLeftUp.png\" height=\"9\"></td><td background=\"/images/shadowUp.png\" height=\"9\"></td><td background=\"/images/shadowRightUp.png\" height=\"9\"></td></tr>";
		content = content + "<tr><td background=\"/images/shadowLeft.png\" width=\"9\"></td><td height=\"45\" bgcolor=\"#EEEEEE\">";
		content = content + "	<div style=\"padding-left: 15px; padding-right: 15px; background-image: url(http://www.blueriverdigital.com/images/divGradGrayDropShadow.jpg); background-repeat: repeat-x; border-bottom: solid; border-bottom-width: 1px; border-bottom-color: #BBBBBB;\">"
		content = content + "	<table><col width=\"95%\"><col width=\"5%\"><tr>";
		content = content + "		<td><font color=\"#000000\"><b>" + videoTitle + "</b></td>";
		content = content + "		<td align=\"right\" valign=\"center\"><span onMouseOver=\"this.style.cursor='pointer'; getElement('closeBtn').src='/images/close_icon_on.png';\" onMouseOut=\"getElement('closeBtn').src='/images/close_icon.png';\" onClick=\"getElement('myDynamicContent').stopVideo(); restorePageBackground();\">";
        content = content + "			<img src=\"/images/close_icon.png\" id=\"closeBtn\" border=\"0\"/>";
        content = content + "		</span></td>";
		content = content + "	</tr></table>";
		content = content + "	</div>";
		content = content + "	<div id=\"videoPopup\" style=\"margin: 10px; padding: 15px; border: solid; border-width: 1px; border-color: #AAAAAA; background-color: #FFFFFF;\" align=\"center\">";
		content = content + "		Video Not Found";
		content = content + "	</div>";
		content = content + "</td><td background=\"/images/shadowRight.png\" width=\"9\"></td></tr>";
		content = content + "<tr><td background=\"/images/shadowLeftDown.png\" height=\"9\"></td><td background=\"/images/shadowDown.png\" height=\"9\"></td><td background=\"/images/shadowRightDown.png\" height=\"9\"></td></tr>";
		content = content + "</table>";
		
		glassElement.innerHTML = content;
		hideLoadingGraphic();
		glassElement.style.display = "block";
		
		var flashvars =
		{ 
			defaultVideo: videoFile
		};
		
		var params =
		{
			menu: "false"
		};
		
		var attributes =
		{
			id: "myDynamicContent",
			name: "myDynamicContent"
		};
		
		swfobject.embedSWF("/imageUploads/videos/videoTest.swf", "videoPopup", "322", "272", "9.0.0","expressInstall.swf", flashvars, params, attributes);	
		
		updateShadedPopupPosition(glassElement.id);
	}

	
	
	
	
	
	

