var window1 = null;

function openWindow(contentURL,windowName,windowWidth,windowHeight,leftPos,rightPos,scroll) 
{

	if (scroll == null)
		{	
		sizePos = 'height=' + windowHeight + ',width=' + windowWidth 
			+ ',left=' + leftPos + ',top=' + rightPos;	
		window1 = window.open(contentURL,windowName,sizePos);		
		window1.focus()
		}
	else 
		{
		sizePos = 'height=' + windowHeight + ',width=' + windowWidth 
			+ ',left=' + leftPos + ',top=' + rightPos
			+ ',scrollbars=' + scroll;	
		window1 = window.open(contentURL,windowName,sizePos);		
		window1.focus()
		}
		
}

function closeWindow() 
{
	if (window1 != null)  
		{	
	 	window1.close();
	 	window1 = null;
		}
	}

function toggleWindow(contentURL,windowName,windowWidth,windowHeight) 
	{
	if (window1 == null) 
		{
			sizePos = 'HEIGHT=' + windowHeight + ',WIDTH=' + windowWidth
				+ ',left=' + leftPos + ',top=' + rightPos;
			window1 = window.open(contentURL,windowName,sizePos);
			window1.focus()
		}
	else 
		{	
	 		window1.close();
	 		window1 = null
		}
}




// This function sees if the contents frame is alive.

function find(frame) {
    for (var i=0; i<parent.frames.length; i++) {
         if (parent.frames[i].name == frame)
             return true;
    }
    return false;
}

	




