/*
© All rights reserved
Madmedia Communication
geneau@videotron.ca
*/

//------------------------------------------------------------------
	function cPopUpWindow()
	{
		this.pPopName = null;
		this.mOpen = fOpen;
		this.mFullScreen = fFullScreen;
		this.mCentered = fCentered;
		this.mPosition = fPosition;
	}
//------------------------------------------------------------------
	function fOpen(sURL, sName, sWidth, sHeight, sScrollBars, sStatusBar)
	{
		BrowserDetect.init();
		var patchExplorer1024 = "";
		if (sWidth > screen.width){
			sWidth = screen.width - 50;
		}
		if (sHeight > screen.height){
			sHeight = screen.height - 150;
		}
		if(BrowserDetect.browser == "Explorer" && screen.width == 1024 && BrowserDetect.version >= 7)	patchExplorer1024 = ",fullscreen=1";
		this.pPopName = open(sURL, sName, "width=" + sWidth + ",height=" + sHeight + ",scrollbars=" + sScrollBars + ",status=" + sStatusBar + patchExplorer1024);
	}
//------------------------------------------------------------------
	 function fFullScreen(sURL, sName, sScrollBars, sStatusBar)
	 {
	 	this.mOpen(sURL, sName, screen.width, screen.height, sScrollBars, sStatusBar);
		this.pPopName.moveTo(10, 5);
	 }
//------------------------------------------------------------------ 
	 function fCentered(sURL, sName, sWidth, sHeight, sScrollBars, sStatusBar)
	 {
		if (sWidth > screen.width){
			sWidth = screen.width - 50;
		}
		if (sHeight > screen.height){
			sHeight = screen.height - 150;
		}
	 	var tPosX = (screen.width - parseInt(sWidth)) / 2;
		var tPosY = (screen.height - parseInt(sHeight)) / 2 - 30;
		this.mPosition(sURL, sName, sWidth, sHeight, sScrollBars, tPosX, tPosY, sStatusBar);
	 }
//------------------------------------------------------------------	 
	 function fPosition(sURL, sName, sWidth, sHeight, sScrollBars, iPosX, iPosY, sStatusBar)
	 {
	 	this.mOpen(sURL, sName, sWidth, sHeight, sScrollBars, sStatusBar);
		this.pPopName.moveTo(iPosX, iPosY);
	 }
//------------------------------------------------------------------

var oPopUpWindow = new cPopUpWindow();