function openpopup(popurl, w, h, sizable) {
  // w and h for window size
  // 
   var w_t = w;
   var h_t = h;
   var s_t = sizable;

     if (w==0) {w_t=400; s_t = true}
     else if (w_t>screen.width) { w_t =screen.width; s_t=true} 
//alert("screen_w="+screen.width);  

     if (h==0) {h_t=300; s_t = true}
     else if (h_t>screen.height) { h_t=screen.height; s_t=true }


	str = 'width='+w_t+',height='+h_t;
	if ( s_t != true ) {
		str = str + ',scrollbars=no,resizable=no,status=no';
	} else {
		str = str + ',scrollbars=yes,resizable=yes,status=yes';
	}
	window.open(popurl,'',str);
}

/*
window.onload=function() 
{ 
	status=document.title; 
	defaultStatus=status; 
	for (iForm=0; iForm<document.forms.length; iForm++) 
	{ 
		for (iField=0; iField<document.forms[iForm].length; iField++) 
		{ 
			if (((document.forms[iForm].elements[iField].type=='text') || 
				(document.forms[iForm].elements[iField].type=='textarea')) && 
				(!document.forms[iForm].elements[iField].disabled) && 
				(!document.forms[iForm].elements[iField].readOnly)) 
			{ 
				document.forms[iForm].elements[iField].focus(); 
				return; 
			} 
		} 
	} 
} 
*/

