
// --- photo popup on MouseOver ---
var mouseX=0, mouseY=0
if(document.addEventListener) { //W3C event-handler
//	alert("W3C event-handler");
	document.addEventListener('mousemove',StoreMousePosition,false);
}
if(document.attachEvent) { //Microsoft event-handler
//	alert("Microsoft event-handler");
	document.attachEvent('onmousemove',StoreMousePosition);
}
function StoreMousePosition(e) {
	if (!e) var e = window.event;
	if(navigator.appName=="Netscape"){
		mouseX =	e.pageX;
		mouseY = e.pageY;
	} else {
		mouseX = e.screenX-window.screenLeft+5;
		mouseY = e.screenY-window.screenTop+5;
	}
}

var ssImageDuration;
var ssFadeDuration  = 2;
var sst;
var ssj = 0;
var ssp = 0;
var sspreLoad = new Array();
var allCached = false;
var firstTime = false;

function runSlideShow(){
  if ( ssp>0 ) {
    if (firstTime==false){
      sst = setTimeout('runSlideShow()', 1000);
      firstTime = true;
      ImageDuration = 4000;
    } else {
      if (document.all){
//  alert();
        document.images.SlideShow.style.filter="blendTrans(duration=FadeDuration)";
        document.images.SlideShow.filters.blendTrans.Apply();
      }
      document.images.SlideShow.src = sspreLoad[ssj].src;
      if (document.all){
        document.images.SlideShow.filters.blendTrans.Play();
      }
      ssj = ssj + 1;
      if (ssj > (ssp-1)) {
        ssj=0;
        allCached = true;
      }
      if (allCached==false) {
        sspreLoad[ssj].src = Pic[ssj];
      }
      sst = setTimeout('runSlideShow()', ImageDuration)
      ImageDuration = 4000;
    }
  }
}
function switchImage(parElID, parImgSrc){
  var obj = document.getElementById(parElID);
  if (obj!=undefined){
    obj.src = parImgSrc;
  }
}
function switchHomeImage(parImg,parTLR) {
  switchImage("SlideShow","/cmdata/images/" + parImg);
  ssj = parTLR;
  if (ssj > (ssp-1)) {
    ssj=0;
  }
  clearTimeout(sst);
  sst = setTimeout('runSlideShow()', 5000)
}
function showThumb(parElID) {
  var obj = document.getElementById(parElID);
  if (obj!=undefined){
//    obj.style.visibility = "visible";
    obj.style.display = "block";
	}
}
function hideThumb(parElID) {
  var obj = document.getElementById(parElID);
  if (obj!=undefined){
//    obj.style.visibility = "hidden";
    obj.style.display = "none";
  }
}
//function showBlowup(parElID,parImg,parA,parSource,parTitle,parText) {
function showBlowup(parImg,parA,parTitle,parText) {
	var obj = document.getElementById("blowupContainer");
	if (obj != undefined) {
		var i = document.getElementById("blowupImg");
		var a = document.getElementById("blowupA");
		var t = document.getElementById("blowupText");
		if (i != undefined && parImg != undefined){
			if ( i.img != parImg ) {
				i.src = parImg;
			}
			if ( i.alt != parTitle ) {
				i.alt = parTitle;
			}
		}
		if (a != undefined && parA != undefined){
			if ( a.href != parA ) {
				a.href = parA;
			}
			if ( a.title != parTitle ) {
				a.title = parTitle;
			}
		}
		if (t != undefined && parText != undefined){
			if (t.innerHTML != parText) {
				t.innerHTML = parText;
			}
		}
		var X = mouseX+10;
		var Y = mouseY+10;
		obj.style.left = X + "px";
		obj.style.top = Y + "px";
		if ( obj.style.visibility != "visible" ) {
			obj.style.visibility = "visible";
		}
	}
}
function hideBlowup(parImg) {
	var obj = document.getElementById("blowupContainer");
	var i = document.getElementById("blowupImg");
	var t = document.getElementById("blowupText");
	if (obj!=undefined){
		obj.style.visibility = "hidden";
//obj.style.left=-1000;
	}
	if (i!=undefined && parImg != undefined){
		i.src = parImg;
	}
	if (t!=undefined){
		t.innerHTML = "";
	}
}



