var slidespeed=1;
var fadeduration=2;
var slideduration=3000;
var ie=document.all;
var imageholder=new Array();
var Picture = new Array(); 
var Caption = new Array();
var Link = new Array();
var tss;
var iss;
var jss = 0;

function gotoshow(){
  window.location=slidelinks[whichlink];
}

function followlink(){
  window.location=Link[jss];
}

function slideit(){
if (!document.images) return
if (ie) document.images.slide.filters[0].apply()
document.images.slide.src=imageholder[whichimage].src
if (ie) document.images.slide.filters[0].play()
whichlink=whichimage
whichimage=(whichimage<slideimages.length-1)? whichimage+1 : 0
setTimeout("slideit()",slidespeed+fadeduration)
}

function runSlideShow(){
jss += 1; if (jss > (pss)) jss=1;
if (document.all){
document.images.PictureBox.style.filter="blendTrans(duration=fadeduration)";
document.images.PictureBox.filters.blendTrans.Apply();
}
document.images.PictureBox.src = preLoad[jss].src;
if (document.getElementById) document.getElementById("CaptionBox").innerHTML=Caption[jss];
if (ie) document.images.PictureBox.filters.blendTrans.Play();
tss = setTimeout('runSlideShow()', slideduration);
}

function Trsf(a){
   b=(Math.pow(a,2)-1)*3;
   return "babe"+b+".jpg";
}

function OpenWin (PageURL,PageWidth,PageHeight) {
  NewWindow = window.open(PageURL, "NewWin", "width="+PageWidth+",height="+PageHeight+",toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no");
  NewWindow.focus();
}

function OpenHelp (PageURL,PageWidth,PageHeight) {
  NewImgWindow = window.open(PageURL, "NewHelp", "width="+PageWidth+",height="+PageHeight+",toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes");
  NewImgWindow.focus();
}

function ZoomImg (PageURL,PageWidth,PageHeight,ImgTitle,ImgCaption) {
  if (ImgCaption == "=") ImgCaption = ImgTitle;
  NewImgWindow = window.open(PageURL, "NewZoom", "width="+(PageWidth+20)+",height="+(PageHeight+110)+",toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no");
  NewImgWindow.document.write('<head>');
  NewImgWindow.document.write('<title>',ImgTitle,'</title>');
  NewImgWindow.document.write('<link rel="stylesheet" href="mm.css" type="text/css">');
  NewImgWindow.document.write('</head>');
  NewImgWindow.document.write('<body leftmargin=0 topmargin=10>');
  NewImgWindow.document.write('<p class="caption"><a href="javascript:window.close();"><img src="',PageURL,'" border=0 alt="Click to close the window..."/></a>');
  NewImgWindow.document.write('<br><br>',ImgCaption,'</p>');
  NewImgWindow.document.write('<p class="close"><a href="#" onmouseover="cw.src=\'resources/closewindow2.gif\';" onmouseout="cw.src=\'resources/closewindow1.gif\';" onclick="javascript:window.close();"><img name="cw" src="resources/closewindow1.gif" border="0" alt="Close Window"></a></p>');
  NewImgWindow.document.write('</body>');
  NewImgWindow.document.close();
  NewImgWindow.focus();
}

function PreLoad () {
  if (!document.images) return;
  var ar = new Array();
  var arguments = PreLoad.arguments;
  for (var i = 0; i < arguments.length; i++) {
    ar[i] = new Image();
    ar[i].src = "resources/" + arguments[i];
  }
}
function newImage (arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}
function changeImages () {
	if (document.images) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}
function High (ImgObject){
	ImgObject.filters.alpha.opacity=100;
	return;
}
function Low (ImgObject){
	ImgObject.filters.alpha.opacity=50;
	return;
}