//<script type="text/javascript" language="javascript" src="scripts/winPopUp.js"></script>

//alert("JavaScript Initialized");


var subWin1=null;
var subWin2=null;
var subWin3=null;
var subWin4=null;

//Whatever other windows
function winPopUp1(URL,popwidth,popheight)
	{
	var ScreenWidth=window.screen.width;
	var ScreenHeight=window.screen.height;
	if (ScreenHeight < 650 && popheight > 450)
		{
		popheight = 425;
		}
	placementx=(ScreenWidth/2)-((popwidth)/2);
	placementy= (ScreenHeight - popheight)/2 - (ScreenHeight - popheight)/4;
	if (subWin1 && !subWin1.close())
		{
		subWin1.close();		
		}
	subWin1 = window.open(URL,"win1","width="+popwidth+",height="+popheight+",toolbar=1,location=0,directories=0,status=1,scrollbars=1,menubar=1,resizable=1,left="+placementx+",top="+placementy+",screenX="+placementx+",screenY="+placementy+",");
	subWin1.focus();
	}

//Services windows exCept last one
function winPopUp2(URL,popwidth,popheight)
	{
	var ScreenWidth=window.screen.width;
	var ScreenHeight=window.screen.height;
	if (ScreenHeight < 650 && popheight > 450)
		{
		popheight = 425;
		}
	placementx=(ScreenWidth/2)-((popwidth)/2);
	placementy= (ScreenHeight - popheight)/2 - (ScreenHeight - popheight)/4;
	// placementy=(ScreenHeight/2)-((popheight+50)/2);
	if (subWin2 && !subWin2.close())
		{
		subWin2.close();		
		}
	subWin2 = window.open(URL,"win2","width="+popwidth+",height="+popheight+",toolbar=1,location=0,directories=0,status=1,scrollbars=1,menubar=1,resizable=1,left="+placementx+",top="+placementy+",screenX="+placementx+",screenY="+placementy+",");
	subWin2.focus();
	}

//Tools windows
function winPopUp3(URL,popwidth,popheight)
	{
	var ScreenWidth=window.screen.width;
	var ScreenHeight=window.screen.height;
	if (ScreenHeight < 650 && popheight > 450)
		{
		popheight = 425;
		}
	placementx=(ScreenWidth/2)-((popwidth)/2);
	placementy=0;
	if (subWin3 && !subWin3.close())
		{
		subWin3.close();		
		}
	subWin3 = window.open(URL,"win3","width="+popwidth+",height="+popheight+",toolbar=0,location=0,directories=0,status=1,scrollbars=1,menubar=1,resizable=1,left="+placementx+",top="+placementy+",screenX="+placementx+",screenY="+placementy+",");
	subWin3.focus();
	}
//Register 
function winPopUp4(URL,popwidth,popheight)
	{
	var ScreenWidth=window.screen.width;
	var ScreenHeight=window.screen.height;
	if (ScreenHeight < 650 && popheight > 450)
		{
		popheight = 425;
		}
	placementx=(ScreenWidth/2)-((popwidth)/2);
	placementy=0;
	if (subWin4 && !subWin4.close())
		{
		subWin4.close();		
		}
	subWin4 = window.open(URL,"win4","width="+popwidth+",height="+popheight+",toolbar=1,location=0,directories=0,status=1,scrollbars=1,menubar=1,resizable=1,left="+placementx+",top="+placementy+",screenX="+placementx+",screenY="+placementy+",");
	subWin4.focus();
	}


function UnpopUp(){
if(subWin !=null&&subWin.open)subWin.close();
}
