//Calls pop up window
//Takes one argument, the url for the pop up window 
//Optional: takes width and height for window
function popWin(url,width,height) 
   { 
	var x = height;
	var y = width;
	
	//Defaults for Window size
	if(x==null)
		{
			x="500"
		}
	if(y==null)
		{
			y="500"
		}
	
   popup=open(url,'LOAD','width=' + x + ',height=' + y + ',toolbar=0,directories=0,menubar=0,status=0,location=0,scrollbars=0,copyhistory=0,resizable=0,left=200,top=50'); 
	
	
	}

//Delays function call of isPopUpThere2()
function isPopUpThere()
	{
	//alert("hey");
	focusWaitID=setTimeout('isPopUpThere2()',"60");
	}

//Gives pop up window focus, if it is present
function isPopUpThere2()
	{
		if(window.popup)
 		{
 		if(!window.popup.closed)
 			{
			window.popup.focus();	
			}
		}
		clearTimeout(focusWaitID);
	}