/*-----------------------------------------------------------------------------
POWERED BY EXPERTWEB

Inglaterra 1209 y Av Republica, Quito-Ecuador
(593 2) 246-1506, (593 2) 956-3284
www.expertweb.com.ec
info@expertweb.com.ec
-----------------------------------------------------------------------------*/

function getOpenerUrl() {
    var sPath = location.pathname;
    var i = sPath.indexOf ('/:');
    var j = sPath.indexOf ('/', ++i);
    if (i != -1) sPath = sPath.substring (j, sPath.length);
	return escape(location.protocol + '//' + location.host + sPath + location.search);
}

function openWindow(url, title, w, h, x, y, scrollbars, location, directories, status, menubar, toolbar, resizable) {
	var settings='width='+w+',height='+h+',top='+x+',left='+y+',scrollbars='+scrollbars+',location='+location+',directories='+directories+',status='+status+',menubar='+menubar+',toolbar='+toolbar+',resizable='+resizable;
	nWin = open(url, title, settings);
	nWin.focus();
	return nWin;
}

// dialogWidth (cm, mm, in, pt, pc, or px)
// dialogHeight (cm, mm, in, pt, pc, or px)
// dialogLeft (cm, mm, in, pt, pc, or px)
// dialogTop (cm, mm, in, pt, pc, or px)
// center:{ yes | no | 1 | 0 | on | off }
// dialogHide:{ yes | no | 1 | 0 | on | off }
// edge:{ sunken | raised }
// help:{ yes | no | 1 | 0 | on | off }
// resizable:{ yes | no | 1 | 0 | on | off }
// scroll:{ yes | no | 1 | 0 | on | off }
// status:{ yes | no | 1 | 0 | on | off }
function modalDialog(url, args, dialogWidth, dialogHeight, dialogLeft, dialogTop, center, dialogHide, edge, help, resizable, scroll, status) {
	var sFeatures = "";
	if (center != 'yes' && center != '1' && center != 'on')
		sFeatures = "dialogWidth: "+dialogWidth+"px; dialogHeight: "+dialogHeight+"px; dialogLeft:"+dialogLeft+"px; dialogTop: "+dialogTop+"px; center: "+center+"; dialogHide: "+dialogHide+"; edge: "+edge+"; help: "+help+"; resizable: "+resizable+"; scroll: "+scroll+"; status: "+status+";";
	else
		sFeatures = "dialogWidth: "+dialogWidth+"px; dialogHeight: "+dialogHeight+"px; center: "+center+"; dialogHide: "+dialogHide+"; edge: "+edge+"; help: "+help+"; resizable: "+resizable+"; scroll: "+scroll+"; status: "+status+";";
	return window.showModalDialog(url, args, sFeatures);
}

function modelessDialog(url, args, dialogWidth, dialogHeight, dialogLeft, dialogTop, center, dialogHide, edge, help, resizable, scroll, status) {
	var sFeatures = "";
	if (center != 'yes' && center != '1' && center != 'on')
		sFeatures = "dialogWidth: "+dialogWidth+"px; dialogHeight: "+dialogHeight+"px; dialogLeft:"+dialogLeft+"px; dialogTop: "+dialogTop+"px; center: "+center+"; dialogHide: "+dialogHide+"; edge: "+edge+"; help: "+help+"; resizable: "+resizable+"; scroll: "+scroll+"; status: "+status+";";
	else
		sFeatures = "dialogWidth: "+dialogWidth+"px; dialogHeight: "+dialogHeight+"px; center: "+center+"; dialogHide: "+dialogHide+"; edge: "+edge+"; help: "+help+"; resizable: "+resizable+"; scroll: "+scroll+"; status: "+status+";";
	return window.showModelessDialog(url, args, sFeatures);
}

function openCalendar(url, field) {
	return modalDialog(url, field, 270, 235, 0, 0, 'yes', 'no', 'raised', 'no', 'no', 'no', 'no');
}
