function popClientLogin() {
	popupWin=window.open("control/login.asp","ClientLogin","scrollbars=no,dependent,titlebar=no,alwaysontop=yes,width=300,height=275,left=20,top=20")
	}
function demos(theurl) {
		window.open(theurl, 'demo', 'width=400,height=275');
		self.location.replace(self.location);
}

	function popupWindow(win,winWidth,winHeight,place,winName){
	leftPos = 0; topPos = 0; // default variables for old browsers
		if (screen){ 
		   // checks specified parameters are not outside screen area
		   
    		if (winWidth>screen.width){
    		   winWidth = screen.width;
    		}
    		
    		if (winHeight>screen.height){
    		   winHeight = screen.height - 55;
    		}
    		
    		if (winWidth <= 0){
    		   winWidth = screen.width;
    		}
    		
    		if (winHeight <= 0){
    		   winHeight = screen.height - 55;
    		}
    		
			// positions window by checking place parameter
					
			if (place == 'topleft'){ // positions window in top left corner
			leftPos = 0;
			topPos = 0;
			}
			
			if (place == 'centre'){ // centres window
			leftPos = screen.width/2 - winWidth/2;
			topPos = screen.height/2 - winHeight/2;
			}
			
			if (place == 'topright'){ // positions window in top right corner
			leftPos = screen.width - winWidth;
			topPos = 0;
			}
			
			if (place == 'botleft'){ // positions window in bottom left corner
			leftPos = 0;
			topPos = screen.height - (winHeight + 55); // add 55 to prevent bottom of window being obscured by taskbar
			}
			
			if (place == 'botright'){ // positions window in bottom right corner
			leftPos = screen.width - winWidth;
			topPos = screen.height - (winHeight+55); // add 55 to prevent bottom of window being obscured by taskbar
			}
					
		}
		newWindow = window.open(win,winName,'toolbar=no,location=no,scrollbars=auto,resizable=yes,width='+winWidth+',height='+winHeight+',left='+leftPos+',top='+topPos+'');
		newWindow.focus();
	}
