function ow(wname)
{
	if ( wname == window.name)
	   return true ;

	var width = 600 ;
	var height = 400 ;
	var x = 0;
	var y= 0 ;

	var menubar = "yes" ;
	var toolbar = "yes" ;
	var status = "yes" ;

	/*
			menubar = "no" ;
			toolbar = "yes" ;
			status  = "no" ;
	*/
	switch (wname) {
	   case "a_out" :
	   	width = 400;
	   	height = 450;
	   	x = screen.availWidth - width ;
			y = screen.availHeight - height;
	   	toolbar = "no" ;
	   	status = "no" ;
	      break;
	   case "a_ap" :
	   	width = screen.availWidth - 200 ;
	   	height = screen.availHeight - 100;
	   	x = 200 ;
			y = 100;
	   	toolbar = "no" ;
	   	status = "no" ;
	      break;
	   case "a_sim" :
	   	width = screen.availWidth - 200 ;
	   	height = screen.availHeight;
	   	x = 200 ;
			y = 0;
	   	toolbar = "no" ;
	   	status = "no" ;
	      break;
	   case "rolia_forum_contents" :
	   case "rfc" :
	   	width = 500 ;
	   	height = 600;
	   	x = (screen.availWidth - width) * 0.75 ;
			y = (screen.availHeight - height) / 4 ;
	   	toolbar = "no" ;
	   	status = "no" ;
	      break;
		case "rolia_forum" :
			toolbar = "yes" ;
			menubar = "yes" ;
			width = screen.availWidth ;
			height = screen.availHeight - 100 ;
			break ;
		case "rolia_mem" :
			toolbar = "yes" ;
			menubar = "yes" ;
			width = 650 ;
			height = 500 ;
			break ;
		case "rolia" :
			toolbar = "yes" ;
			menubar = "yes" ;
			width = screen.availWidth - 50 ;
			height = screen.availHeight - 50 ;
			x = (screen.availWidth - width) / 2 ;
			y = 0 ;
			break ;
		case "rolia_blog" :
			toolbar = "yes" ;
			menubar = "yes" ;
			width = screen.availWidth - 50 ;
			height = screen.availHeight - 50 ;
			x = (screen.availWidth - width);
			y = 0 ;
			break ;
		case "rolia_quiz_popup" :
		case "rolia_vote_popup" :
			menubar = "yes" ;
			status = "no" ;
			width = 350 ;
			height = 350 ;
			x = (screen.availWidth - width) / 2 ;
			y = (screen.availHeight - height) /4 ;
			break ;
		case "net_rolia_thread" :
			menubar = "yes" ;
			width = 780 ;
			height = screen.availHeight - 100 ;
			x = (screen.availWidth - width);
			y = 0 ;
			break ;
		case "rolia_ow_article" :
			status  = "no" ;
			width = 600 ;
			height = screen.availHeight - 100 ;
			x = screen.availWidth - width ;
			break ;
		case "rolia_faq" :
			width = screen.availWidth ;
			height = screen.availHeight - 100 ;
			break ;
		case "rolia_forum_thread" :
			toolbar = "no" ;
			menubar = "no" ;
			width = screen.availWidth - 200;
			height = screen.availHeight - 120 ;
			x = screen.availWidth - width ;
			y = 20 ;
			break ;
		case "purifier" :
		case "rolia_forum_hot" :
		case "rfh" :
			toolbar = "no" ;
			menubar = "no" ;
			width = screen.availWidth - 150;
			height = screen.availHeight - 150 ;
			x = (screen.availWidth - width) / 2 ;
			break ;
	   case "rolia_forum_post" :
	   case "post" :
	   	x = 0 ;
	   	y = 0 ;
	   	height = screen.availHeight - 100 ;
	   	status = "no" ;
	      break;
	   case "rolia_forum_reply" :
	   case "rfr" :
	   	x = 50 ;
	   	y = 0 ;
	   	width = 640;
	   	height = 660;
	   	//height = screen.availHeight - 100 ;
	   	status = "no" ;
	      break;
	   case "rolia_forum_search" :
	   case "search" :
	   	width=screen.availWidth - 150 ;
	      break;
	   case "rmd" :
	   	status = "no" ;
	      break;
	   case "rolia_help" :
	   case "searchhelp" :
			status = "no" ;
			menubar = "no" ;
			width = 700 ;
			height = screen.availHeight - 200 ;
			x = screen.availWidth - width - 50 ;
			break ;
	   default :
	}

	var win = window.open(	"",
									wname,
									"toolbar=" + toolbar
										+ ",status=" + status
										+ ",menubar=" + menubar
										+ ",width=" + width
										+ ",height=" + height
										+ ",screenX=" + x
										+ ",screenY=" + y
										+ ",location=yes,directories=no,scrollbars=yes,resizable=yes");
	win.moveTo(x,y) ;
	win.resizeTo(width, height);
	win.focus();
   win.document.open();
   win.document.write("<title>Loading ...</title><p>Loading ...");
   win.document.close() ;
   return true ;
}

function validateNatural( str )
{
  var regExpString = "/" +
                     "([0-9]*)" +
                     "/";
  if ( null == str ||
       0    >= str.length ||
       true == isNaN(str) ||
       null      == str.match( eval(regExpString) ) ||
       str != str.match( eval(regExpString) )[0] )
  {
    return false;
  } else {
    return true;
  }
}

function validateString( str, min, max )
{
	str = (str == null) ? "" : str ;
	var len = str.length ;
	if (max != 0 && len > max )
		return false ;
	if (min != 0 && len < min )
		return false ;
	return true ;
}

function oow(wname)
{
	/*
	var width = 600 ;
	var height = 400 ;
										+ ",width=" + width
										+ ",height=" + height
*/
	var menubar = "yes" ;
	var toolbar = "yes" ;
	var status = "yes" ;

	var win = window.open(	"",
									wname,
									"toolbar=" + toolbar
										+ ",status=" + status
										+ ",menubar=" + menubar
										+ ",location=yes,directories=no,scrollbars=yes,resizable=yes");
	win.focus();
   win.document.open();
   win.document.write("<title>Loading ...</title><p>Loading ...");
   win.document.close() ;
   return true ;
}
