function MM_swapImgRestore() { //v3.0  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;}function MM_preloadImages() { //v3.0  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}}function MM_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=MM_findObj(n,d.layers[i].document);  if(!x && d.getElementById) x=d.getElementById(n); return x;}function MM_swapImage() { //v3.0  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}}Array.prototype.push = function (a){	this[ this.length] = a;}function SwapImage() {	this.htmlIds = new Array();	this.imageCollections = new Array();	this.length = 1;	var arg = SwapImage.arguments;	this.length = SwapImage.arguments[1].length;	for (var i=0; i < arg.length; i++) {				if(i%2 == 0 ) { // a is an even number			//alert(arg[i] + " " + i);			this.htmlIds.push(arg[i]);		}		else {			var sources = preloadImages(arg[i]);			this.imageCollections.push( sources);		}	}	this.index = 0;}SwapImage.prototype.idInfo = function () {	var s = "";	alert(this.htmlIds.length);	for(var i=0; i < this.htmlIds.length; i++) {		s += this.htmlIds[i] + " " + i + " \n ";	}	return s;}SwapImage.prototype.swapNext = function () {	this.index++;	if(this.index >= this.imageCollections[0].length)		this.index = 0;		for(imgNum = 0; imgNum < this.htmlIds.length; imgNum++) {			var slide = this.htmlIds[imgNum];		/*if (document.all) {		  document.images[slide].style.filter="blendTrans(duration=2)";		  document.images[slide].style.filter="blendTrans(duration=crossFadeDuration)";		  document.images[slide].filters.blendTrans.Apply();  		}*/		document.images[slide].src = this.imageCollections[imgNum][this.index].src;		/*if (document.all) {     		  document.images[slide].filters.blendTrans.Play();  		}*/	}}SwapImage.prototype.swapTo = function (i) {	this.index = i;	if(this.index >= this.imageCollections[0].length)		this.index = 0;		for(imgNum = 0; imgNum < this.htmlIds.length; imgNum++) {			var slide = this.htmlIds[imgNum];		/*if (document.all) {		  document.images[slide].style.filter="blendTrans(duration=2)";		  document.images[slide].style.filter="blendTrans(duration=crossFadeDuration)";		  document.images[slide].filters.blendTrans.Apply();  		}*/		document.images[slide].src = this.imageCollections[imgNum][this.index].src;		/*if (document.all) {     		  document.images[slide].filters.blendTrans.Play();  		}*/	}}function preloadImages (srcs) {	var preLoad = new Array(srcs.length);	for (var g=0; g<srcs.length; g++) {		preLoad[g] = new Image();		preLoad[g].src = srcs[g];	}	return preLoad;}/*//////////////////////// SlideShow Class 				new SlideShow(  swapImage1, swapImage2, swapImage3, ....)				The slideshow object will flop successively between the swap images that you put in in the order you supplied the SwapImage arguments  */				function SlideShow() {	//////////////////////////////Set defaults	this.slideShowSpeed = 2100;	this.waitTime = 4000;	this.turnSpeed = 500;	// Duration of crossfade (seconds)	this.crossFadeDuration = 3;	//////////////////////////////End set defualts		this.slideNumber = 0;		this.slides = new Array();		var arg = SlideShow.arguments;	for (var i=0; i < arg.length; i++) {		this.slides.push(arg[i]);	}}SlideShow.prototype.run = function(){	//alert("running");	this.t = setInterval(runSlideShow, this.waitTime, this);} 			function runSlideShow(ss){				//alert(ss);					//alert(slideNumber + " " + slides.length);						ss.slides[ss.slideNumber].swapNext();					ss.slideNumber++;				if( ss.slideNumber >= ss.slides.length)				{					ss.slideNumber = 0;					clearInterval(this.tS);				}				else				{					this.tS = setInterval(runSlideShow, ss.turnSpeed, ss);				}								}function SwapCopy() {	this.htmlIds = new Array();	this.imageCollections = new Array();	this.length = 1;	var arg = SwapCopy.arguments;	this.length = SwapCopy.arguments[1].length;	for (var i=0; i < arg.length; i++) {				if(i%2 == 0 ) { // a is an even number			//alert(arg[i] + " " + i);			this.htmlIds.push(arg[i]);					}		else {			this.imageCollections.push( arg[i]);		}	}	this.index = 0;}SwapCopy.prototype.idInfo = function () {	var s = "";	alert(this.htmlIds.length);	for(var i=0; i < this.htmlIds.length; i++) {		s += this.htmlIds[i] + " " + i + " \n ";	}	return s;}SwapCopy.prototype.swapNext = function () {	this.index++;	if(this.index >= this.imageCollections[0].length)		this.index = 0;		for(imgNum = 0; imgNum < this.htmlIds.length; imgNum++) {			var object = MM_findObj(this.htmlIds[imgNum]);				object.innerHTML = this.imageCollections[imgNum][this.index];			}}SwapCopy.prototype.swapTo = function (i) {	this.index = i;	if(this.index >= this.imageCollections[0].length)		this.index = 0;		for(imgNum = 0; imgNum < this.htmlIds.length; imgNum++) {			var object = MM_findObj(this.htmlIds[imgNum]);				object.innerHTML = this.imageCollections[imgNum][this.index];			}}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=MM_findObj(n,d.layers[i].document);			if(!x && d.getElementById) x=d.getElementById(n); return x;		} 									function Gallery() {							var arg = Gallery.arguments;											var navId = arg[0];				this.navDiv = findObj(navId);							this.swapInstances = new Array ();				for (var i=1; i < arg.length; i++) {										this.swapInstances.push(arg[i]);				}							innerHtmlString = "";				index = 0;				this.gotoIndex (index);						}						Gallery.prototype.gotoIndex = function (index)			{								this.sImage = this.swapInstances[0];								for(var i=0; i < this.swapInstances.length; i++)				{										var si = this.swapInstances[i];					si.swapTo(index);				}				innerHtmlString = "";				for(var g=0; g < this.sImage.length; g++)				{					if(g == index)						innerHtmlString += "<a href='#' class='active-link' onmousedown='javascript:maingallery.gotoIndex(" + g + ")'>" + (g+1) + "<\/a>";					else						innerHtmlString += "<a href='#' onmousedown='javascript:maingallery.gotoIndex(" + g + ")'>" + (g+1) + "<\/a>";				}				this.navDiv.innerHTML = innerHtmlString;										}//-->
