var startup = new Array();
		
function documentStartup() {
	for(var i = 0; i < startup.length; i++) {
		eval(startup[i] + "();");
	}
}

function getDiv(name) {
    isNS4 = (document.layers) ? true : false;
    isIE4 = (document.all && !document.getElementById) ? true : false;
    isIE5 = (document.all && document.all.getElementById) ? true : false;
    isNS6 = (!document.all && document.getElementById) ? true : false;

    if (isNS4) {
        eval('element = document.layers["' + name + '"];');
    }
    else if (isIE4) {
        eval('element = document.all["' + name + '"];');
    }
    else if (isIE5) {
        eval('element = document.all.getElementById("' + name + '");');
    }
    else  {
		try {
			eval('element = document.getElementById("' + name + '");');
		}
		catch(e) {
			eval('element = ' + name);
		}
    }

    return element;
}

var photos = new Array();
var preloadedimages=new Array()
	for (i=0;i<photos.length;i++){
		preloadedimages[i]=new Image()
		preloadedimages[i].src=photos[i]
	}


function applyeffect(){
	if (document.all && photoslider.filters){
		photoslider.filters.revealTrans.Transition=Math.floor(Math.random()*23)
		photoslider.filters.revealTrans.stop()
		photoslider.filters.revealTrans.apply()
	}
}



function playeffect(){
	if (document.all && photoslider.filters)
		photoslider.filters.revealTrans.play()
}

function keeptrack(){
	window.status="Image "+(which+1)+" of "+photos.length
}


function backward(){
	if (which>0){
		which--
		applyeffect()
		document.images.photoslider.src=photos[which]
		playeffect()
		keeptrack()
	}
}

function forward(){
	if (which<photos.length-1){
		which++
		applyeffect()
		document.images.photoslider.src=photos[which]
		playeffect()
		keeptrack()
	}
}

function transport(){
	window.location=photoslink[which]
}

function MM_openBrWindow(theURL,winName,features) { 
	window.open(theURL,winName,features);
}

function zeroData(element, value, coming) {
	if(coming && element.value == value) {
		element.value = '';
	}
	else if(!coming && element.value == '') {
		element.value = value;
	}
}


function SimpleSwapSetup(){
  var x = document.getElementsByTagName("img");
  for (var i=0;i<x.length;i++){
    var oversrc = x[i].getAttribute("oversrc");
    if (!oversrc) continue;
    // preload image
    // comment the next two lines to disable image pre-loading
    x[i].oversrc_img = new Image();
    x[i].oversrc_img.src=oversrc;
    // set event handlers
    x[i].onmouseover = new Function("SimpleSwap(this,'oversrc');");
    x[i].onmouseout = new Function("SimpleSwap(this);");
    // save original src
    x[i].setAttribute("origsrc",x[i].src);
  }
}

var PreSimpleSwapOnload =(window.onload)? window.onload : function(){};
window.onload = function(){PreSimpleSwapOnload(); SimpleSwapSetup();}
