function ShowMenu(id, idImg)
{
  var itm = null;
  var doShow = true;
	var img = FindObj(idImg);

  if (document.getElementById) {
	itm = document.getElementById(id);
  } else if (document.all){
	itm = document.all[id];
  } else if (document.layers){
	itm = document.layers[id];
  }

  if (!itm) {
   // do nothing
  }
  else if (itm.style) {
    if (doShow && itm.style.display == "none") { itm.style.display = ""; img.src = 'img/menu_on.gif'; }
    else { itm.style.display = "none"; img.src = 'img/menu_off.gif'; }
  }
  else {
    if (doShow && itm.visibility == "show") { itm.visibility = "show"; img.src = 'img/menu_on.gif'; }
    else { itm.visibility = "hide"; img.src = 'img/menu_off.gif'; }
  }
}

function FindObj(n, d)
{ //v4.01
    var p, i, x;
    if (!d) d = document;
    if ((p=n.indexOf("?"))> 0 && parent.frames.length)
    {
        d = parent.frames[n.substring(p+1)].document;
        n = n.substring(0,p);
    }
    if(!(x=d[n])&&d.all) x=d.all[n];
    for (i=0;!x&&i<d.forms.length;i++) x = d.forms[i][n];
    for (i=0;!x&&d.layers&&i<d.layers.length;i++) x = FindObj(n,d.layers[i].document);
    if (!x && d.getElementById) x = d.getElementById(n);
    return x;
}

function Array_push()
{
 var A_p = 0;
 for (A_p = 0; A_p < arguments.length; A_p++)
 {
  this[this.length] = arguments[A_p];
 }
 return this.length;
}

if (typeof Array.prototype.push == "undefined")
{
 Array.prototype.push = Array_push;
}

function doSWF(movie, w, h, trans) {
	document.writeln('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+w+'" height="'+h+'">');
	document.writeln('<param name="allowScriptAccess" value="sameDomain" />');
	document.writeln('<param name="movie" value="'+movie+'">');
	document.writeln('<param name="quality" value="high">');
	document.writeln('<param name="scale" value="exactfit">');
	if (trans) {
		document.writeln('<param name="wmode" value="transparent">');
	}
	document.writeln('<embed src="'+movie+'" quality="high" allowScriptAccess="sameDomain" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" scale="exactfit" ');
	if (trans) {
		document.writeln('wmode="transparent" ');
	}
	document.writeln('width="'+w+'" height="'+h+'"></embed>');
	document.writeln('</object>');
}

function doVideo(IdVideo, autoplay) {
	document.write('<object type="application/x-shockwave-flash" width="352" height="288" ');
	document.write('data="http://vimeo.com/moogaloop.swf?clip_id='+IdVideo);
	if (autoplay) {
		document.write('&amp;autoplay=1');
	}
	document.writeln('&amp;server=vimeo.com&amp;fullscreen=1&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=d6b278">');
	document.writeln('	<param name="quality" value="best" />');
	document.writeln('	<param name="allowfullscreen" value="true" />');
	document.writeln('	<param name="scale" value="showAll" />');
	document.write('	<param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id='+IdVideo);
	if (autoplay) {
		document.write('&amp;autoplay=1');
	}
	document.writeln('&amp;server=vimeo.com&amp;fullscreen=1&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=d6b278" />');
	document.writeln('</object>');
}

function viewpic(url, w, h) {
  vw = w + 2;
  vh = h + 2;
  win = window.open('', '_blank', 'left=0,top=0,width='+vw+',height='+vh+',toolbar=no,location=no,status=no,menubar=no,resizable=no,scrollbars=no');
  win.document.write('<html><head><title>Fundaci&oacute;on Manantiales</title><style>body { background-color: #fff; margin: 0px; padding: 0px; }</style></head>');
  win.document.write('<body><center><a href="javascript:void(0);" onClick="window.close();">');
  win.document.write('<img src="'+url+'" height="'+h+'" width="'+w+'" border="0"></a></center></body></html>');
  win.document.close();
  win.focus();
}

function ShowWindow(myURL, w, h) {
	MyWindow = window.open(myURL, "MyWindow","toolbar=no,directories=no,status=no, scrollbars=no,menubar=no,width="+w+",height="+h);
	MyWindow.window.focus();
}

