/* 
* Class name      : modalWindow.inc
* Description     : enables modal window display and closing includes <veil option>
*                    1. OpenModal
*                    2. OpenModalWithVeil
*                    3. closeModal
*
*                   CODE DEPENDENCIES:
*                    1. var IESelectBoxIDs[]
*                    2. var isIE6
*                    3. Supporting CSS entries
*                    5. DOMUtils.js
*                    					
* Version         : 1.0
* Date            : 10/01/2010
* Copyright notice: MYCOMPANY (C) 2010
*
* Author 	Date      		Version  	Description
* ----------------------------------------------------------------------------
* GAP Jr 	10/01/2010   	1.0  	First Release
*/



function OpenModal(eID)
{	
	/** NOTE: 
	 *  Add an 'hide' entry for all select box ID's.
	 *  IE6 treats selects as top-most elements and
	 *  as such they will bleed through overlapping
	 *  DIVs 
	**/
	if(isIE6)
	{
		hideIESelectBoxes(IESelectBoxIDs);
	}
	fadeIn(eID);//fade in DHTML window
}

function OpenModalWithVeil(eID, contentID, veilID, xPos, yPos, width, height, scroll, innerHTML)
{
	fadeInToStopOpacity(veilID,70);//fade in veil
	/** NOTE: 
	 *  Add an 'hide' entry for all select box ID's.
	 *  IE6 treats selects as top-most elements and
	 *  as such they will bleed through overlapping
	 *  DIVs 
	**/
	if(isIE6)
	{
		hideIESelectBoxes(IESelectBoxIDs);
	}
	//DHTML window settings
	if(xPos)
	{
		setTop(eID,xPos);
	}
	if(yPos)
	{
		setLeft(eID,yPos);
	}
	if(width)
	{
		setWidth(contentID,width);
	}
	if(height)
	{
		setHeight(contentID,height);
	}
	if(scroll)
	{
		setScroll(contentID,scroll);
	}
	fadeIn(eID);//fade in DHTML window
	
	if(innerHTML)
	{
		document.getElementById(contentID).innerHTML = innerHTML;
	}
}

function closeModal(eID, veilID)
{
	if(veilID)
	{
		fadeOut(veilID);//fade out veil
	}
	fadeOut(eID);//fade out DHTML window
	/** NOTE: 
	 *  Add an 'show' entry for all select box ID's.
	 *  IE6 treats selects as top-most elements and
	 *  as such they will bleed through overlapping
	 *  DIVs. In OpenModal calls we hid the select
	 *  boxes, as such, we need now to restore their
	 *  display. 
	**/
	if(isIE6)
	{
		showIESelectBoxes(IESelectBoxIDs);
	}		
}

