	function openwin(page,target)
	{
		opennewwin(page,target,0);
	}

	function opennewwin(page,target,type)
	{	
		// Default
		var width=950;
		var height=700;
		var menubar="no";
		var moreconfig;
		var dosetfocus=true;
		var toolbar="no";
	
		switch (type)
		{
			case 1: // Small
			{
				height=250;
				width=550;
				break;
			}
			case 2: // Chat	  // ahora full screen
			{
				height=window.screen.availHeight-27;
				width=window.screen.availWidth-10;
				break;
			}
			case 3: // Repository search
			{
				height=600;
				width=560;
				break;
			}			
			case 4: // Maximized
			{
				height=window.screen.availHeight-27;
				width=window.screen.availWidth-10;
				break;
			}
			case 5: // Medium
			{
				height=400;
				width=550;
				break;
			}
			case 6: // Repository doc
			{
				width=950;
				height=700;
				dosetfocus=false;
				break;
			}
			case 7: // Map
			{
				width=640;
				height=480;
				toolbar="yes";
				menubar="yes";
				break;
			}
			case 8: //Map preview
			{
				width=250;
				height=350;
				toolbar="no";
				menubar="no";
				break;
			}


		}
		var config='height='+height+',width='+width+',toolbar='+toolbar+',menubar='+menubar+',scrollbars=yes,resizable=yes,location=no,directories=no,status=no,top=0,left=0';
		if (moreconfig) config+=','+moreconfig;

		winhandler=window.open(page,target,config);
		if (dosetfocus && winhandler) {
			winhandler.focus();
			winhandler.moveTo(0,0);
			winhandler.opener=self;
		}
	}


  
