var objNav=new clsNav();
var blnDomReady=false;
window.onLoad=jsLoader();

function clsNav() {
	var lstrNav='X';
	var lfltVersion=parseFloat(navigator.appVersion);
	switch(navigator.appName) {
		case 'Netscape':
			lstrNav='N';
			break;
		case 'Microsoft Internet Explorer':
			lstrNav='E';
			if(lfltVersion>=4.0)
				lfltVersion=parseFloat(navigator.appVersion.split(';')[1].replace(/\s+/g,'').slice(4));
	}
	this.strType	=	lstrNav;
	this.strVersion	=	lfltVersion;
	this.strStyleDisplayTableRow	=	( lstrNav=='E' ? 'block' : 'table-row' );
}
function popUp(pstrURL,pstrName,pintWidth,pintHeight,pstrAttr) {
	window.open(pstrURL,pstrName,MakeWindowAttrib(pintWidth,pintHeight,pstrAttr));
}
function MakeWindowAttrib(pintSX, pintSY, pstrAttr) {
	var lstrScrollbars='no', lstrResizable='no', lstrToolbar='no', lstrMenuBar='no';
	pstrAttr=pstrAttr.toUpperCase();
	if(pstrAttr.search(/S1/)>=0)	lstrScrollbars='yes';
	if(pstrAttr.search(/R1/)>=0)	lstrResizable ='yes';
	if(pstrAttr.search(/T1/)>=0)	lstrToolbar   ='yes';
	if(pstrAttr.search(/M1/)>=0)	lstrMenuBar      ='yes';

	var llngX=((window.screen.availWidth - pintSX)/2);
	var llngY=((window.screen.availHeight - pintSY)/2);
	var lstrAttrib;
	lstrAttrib ='left=' + llngX + ', ';
	lstrAttrib+='top=' + llngY + ', ';
	lstrAttrib+='screenx=' + llngX + ', ';
	lstrAttrib+='screeny=' + llngY + ', ';
	lstrAttrib+='menubar='+lstrMenuBar+', toolbar='+lstrToolbar+', scrollbars='+lstrScrollbars+', resizable='+lstrResizable+', width=' + pintSX + ', height=' + pintSY;
	return lstrAttrib;
}
function openSB(pstrCaption, pstrLink, pintWidth, pintHeight) {
	if(blnDomReady)
		Shadowbox.open({
			content:    pstrLink,
			player:     "iframe",
			title:      pstrCaption,
			width:		pintWidth,
			height:		pintHeight
		});
}
function openDocs(pidCategory, pintLanguage) {
	if(pintLanguage==undefined)
		pintLanguage=0;

	if(pintLanguage==0) {
		strCaption	=	'Acceso a Socios';
		strWebCode	=	'IPEH_SPA';
		strLink		=	'';
	} else {
		strCaption	=	'Documents';
		strWebCode	=	'IPEH_ENG';
		strLink		=	'../';
	}
	strLink		+=	strPathApps+'main.php?WebCode='+strWebCode;
//	intWidth	=	800;
//	intHeight	=	400;
//	openSB(strCaption, strLink, intWidth, intHeight);
	popUp(strLink,'EXTRANET',screen.availWidth-100,screen.availHeight-200,'R1S1T1C1');
}
function jsLoader() {
	blnDomReady=true;
}
// ------------------------------------------
function hndShadowboxOpen() {
}
function hndShadowboxClose() {
}
function initShadowbox() {
	Shadowbox.init({
		skipSetup: 		true,
		handleOversize: "resize",
		language:		"es",
		players:		["iframe"],
		onOpen:			hndShadowboxOpen,
		onClose:		hndShadowboxClose
	});
}
initShadowbox();
