//funcion toogle menu
function toggle( targetId ){
  if (document.getElementById){
  		target = document.getElementById( targetId );
  		mnone = document.getElementById( 'none' );
  		mauditoria = document.getElementById( 'auditoria' );
		minstitu = document.getElementById( 'institu' );
  		mnormativa = document.getElementById( 'normativa' );
  		minformes = document.getElementById( 'informes' );
 		mcompras = document.getElementById( 'compras' );
		menlaces = document.getElementById( 'enlaces' );
  			if (targetId == "none"){
  				mauditoria.style.display = "none";
				minstitu.style.display = "none";
				mnormativa.style.display = "none";
  				minformes.style.display = "none";
				mcompras.style.display = "none";
				menlaces.style.display = "none";
  			}
			else if (targetId == "auditoria"){
  				mauditoria.style.display = "inline";
				minstitu.style.display = "none";
				mnormativa.style.display = "none";
  				minformes.style.display = "none";
				mcompras.style.display = "none";
				menlaces.style.display = "none";			
  			}
			else if (targetId == "institu"){
  				mauditoria.style.display = "none";
				minstitu.style.display = "inline";
				mnormativa.style.display = "none";
  				minformes.style.display = "none";
				mcompras.style.display = "none";
				menlaces.style.display = "none";
  			}
			else if (targetId == "normativa"){
  				mauditoria.style.display = "none";
				minstitu.style.display = "none";
				mnormativa.style.display = "inline";
  				minformes.style.display = "none";
				mcompras.style.display = "none";
				menlaces.style.display = "none";
  			}
			else if (targetId == "informes"){
  				mauditoria.style.display = "none";
				minstitu.style.display = "none";
				mnormativa.style.display = "none";
  				minformes.style.display = "inline";
				mcompras.style.display = "none";
				menlaces.style.display = "none";
  			}
			else if (targetId == "compras"){
  				mauditoria.style.display = "none";
				minstitu.style.display = "none";
				mnormativa.style.display = "none";
  				minformes.style.display = "none";
				mcompras.style.display = "inline";
				menlaces.style.display = "none";
  			}
			else if (targetId == "enlaces"){
  				mauditoria.style.display = "none";
				minstitu.style.display = "none";
				mnormativa.style.display = "none";
  				minformes.style.display = "none";
				mcompras.style.display = "none";
				menlaces.style.display = "inline";
  			}									
  	}
}

//funcion toogle iconos
function toggle1( targetId ){
  if (document.getElementById){
  		target = document.getElementById( targetId );
  		mnone = document.getElementById( 'none' );
  		mcontactenos = document.getElementById( 'contactenos' );
  		mimprimir = document.getElementById( 'imprimir' );
 		mmapa = document.getElementById( 'mapa' );
  			if (targetId == "none"){
  				mcontactenos.style.display = "none";
  				mimprimir.style.display = "none";
				mmapa.style.display = "none";
  			}
			else if (targetId == "contactenos"){
  				mcontactenos.style.display = "inline";
  				mimprimir.style.display = "none";
				mmapa.style.display = "none";
  			}
			else if (targetId == "imprimir"){
  				mcontactenos.style.display = "none";
  				mimprimir.style.display = "inline";
				mmapa.style.display = "none";
  			}
			else if (targetId == "mapa"){
  				mcontactenos.style.display = "none";
  				mimprimir.style.display = "none";
				mmapa.style.display = "inline";
  			}								
  	}
}

//fin funcion

// funciones popup:

function popup(nombre,ancho,alto) {
dat = 'width=' + ancho + ',height=' + alto +  ',left=0,top=0,toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0';
window.open(nombre,'',dat)
}

//Funcion fecha
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

dayName = new Array("", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado", "Domingo")
monName = new Array("Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre")
now = new Date
var strDay;
strDay = "<p><strong>" + dayName[now.getDay()] + " " + now.getDate() + " de " + monName[now.getMonth()] + " de " + 	now.getFullYear() + "<\/strong><br \/>Ciudad Autónoma de Buenos Aires<br \/>República Argentina<\/p>"


//////////////////////////////////////////////////////////////////
// qTip - CSS Tool Tips - by Craig Erskine
// http://qrayg.com | http://solardreamstudios.com
//
// Inspired by code from Travis Beckham
// http://www.squidfingers.com | http://www.podlob.com
//////////////////////////////////////////////////////////////////



var qTipTag = "a"; //Which tag do you want to qTip-ize? Keep it lowercase!//
var qTipX = -10; //This is qTip's X offset//
var qTipY = 15; //This is qTip's Y offset//



//There's No need to edit anything below this line//
tooltip = {
  name : "qTip",
  offsetX : qTipX,
  offsetY : qTipY,
  tip : null
}

tooltip.init = function () {
	var tipNameSpaceURI = "http://www.w3.org/1999/xhtml";
	if(!tipContainerID){ var tipContainerID = "qTip";}
	var tipContainer = document.getElementById(tipContainerID);

	if(!tipContainer) {
	  tipContainer = document.createElementNS ? document.createElementNS(tipNameSpaceURI, "div") : document.createElement("div");
		tipContainer.setAttribute("id", tipContainerID);
	  document.getElementsByTagName("body").item(0).appendChild(tipContainer);
	}

	if (!document.getElementById) return;
	this.tip = document.getElementById (this.name);
	if (this.tip) document.onmousemove = function (evt) {tooltip.move (evt)};

	var a, sTitle;
	var anchors = document.getElementsByTagName (qTipTag);

	for (var i = 0; i < anchors.length; i ++) {
		a = anchors[i];
		sTitle = a.getAttribute("title");
		if(sTitle) {
			a.setAttribute("tiptitle", sTitle);
			a.removeAttribute("title");
			a.onmouseover = function() {tooltip.show(this.getAttribute('tiptitle'))};
			a.onmouseout = function() {tooltip.hide()};
		}
	}
}

tooltip.move = function (evt) {
	var x=0, y=0;
	if (document.all) {//IE
		x = (document.documentElement && document.documentElement.scrollLeft) ? document.documentElement.scrollLeft : document.body.scrollLeft;
		y = (document.documentElement && document.documentElement.scrollTop) ? document.documentElement.scrollTop : document.body.scrollTop;
		x += window.event.clientX;
		y += window.event.clientY;
		
	} else {//Good Browsers
		x = evt.pageX;
		y = evt.pageY;
	}
	this.tip.style.left = (x + this.offsetX) + "px";
	this.tip.style.top = (y + this.offsetY) + "px";
}

tooltip.show = function (text) {
	if (!this.tip) return;
	this.tip.innerHTML = text;
	this.tip.style.display = "block";
}

tooltip.hide = function () {
	if (!this.tip) return;
	this.tip.innerHTML = "";
	this.tip.style.display = "none";
}

window.onload = function () {
	tooltip.init ();
}
