// v5.0.1 - 2 feb 2005
// script by 1boy at 1uffakind.com

// build links like this: javascript:pop('urlorpath','windowname',w,h,'controls','scroll','statusbar')
// popwin = function ( myurl, myname, myw, myh, mycontrols, myscroll, mystatus ) {
popwin = function ( myurl, myname, myw, myh, mycontrols, myscroll, mystatus ) {

// set following master properties for all opens from this page or script
   var popresize = "yes";
   var popmenu = "yes";
   var pophistory = "no";
   var popdirectories = "no";

// defaults in case an argument is not passed through link event

   var popurl = "#";
			if ( myurl != null ) {
			   popurl = myurl;
			}
   var popname = "uffapop";
			if ( myname != null ) {
			   popname = myname;
						}
   var popwidth = 360;
			if ( myw != null ) {
			   if ( myw == "screen" ) {
						   popwidth = Math.round(screen.width*.8);
						} else {
			      popwidth = myw;
			   }
						}
	  var popheight = 360;
			if ( myh != null ) {
			   if ( myh == "screen" ) {
						   popheight = Math.round(screen.height*.8);
						} else {
			      popheight = myh;
			   }
						}
   var popcontrols = "no";
			if ( mycontrols != null ) {
			   popcontrols = mycontrols;
						}
			
			var popscroll = "yes";
			if ( myscroll != null ) {
			   popscroll = myscroll;
						}
			
			var popstatus = "no";
			if ( mystatus != null ) {
			   popstatus = mystatus;
			   }
						
			var specs = 'width=' + popwidth + ',height=' + popheight + ',scrollbars=' + popscroll + ',resizable=' + popresize + ',toolbar=' + popcontrols + ',location=' + popcontrols + ',personalbar=' + popcontrols +  ',locationbar=' + popcontrols + ',statusbar=' + popstatus + ',status=' + popstatus + ',history=' + pophistory + ',directories=' + popdirectories  + ',menubar=' + popmenu;

   // var popped = window.open( popurl, popname, specs );

   var poppedwin = window.open( popurl, popname, specs );

   poppedwin.focus();
			// top.window[popname].focus();
   // popped.focus();

}
