/*************************************
Generic JavaScript functions for opening popup windows
Created by Lars Henrik Rotnes
Last modified: 2002-10-01
*************************************/

/*
CVS Version : $Id: jsPop.js,v 1.6 2003/02/26 17:37:41 lhr Exp $

*/


/**
*Function to open a pop up window
*
*argUrl   string 	= the location of the file to open in the popup window
*argWidth string 	= the width of the window
*argHeight string = the height of the window
*argTitle string 	= the title of the window
*argScroll int  	= specify if we need scrollbars, 1 = yes, 0 = no 
*/
var is = new Object()
is.ie = (document.all) ? 1:0
is.ns4 = (document.layers) ? 1:0
is.w3c = (document.getElementById && !is.ie) ? 1:0
is.win = (navigator.userAgent.toLowerCase().indexOf("win") > 0) ? 1:0
is.mac = (navigator.userAgent.toLowerCase().indexOf("mac") > 0) ? 1:0

function openPopUp(argUrl, argWidth, argHeight, argTitle, argScroll ) {
  //for win ie, add extra width to accomodate scrollbar on pop07
 // if(is.ie && !is.mac  && argScroll=="1" && ( argTitle == "pop07" || argTitle == "pop08") ){
  //  argWidth = parseInt(argWidth) + 26;
  //}
    
	if(argScroll=="1" && !is.mac){
    argWidth = parseInt(argWidth) + 26;
  }
		if(argScroll=="1" && is.mac){
    argWidth = parseInt(argWidth) + 10;
  }
    
		
  var x = (screen.availWidth - argWidth ) / 2;
  var y = (screen.availHeight - argHeight ) / 2;
  
  var sFeatures = "width=" + argWidth + "," + 
                  "height=" + argHeight + "," + 
									"toolbar=no," + 
                  "status=no," + 
									"scrollbars=" + argScroll + "," + 
									"resizable=no," + 
                  
                  "left=" + x + ", top="+ y;
  
  window.open(argUrl, argTitle, sFeatures, false);
}

