var theDate = new Date();
var day= theDate.getDay();
var ru ="http://wrsu.rutgers.edu/";
var neww = new Array();
var closeinterval = new Array();
var xct = 0;

//================================================================
function pop(u,n,w,h,x,y,f,kill){
windowFeatures = "width="+w+",height="+h; 
windowFeatures = windowFeatures+",dependent=1,top="+x+",left="+y;
//,toolbar=0,directories=0,status=1,resizable=1,location=0;
if (f) windowFeatures += ","+f;
nw = this.open(u, n, windowFeatures);
if (!nw.opener) (nw).opener=self;
if (nw.focus) nw.focus();
if (kill) {
neww[xct]= nw;
xct = xct+1;}
}
//==================================================================

function poptemp(u,n,w,h,x,y,f,kill,poplength){ 
windowFeatures = "width="+w+",height="+h; 
windowFeatures = windowFeatures+",dependent=1,top="+x+",left="+y;
//,toolbar=0,directories=0,status=1,resizable=1,location=0;
if (f) windowFeatures += ","+f;
nw = this.open(u, n, windowFeatures);
if (!nw.opener) (nw).opener=self;
if (nw.focus) nw.focus();
closeinterval[xct]=window.setInterval("nw.close()",(poplength*1000));
window.clearInterval(nw);
//window.clearInterval(poplength*10000);
if (kill) {
neww[xct]= nw;
xct = xct+1;
	}
}
//=======================================================================
function popdelayclose(url,n,w,h,x,y,f,kill,delay,poplength){
u = url;
n1 = n;
w1 = w;
h1 = h;
x1 = x;
y1 = y;
f1 = f;
kill2 = kill;
poplength2 = poplength;
ti=setTimeout("poptemp(u,n1,w1,h1,x1,y1,f1,kill2,poplength2)",(delay * 1000));
//window.clearInterval(myinterval);
}
//=======================================================================
function popdelay(url,n,w,h,x,y,f,kill,delay){
u = url;
n1 = n;
w1 = w;
h1 = h;
x1 = x;
y1 = y;
f1 = f;
kill2 = kill
ti=setTimeout('pop(u,n1,w1,h1,x1,y1,f1, kill2)',(delay * 1000));
}
//=======================================================================

function closePopWin()

{    // close pop-up window if it is open 
  if (navigator.appName != "Microsoft Internet Explorer"  || parseInt(navigator.appVersion) >=4); //do not close if  early IE
    {
    if(popwin != null) if(!popwin.closed) popwin.close() ;
    
    	for( var i in neww)
	    {
   		 if(neww[i] != null) if(!neww[i].closed) neww[i].close() ;
	    }
    }
}
//============================================================================= 
