/*
*	modalFunctions.js
*
*	A set of functions used to control the html modal window commonly used 
*	by flash panels for resizing etc.
*	
*
*/


var modalHeight = "700px";
var modalWidth = "900px";
var modalAlpha = 0;


function setModalParams(width, height, alpha)
{
	setModalWidth(width);
	setModalHeight(height);
	setModalAlpha(alpha);
	

	$("#flash").css('height',height+"px");
	$("#flash").css('width',width+"px");
	
	//if(width>790) {
		//$(".shoppingToolsContainer").css('position', 'absolute');
		//$(".shoppingToolsContainer").css('top', '12px');
		//$(".shoppingToolsContainer").css('right', '0px');
	//} else {
		//$(".shoppingToolsContainer").css('position', 'relative');
		//$(".shoppingToolsContainer").css('top', '0px');
		//$(".shoppingToolsContainer").css('right', '0px');		
	//}
	
	$("#primary").css('top',(height-320)+"px");

	//$("#footerContainer").css('top',(height-320)+"px");	
}

function setModalAlpha(alpha)
{
	modalAlpha = alpha;
	$(".modal").css('opacity',alpha);
}

function setModalWidth(width)
{
	modalWidth = width;
}	

function setModalHeight(height)
{
	modalHeight = height;
}	

function hideShoppingTools(time)
{
	$(".shoppingToolsContainer").animate({ opacity: 'hide' }, time);
}

function triggerModal()
{
	$(".modal").show();
	$(".modal").css('opacity',0);
	$(".mainContainer").css('z-index',12000);
	
	$(".modal").click(function () {
		var divtag = document.getElementById('panel');
		divtag.closeExpandedPanel();
	});	
	
}

function hideModal()
{
	$(".modal").hide();
	$(".shoppingToolsContainer").animate({ opacity: 'show' }, "slow");
	$(".mainContainer").css('z-index',1);
}