var wAux;
var winMiniAyuda;

function ClosePopUpIfOpen(pWin) {
	if (pWin) {
		if (typeof pWin != 'undefined') {
			if (!pWin.closed) pWin.close();
		}
	}
}

function CloseWAux() {ClosePopUpIfOpen(wAux);}

function PonClass(p_id, p_class){
	var obj = document.getElementById(p_id);
	if (!obj) {
		obj = document.all(p_id);
	}
	
	obj.className = p_class;
}

function openMiniAyuda(pag)	{
	ClosePopUpIfOpen(winMiniAyuda);

	winMiniAyuda = window.open(pag, "", "left=155,top=100,height=480,width=600");
}

function pupQ(sUrl,wNme){
	CloseWAux();

	var dizq = 0;

	if (screen.availWidth > 758){
		dizq = screen.availWidth-758;
	} else {
		dizq = 0;
	}
	
	var featu = "location = no,left="+ dizq +",resizable=no,top=0,width=750,height=330,titlebar = no,status = no,toolbar = no,scrollbars = no";

	wAux = window.open(sUrl, "", featu);
}

function pupC(sUrl,wNme){
	CloseWAux();

	var dizq = 0;

	if (screen.availWidth > 758){
		dizq = screen.availWidth-758;
	} else {
		dizq = 0;
	}
	
	var featu = "resizable=yes,location=yes,left="+ dizq +",top=0,width=750,height=330,titlebar=yes,status=yes,toolbar=yes,scrollbars=yes";

	wAux = window.open(sUrl, "", featu);
}

function pupR(sUrl,wNme){
	CloseWAux();

	var dizq = 0;

	if (screen.availWidth > 758){
		dizq = screen.availWidth-758;
	} else {
		dizq = 0;
	}
	
	var featu = "resizable=yes,location=no,left="+ dizq +",top=0,width=750,height=330,titlebar=yes,status=yes,toolbar=yes,scrollbars=yes, menubar=yes";

	wAux = window.open(sUrl, "", featu);
}

function pupP(sUrl,wNme){
	CloseWAux();
	
	wAux = window.open(sUrl, "", "");
}

function pupN(sUrl,wNme){
	CloseWAux();

	var dizq;

	if (screen.availWidth > 758){
		dizq = screen.availWidth-758+100;
	} else {
		dizq = screen.availWidth -450+100;
	}

	var featu = "location = no,left="+ dizq +",resizable=no,top=100,width=450,height=200,titlebar = no,status = no,toolbar = no,scrollbars = auto";

	wAux = window.open(sUrl, "", featu);
}

function AjustarTamaFrame(pIdFrame, pMinSize) {
	if (!document) return false;
	if (!document.body) return false;
	if (!document.body.scrollHeight) return false;
	
 	if (!document.body.scrollHeight < pMinSize) {
    window.top.document.getElementById(pIdFrame).height = document.body.scrollHeight;
  } else {
    window.top.document.getElementById(pIdFrame).height = pMinSize;
  }
}


