var agt=navigator.userAgent.toLowerCase(); 
var is_ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));

//1k DHTML API
d=document;l5=d.layers;op=navigator.userAgent.indexOf('Opera')!=-1;
function gE(e,f){
	if(l5){
		f=(f)?f:self;
		var V=f.document.layers;
		if(V[e])return V[e];
		for(var W=0;W<V.length;) t=gE(e,V[W++]);
		return t;
	}
	if(d.all)return d.all[e];
	return d.getElementById(e);
}
function sE(e){l5?e.visibility='show':e.style.visibility='visible';}
function hE(e){l5?e.visibility='hide':e.style.visibility='hidden';}
function sZ(e,z){l5?e.zIndex=z:e.style.zIndex=z;}
function sX(e,x){l5?e.left=x:op?e.style.pixelLeft=x:e.style.left=x;}
function sY(e,y){l5?e.top=y:op?e.style.pixelTop=y:e.style.top=y;}
function sW(e,w){l5?e.clip.width=w:op?e.style.pixelWidth=w:e.style.width=w;}
function sH(e,h){l5?e.clip.height=h:op?e.style.pixelHeight=h:e.style.height=h;}
function sC(e,t,r,b,x){l5?(X=e.clip,X.top=t,X.right=r,X.bottom=b,X.left=x):e.style.clip='rect('+t+' '+r+' '+b+' '+x+')';}
function wH(e,h){if(l5){Y=e.document;Y.open();Y.write(h);Y.close();}else if(e.innerHTML)e.innerHTML=h;}

function tVisShow(eN){e=gE(eN);if(e.style.display=='block')e.style.display='none';else e.style.display='block';}

function LaunchImagePageManual(page, width, height) {
	OpenWin = this.open(page, "_blank","toolbar=no,menubar=no,location=yes,scrollbars=yes,resizable=yes, width=" + width + ", height=" + height);
	if (OpenWin) OpenWin.focus();
}

function LaunchWPPhoto(page) {
	LaunchImagePageManual(page, 700, 500);
}

function launchSlide(dir, imgNum) {
	launchSlideManual(dir, imgNum, null, null);
}

function launchSlideManual(dir, imgNum, width, height) {
	var defaultWidth=730;
	var defaultHeight=730;
	
	if (width == null) width = defaultWidth;
	if (height == null) height = defaultHeight;

	openWin = window.open("/output/slide.php?p=" + dir + "&c=" + imgNum, "photo","toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes, width=" + width + ", height=" + height);
	if (openWin) openWin.focus();	
}

function LaunchImagePageManual(page, width, height) {
	OpenWin = this.open(page, "photo","toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes, width=" + width + ", height=" + height);
	if (OpenWin) OpenWin.focus();
}

function LaunchImagePage(page) {
	LaunchImagePageManual(page, 750, 700);
}

function clientSideInclude(id, url) {
  var req = false;
  // For Safari, Firefox, and other non-MS browsers
  if (window.XMLHttpRequest) {
    try {
      req = new XMLHttpRequest();
    } catch (e) {
      req = false;
    }
  } else if (window.ActiveXObject) {
    // For Internet Explorer on Windows
    try {
      req = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        req = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (e) {
        req = false;
      }
    }
  }
 var element = document.getElementById(id);
 if (!element) {
  alert("Bad id " + id +
   "passed to clientSideInclude." +
   "You need a div or span element " +
   "with this id in your page.");
  return;
 }
  if (req) {
    // Synchronous request, wait till we have it all
    req.open('GET', url, false);
    req.send(null);
    element.innerHTML = req.responseText;
  } else {
    element.innerHTML =
   "Sorry, your browser does not support " +
      "XMLHTTPRequest objects.";
  }
}