window.name='main'

function mostrarEnPopup(form,features){
	newwindow=window.open('','Popup',features);
	centerPage(newwindow);
        form=document.forms[0];
	form.target='Popup';
}	

function mostrarEnPopupAnchor(features){
	newwindow=window.open('','Popup',features);
	centerPage(newwindow);
}
								 	
function popitupfromForm(form,winName,h,w)
{
	newwindow=window.open("",winName,'height='+h+',width='+w);
	form.target=winName;
	form.submit();
	centerPage(newwindow);
}

function popitup(action,winName,h,w)
{
	newwindow=window.open(action,winName,'height='+h+',width='+w);
	centerPage(newwindow);
}

function popitup(url,features)
{
	newwindow=window.open(url,'name',features);
	centerPage(newwindow);
}

function popitupCampoModal(url,nombreCampo,h,w)
{
var parameters = new Object();
parameters.nombreCampo=nombreCampo;
parameters.opener = self;

if (window.showModalDialog) {
newwindow=window.showModalDialog(url,parameters,
"dialogWidth:"+w+"px;dialogHeight:"+h+"px");
} else {
newwindow=window.open(url,'popup','height='+h+',width='+w+',toolbar=no,directories=no,status=no,linemenubar=no,scrollbars=no,resizable=no ,modal=yes');
}
}

var NS=document.all;

function centerPage(page)
{
     if(!NS){
     	page.moveTo((page.screen.width - page.outerWidth) / 2, (page.screen.height - page.outerHeight) / 2);
     }
     else{     
     	page.moveTo((page.screen.width-document.body.clientWidth) / 2, (page.screen.height-document.body.clientHeight) / 2);
     }
     page.focus();
}

function centerPage(page)
{
     if(!NS){
     	page.moveTo((page.screen.width - page.outerWidth) / 2, (page.screen.height - page.outerHeight) / 2);
     }
     else{
     	page.moveTo((page.screen.width-document.body.clientWidth) / 2, (page.screen.height-document.body.clientHeight) / 2);
     }
     page.focus();
}



