/*	
1 toolbar=0|1 	Specifies whether to display the toolbar in the new window.
2 location=0|1 	Specifies whether to display the address line in the new window.
4 directories=0|1 	Specifies whether to display the Netscape directory buttons.
8 status=0|1 	Specifies whether to display the browser status bar.
16 menubar=0|1 	Specifies whether to display the browser menu bar.
32 scrollbars=0|1 	Specifies whether the new window should have scrollbars.
64 resizable=0|1 	Specifies whether the new window is resizable.
*/

function imageWindowOpen(url, width, height){
	//backward compatibility
	urlWindowOpen(url,width,height);
}

function urlWindowOpen(url, width, height){
	if (url.indexOf('http://') == -1)
		url = getBase() + url;
	
	var posX;
	var posY;
	var margenW = 100;
	var margenH = 50;

	var windowConf = 64 + 8;
	if (width > (screen.width - margenW)){
		width = (screen.width - margenW);
		windowConf = 64 + 32;
	}
	if (height > (screen.height - margenH)){
		height = (screen.height - margenH);
		windowConf = 64 + 32;
	}
    scW = screen.availWidth ? screen.availWidth : screen.width;
    scH = screen.availHeight ? screen.availHeight : screen.height;
	posX = Math.floor((scW - 10 - width) / 2);
	posY = Math.floor((scH - margenH - height) / 2);
	Window.open(url, width, height, posX, posY, windowConf, 'window1', false);
}

function urlWindowOpen2(url, width, height){
	if (url.indexOf('http://') == -1)
		url = getBase() + url;
	
	var posX;
	var posY;
	var margenW = 100;
	var margenH = 50;

	var windowConf = 64 + 32;
    scW = screen.availWidth ? screen.availWidth : screen.width;
    scH = screen.availHeight ? screen.availHeight : screen.height;
	posX = Math.floor((scW - 10 - width) / 2);
	posY = Math.floor((scH - margenH - height) / 2);
	Window.open(url, width, height, posX, posY, windowConf, 'window1', false);
}


function getBase()
{
      var baseTag = document.getElementsByTagName("base");
      if (baseTag.length > 0)
      	return baseTag[0].href;
      else
		return null;
}

function trocaMes(obj) {		
	window.location = getBase()+'informativo/public/'+obj.value;
}
