function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

var win = null;

function newWindow(mypage,myname,w,h,features) {
  var winl = (screen.width-w)/2;
  var wint = (screen.height-h)/2;
  if (winl < 0) winl = 0;
  if (wint < 0) wint = 0;
  var settings = 'height=' + h + ',';
  settings += 'width=' + w + ',';
  settings += 'top=' + wint + ',';
  settings += 'left=' + winl + ',';
  settings += features;
  win = window.open(mypage,myname,settings);
  win.window.focus();
}

var min=8;
var max=18;

function increaseFontSize() {

   var p = document.getElementById('artBody').childNodes;
   for(i=0;i<p.length;i++) {
      if(p[i].nodeName == "P" && p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=max) {
         s += 1;
      }
      p[i].style.fontSize = s+"px"
   }
}

function decreaseFontSize() {
   var p = document.getElementById('artBody').childNodes;
   for(i=0;i<p.length;i++) {
      if(p[i].nodeName == "P" && p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=min) {
         s -= 1;
      }
      p[i].style.fontSize = s+"px"
   }   
}

var galEl = null;
var numPh = null;
var visCount = 3;		//Cantidad de fotos visibles
var phWidth = 156;		//Ancho  de la foto
var velInit = 150;		//Velocidad de timeout inicial
var razon = null;

function slide(dire)
{
	if(dire == 1 && galEl.style.marginLeft == '0px') return;
	if(dire == -1 && parseInt(galEl.style.marginLeft) == ((numPh - visCount) * (-phWidth))) return;
	razon = 1;
	softSlide(dire, (parseInt(galEl.style.marginLeft) + (dire * phWidth)), velInit);
}

function softSlide(dire, mod, to)
{
	if(mod == parseInt(galEl.style.marginLeft)) return;
	
	if((dire == -1 && (parseInt(galEl.style.marginLeft) - razon) > mod) ||  
		(dire == 1 && (parseInt(galEl.style.marginLeft) + razon) < mod))
			galEl.style.marginLeft = (parseInt(galEl.style.marginLeft) + (dire * razon)) + 'px';
	else galEl.style.marginLeft = mod + 'px';
	
	razon = parseInt(phWidth/(Math.abs(mod - parseInt(galEl.style.marginLeft))+1)) + razon;
	setTimeout("softSlide(" + dire + ", " + mod + ", " + (parseInt(to * .5) + 1) + ")", to);
}

function initSlide()
{
	galEl = document.getElementById('gal');
	galEl.style.marginLeft = '0px';
	numPh = galEl.getElementsByTagName('td').length;
}


// Copyright 2006-2007 javascript-array.com

var timeout	= 4000;
var closetimer	= 500;
var ddmenuitem	= 0;

// open hidden layer
function mopen(id)
{	
	// cancel close timer
	mcancelclosetime();

	// close old layer
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';

	// get new layer and show it
	ddmenuitem = document.getElementById(id);
	ddmenuitem.style.visibility = 'visible';

}
// close showed layer
function mclose()
{
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
}

// go close timer
function mclosetime()
{
	closetimer = window.setTimeout(mclose, timeout);
}

// cancel close timer
function mcancelclosetime()
{
	if(closetimer)
	{
		window.clearTimeout(closetimer);
		closetimer = null;
	}
}

// close layer when click-out
document.onclick = mclose;


