<!--

/* 
    flexwindow.js
    maydaySM

    Created by Hendrik  on Wed Jan 07 2004.
    Copyright (c) 2004 granus.net. All rights reserved.
    
    $Id: flexwindow.js,v 1.2 2004/08/22 21:08:38 hendrik Exp $
*/

	function openFlexWindow (url, name, features, myWidth, myHeight, isCenter) {
		
		if (name == '') {
			var now	=	new Date ();
			var ms	=	now.getMilliseconds ();
			name	=	'flexwindow'	+	ms;
		}
		
		if ( (myWidth == '') || (myWidth == 0) ) {
			myWidth		=	500;
		}
		
		if ( (myHeight == '') || (myHeight == 0) ) {
			myHeight	=	500;
		}
				
		if ( (features == "none") || (features == '') ) {
			features = "toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=no";
		} else {	
			switch (features) {
				case "all":
					features = "toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes";
					break;
				case "commentbox":
					features = "toolbar=no,location=yes,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=no";
					break;
			}
			
		}
		
		if ( (window.screen) && (isCenter != "false") ){
			var myLeft	=	(screen.width - myWidth) / 2;
			var myTop	=	( (screen.height - myHeight) / 2) - 20;
			features	+=	(features != '') ? ',' : '';
			features	+=	',left=' + myLeft + ',top=' + myTop;
  		}
			
  		window.open (url, name, features + ((features != '') ? ',' : '') + 'width=' + myWidth + ',height=' + myHeight).focus();
	}
	
	function flexWindow_PhoneNumber () {
		openFlexWindow ('popup.phonenumber.htm','phone','none',530,330,'true');
	}
	
	function openCommentBox (url) {
		openFlexWindow (url,'maydaySMComments','commentbox',460,600,'true');
	}
// -->