/* (c) 1998-2009 - InforMás y Jorge Colaccini - Rosario - Argentina
 Todos los Derechos Reservados, sobre los scripts
 propios.
 Estas aplicaciones pueden ser usadas o modificadas,
 pero conservando este texto de creditos.
 El autor no se hace responsable por ningun efecto 
 indeseado debido al uso de estas aplicaciones o de
 derivados de las mismas.
 Las aplicaciones se suministran como estan, y no se
 otorgan garantias explicitas ni implicitas sobre 
 las mismas. 
 All Rights Reserved.
 These applets can be re-used or modified, if credit 
 is given in the source code.
 We will not be held responsible for any unwanted 
 effects due to the usage of this applet or any 
 derivative. No warrantees for usability
 for any specific application are given or implied.
 Jorge Colaccini
 info@informas.com
 js/informas.js Versión: 1.00.0008
 Fecha de Creación: 20-Feb-2009
 Fecha de Ultima Actualización: 30-Jul-2009
*/
function womOn(){
 window.onload = womGo;
}

function womGo(){
 for(var i = 0;i < woms.length;i++)
 eval(woms[i]);
}

function womAdd(func){
 woms[woms.length] = func;
}

var woms = new Array();

function initArray() {
 this.length=initArray.arguments.length;
 for (var i=0;i<this.length;i++) {
 this[i]=initArray.arguments[i];
 }
}
function AgregarAFavoritos(title, url) 
{ 
 if (window.sidebar) 
 { 
 window.sidebar.addPanel(title, url,''); 
 } else if( document.all ) 
 { 
 window.external.AddFavorite( url, title); 
 } else if( window.opera && window.print ) 
 { 
 return true; 
 } else
 {
 alert('Este navegador no permite esta funcionalidad!');
 }
} 

 var Netscape, MSIE, Opera, Unknown;
 var Win, Mac, Other;
 var NetscapeVer, MSIEVer, OperaVer;
 
 Netscape = navigator.appName == 'Netscape';
 MSIE = navigator.appName == 'Microsoft Internet Explorer';
 Opera = navigator.userAgent.indexOf('Opera') > -1;
 Unknown = !(Netscape || MSIE || Opera);
 
 Win = navigator.userAgent.indexOf('Win') > -1;
 Mac = navigator.userAgent.indexOf('Mac') > -1;
 Other = !(Win || Mac);
 
 if(Netscape) {
 NetscapeVer = parseFloat(navigator.appVersion);
 }
 else if(MSIE) {
 n = navigator.userAgent;
 MSIEVer = n.substr(n.indexOf('MSIE ')+('MSIE ').length, 4);
 MSIEVer = parseFloat(MSIEVer); 
 
 if(Opera) {
 OperaVer = n.substr(n.indexOf('Opera ')+('Opera ').length, 4);
 OperaVer = parseFloat(OperaVer);
 }
 }



function EstablecerPaginaInicio(url, ctrl) 
{ 
 if(!Opera && Win && MSIE && MSIEVer >= 5) {
 ctrl.style.behavior='url(#default#homepage)';
 ctrl.setHomePage(url);
 }
 else
 {
 alert('Este navegador no permite esta funcionalidad!');
 }
} 

function getposOffset(what, offsettype)
{
 var totaloffset=(offsettype=="left") ? what.offsetLeft : what.offsetTop;
 var parentEl=what.offsetParent;
 while (parentEl!=null)
 {
 totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
 parentEl=parentEl.offsetParent;
 }
 return totaloffset;
}
function WinDim(b_hight)
{
 if (window.innerHeight != null && !imb_FF)// not IE browser
 {
 return b_hight ? innerHeight : innerWidth;
 }
 else if ( !imb_FF && document.documentElement &&
 ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) //Strict IE6
 {
 return document.documentElement[b_hight ? 'clientHeight' : 'clientWidth'];
 }
 else if ( imb_FF ) // FireFox 2006-03-29
 {
 return document.documentElement[(b_hight) ? 'clientHeight' : 'clientWidth'];
 }
 else
 {
 return document.body[b_hight ? 'clientHeight' : 'clientWidth'];
 }
}

function AjustarAltoConenidoAVentana(iHaRestar)
{
 var alto=0;
 var max=WinDim('height');
 var sector;
 var hheader, hfooter;
 var al = new Array();
 var i=0;
 sector='imheader_container';
 if(document.getElementById(sector))
 {
 hheader=document.getElementById(sector).clientHeight;
 }
 sector='imfooter_container';
 if(document.getElementById(sector))
 {
 hfooter=document.getElementById(sector).clientHeight;
 }
 sector='imcontent';
 if(document.getElementById(sector)) alto=document.getElementById(sector).clientHeight;
 if (alto==0)
 {
 sector='imcontentsb';
 if(document.getElementById(sector)) alto=document.getElementById(sector).clientHeight;
 }
 if (alto==0)
 {
 sector='imcontentsolo';
 if(document.getElementById(sector)) alto=document.getElementById(sector).clientHeight;
 }
 max = max - hheader - hfooter - iHaRestar;
 sectorref='imcontentend';
 i=0;
 altoref=0;
 al[i]=0;
 if(document.getElementById(sectorref)) altoref= getposOffset(document.getElementById(sectorref), "top")
 al[i]=altoref;
 sectorref='imsidebarend';
 i++;
 altoref=0;
 al[i]=0;
 if(document.getElementById(sectorref)) altoref= getposOffset(document.getElementById(sectorref), "top")
 al[i]=altoref;
 sectorref='imsidebar2end';
 i++;
 altoref=0;
 al[i]=0;
 if(document.getElementById(sectorref)) altoref= getposOffset(document.getElementById(sectorref), "top")
 al[i]=altoref;
 altoref=maximo(al);
 altoref = altoref - getposOffset(document.getElementById("immain_container"), "top");
 if (altoref < max)
 document.getElementById(sector).style.height = max + 'px';
 
}
function EqualBlockHeight()
{ var resto=0;
 var al = new Array();
 if (arguments.length>1)
 {
 var max = 0;
 try
 {
 if(document.getElementById)
 {
 for(i=0;i<arguments.length;i++)
 {
 if ( (i==arguments.length-1) && (parseInt(arguments[i]) <0) )
 {
 resto=parseInt(arguments[i]);
 } else
 {
 if(document.getElementById(arguments[i]))
 {
 al[i] = document.getElementById(arguments[i]).clientHeight;
 }
 }
 }
 max = maximo(al);
 if(max > 0)
 {
 max += resto;
 for(i=0;i<arguments.length;i++)
 {
 if(document.getElementById(arguments[i]))
 document.getElementById(arguments[i]).style.height = max + 'px';
 }
 }
 }
 }
 catch (exc) {
 alert("Se ha producido un error en la carga del CSS. La página seguirá operativa pero algo más lenta.");
 throw exc;
 }
 }
}
function maximo(datos)
{ salida = 0;
 for(i=0;i<datos.length;i++){
 if(parseInt(datos[i]) > salida)
 salida = datos[i];
 }
 return salida;
}

function wrap_img2 (s_file, s_title, s_width) 
{ var ret='';
 if (s_title)
 {
 ret = '<div class="nota"><div class="fotozoom" style="width: ' + s_width + ';">'
 + '<img src=' + s_file + '>'
 + '<div class="epigrafoto">' + s_title + '</div></div></div>';
 } else
 {
 ret = '<div class="nota"><div class="fotozoom" style="width: ' + s_width + ';">'
 + '<img src=' + s_file + '>'
 + '</div></div>';
 }
 return ret;
}
//
// BrowserDetect
//
// use:
// * Browser name: BrowserDetect.browser
// * Browser version: BrowserDetect.version
// * OS name: BrowserDetect.OS
//
var BrowserDetect = {
	init: function () {
		this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
		this.version = this.searchVersion(navigator.userAgent)
			|| this.searchVersion(navigator.appVersion)
			|| "an unknown version";
		this.OS = this.searchString(this.dataOS) || "an unknown OS";
	},
	searchString: function (data) {
		for (var i=0;i<data.length;i++)	{
			var dataString = data[i].string;
			var dataProp = data[i].prop;
			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if (dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].identity;
			}
			else if (dataProp)
				return data[i].identity;
		}
	},
	searchVersion: function (dataString) {
		var index = dataString.indexOf(this.versionSearchString);
		if (index == -1) return;
		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
	},
	dataBrowser: [
		{
			string: navigator.userAgent,
			subString: "Chrome",
			identity: "Chrome"
		},
		{ 	string: navigator.userAgent,
			subString: "OmniWeb",
			versionSearch: "OmniWeb/",
			identity: "OmniWeb"
		},
		{
			string: navigator.vendor,
			subString: "Apple",
			identity: "Safari",
			versionSearch: "Version"
		},
		{
			prop: window.opera,
			identity: "Opera"
		},
		{
			string: navigator.vendor,
			subString: "iCab",
			identity: "iCab"
		},
		{
			string: navigator.vendor,
			subString: "KDE",
			identity: "Konqueror"
		},
		{
			string: navigator.userAgent,
			subString: "Firefox",
			identity: "Firefox"
		},
		{
			string: navigator.vendor,
			subString: "Camino",
			identity: "Camino"
		},
		{		// for newer Netscapes (6+)
			string: navigator.userAgent,
			subString: "Netscape",
			identity: "Netscape"
		},
		{
			string: navigator.userAgent,
			subString: "MSIE",
			identity: "Explorer",
			versionSearch: "MSIE"
		},
		{
			string: navigator.userAgent,
			subString: "Gecko",
			identity: "Mozilla",
			versionSearch: "rv"
		},
		{ 		// for older Netscapes (4-)
			string: navigator.userAgent,
			subString: "Mozilla",
			identity: "Netscape",
			versionSearch: "Mozilla"
		}
	],
	dataOS : [
		{
			string: navigator.platform,
			subString: "Win",
			identity: "Windows"
		},
		{
			string: navigator.platform,
			subString: "Mac",
			identity: "Mac"
		},
		{
			 string: navigator.userAgent,
			 subString: "iPhone",
			 identity: "iPhone/iPod"
	 },
		{
			string: navigator.platform,
			subString: "Linux",
			identity: "Linux"
		}
	]
};
BrowserDetect.init();
 var imb_FF = (BrowserDetect.browser == 'Firefox');
 var imb_IE7 = (BrowserDetect.browser == 'Explorer') && (BrowserDetect.version == 7);
 var imb_IE = (BrowserDetect.browser == 'Explorer') && (BrowserDetect.version < 7);
 var imb_FF3 = (BrowserDetect.browser == 'Firefox') && (BrowserDetect.version == 3); 
 
