/******************************************************************************
POPUP WINDOW functions
-----------------------

The software and related user documentation are protected under
copyright laws and remain the sole property of WIT, Inc.
*******************************************************************************/
<!--
/*********************************************************
Name  : 
Descr : 
Input : 
Output: 
Usage : 
*********************************************************/
function get_client_width()
{
	var width = 0;
	var ifclause = 0;
	if( document.documentElement && document.documentElement.clientWidth ) {
		width = document.documentElement.clientWidth;
		ifclause = 1;
	}
	else if( parent.document.body && parent.document.body.clientWidth ) {
		width = parent.document.body.clientWidth;
		ifclause = 2;
	}
	else if( document.body && document.body.clientWidth ) {
		width = document.body.clientWidth;
		ifclause = 3;
	}
	else if( window.innerWidth ) {
		width = window.innerWidth - 18;
		ifclause = 4;
	}
	//alert('ifclause: '+ifclause+' width: '+width);
	return width;
}//get_client_width()

/*********************************************************
Name  : 
Descr : 
Input : 
Output: 
Usage : 
*********************************************************/
function get_client_height()
{
	var height = 0;
	var ifclause = 0;
	if( document.documentElement && document.documentElement.clientHeight ) {
		height = document.documentElement.clientHeight;
		ifclause = 1;
	}
	else if( parent.document.body && parent.document.body.clientHeight ) {
		height = parent.document.body.clientHeight;
		ifclause = 2;
	}
	else if( document.body && document.body.clientHeight ) {
		height = document.body.clientHeight;
		ifclause = 3;
	}
	else if( window.innerHeight ) {
		height = window.innerHeight - 18;
		ifclause = 4;
	}
	//alert('ifclause: '+ifclause+' height: '+height);
	return height;
}//get_client_height

/*********************************************************
Name  : 
Descr : 
Input : 
Output: 
Usage : 
*********************************************************/
var popUpWin=0;
function popup_window(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
  popUpWin.focus();
}//popup_window

/*********************************************************
Name  : 
Descr : 
Input : 
Output: 
Usage : 
*********************************************************/
var popUpWinWH=0;
function popup_window_wh(URLStr, w, h)
{
	if(popUpWinWH)
	{
		if(!popUpWinWH.closed) popUpWinWH.close();
	}
	var xsize = w;
	var ysize = h;
	var DocumentWidth = parseInt(get_client_width());
	var DocumentHeight = parseInt(get_client_height());
	var xpos = (DocumentWidth/2)-(xsize/2);
	var ypos = (DocumentHeight/2)-(ysize/2);
	//alert('xpos: '+xpos+' ypos: '+ypos);
	
	popUpWinWH = open(URLStr, 'popUpWinWH', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes, width='+xsize+',height='+ysize+',left='+xpos+',top='+ypos);
	if (popUpWinWH.opener == null)
		popUpWinWH.opener = self;
	popUpWinWH.focus();
	return false; //added this line just to fix some error in citrin proj - zahidsir@yahoo.com - 2005-01-11
}//popup_window_wh

/*********************************************************
Name  : 
Descr : 
Input : 
Output: 
Usage : 
*********************************************************/
var popUpWinWHScroll=0;
// Note: function name should be different than the variable name
function popup_window_wh_scroll(URLStr, w, h)
{
	if(popUpWinWHScroll)
	{
		if(!popUpWinWHScroll.closed) popUpWinWHScroll.close();
	}
	var xsize = w;
	var ysize = h;
	var DocumentWidth = parseInt(get_client_width());
	var DocumentHeight = parseInt(get_client_height());
	var xpos = (DocumentWidth/2)-(xsize/2);
	var ypos = (DocumentHeight/2)-(ysize/2);
	//alert('xpos: '+xpos+' ypos: '+ypos);
	
	popUpWinWHScroll = open(URLStr, 'popUpWinWHScroll', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes, width='+xsize+',height='+ysize+',left='+xpos+',top='+ypos);
	if (popUpWinWHScroll.opener == null)
		popUpWinWHScroll.opener = self;
	popUpWinWHScroll.focus();

	return false; //added this line just to fix some error in citrin proj - zahidsir@yahoo.com - 2005-01-11
}//popup_window_wh_scroll()



var popUpWinWHScroll2=0;
function popup_window_wh_scroll2(URLStr, w, h)
{
	if(popUpWinWHScroll2)
	{
		if(!popUpWinWHScroll2.closed) popUpWinWHScroll2.close();
	}
	var xsize = w;
	var ysize = h;
	var DocumentWidth = parseInt(get_client_width());
	var DocumentHeight = parseInt(get_client_height());
	var xpos = (DocumentWidth/2)-(xsize/2);
	var ypos = (DocumentHeight/2)-(ysize/2);
	popUpWinWHScroll2 = open(URLStr, 'popUpWinWHScroll2', 'toolbar=yes,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=yes, width='+xsize+',height='+ysize+',left='+xpos+',top='+ypos);
	if (popUpWinWHScroll2.opener == null)
		popUpWinWHScroll2.opener = self;
	popUpWinWHScroll2.focus();

	return false;
}

//-->
