// POPUP WINDOW
function popUpWindow(pageWidth,pageHeight,pageUrl,windowName)
{	
	w = screen.width;
	h = screen.height;
	
	var popW = parseInt(pageWidth) + 18;
	var popH = parseInt(pageHeight) + 18;
	
	var leftPos = (w - popW)/2;
	var topPos = (h - popH)/2;
	
	window.open(pageUrl,windowName,'width=' + popW + ',height=' + popH + ',top=' + topPos + ',left=' + leftPos);	
}

function popUpWindowCustom(pageWidth,pageHeight,pageUrl,windowName,windowAttributes)
{	
	w = screen.width;
	h = screen.height;
	
	var popW = parseInt(pageWidth) + 18;
	var popH = parseInt(pageHeight) + 18;
	
	var leftPos = (w - popW)/2;
	var topPos = (h - popH)/2;
	
	window.open(pageUrl,windowName,'width=' + popW + ',height=' + popH + ',top=' + topPos + ',left=' + leftPos + ',' + windowAttributes);	
}

function closeOpenerWindow()
{
	if(false == opener.closed)
	{
		opener.close ();
	}
		else
	{
		alert('Info CaptureWindow already closed!');
	}
}

function maxWindow()
{
	window.moveTo(0,0);	
	
	if (document.all)
	{
		top.window.resizeTo(screen.availWidth,screen.availHeight);
	}
	
	else if (document.layers||document.getElementById)
	{
		if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth)
		{
			top.window.outerHeight = screen.availHeight;
			top.window.outerWidth = screen.availWidth;
		}
	}
}

function iframeHeightAdjust(iframeContentHeight)
{
	//Set i-frame height
	document.getElementById('content').style.height = iframeContentHeight + "px";
	
	//Set menu cell height
	var menuHeight = iframeContentHeight - 100;
	document.getElementById('menu_cell').style.height = menuHeight + "px";
}

function videoPreview(videoWidth,videoHeight,video_url,windowName)
{	
	w = screen.width;
	h = screen.height;
	
	var popW = parseInt(videoWidth) + 18;
	var popH = parseInt(videoHeight) + 18;
	
	var leftPos = (w - popW)/2;
	var topPos = (h - popH)/2;
	
	window.open(video_url,windowName,'width=' + popW + ',height=' + popH + ',top=' + topPos + ',left=' + leftPos);	
}
