// <!--


//obj function to be put in js file
function mkImageScroller(sWidth, sHeight){
	this.canScroll_mouse = true;
	this.canScroll_popup = true;
	this.photoInfo = new Array();
	this.baseStringConstant = 'photo_marquee_';
	this.baseString = '';
	this.DisplayPanel = null;
	this.objCurrentName = '';
	this.CurrentDirection = 'right';
	this.photoSeparator = '';
	this.styleString = '';

	this.sWidth = sWidth;
	this.sHeight = sHeight;
}
mkImageScroller.prototype.setCurrentObjectName = function (CurrentObjectName){
	this.objCurrentName = CurrentObjectName;
}

mkImageScroller.prototype.setStyleString = function (styleString){
	this.styleString = styleString;
}

mkImageScroller.prototype.setCurrentDirection = function (CurrentDirection){
	this.CurrentDirection = CurrentDirection;
}
mkImageScroller.prototype.setPhotoSeparator = function (photoSeparator){
	this.photoSeparator = photoSeparator;
}

mkImageScroller.prototype.getDisplayPanelHTML = function (){
	var tmpDisplayPanel;
	for(var i =0; i<10; i++){
		tmpDisplayPanel = document.getElementById(this.baseStringConstant+i);
		if(!tmpDisplayPanel){
			this.baseString = this.baseStringConstant+i;
			break;
		}
	}
	if(this.baseString){
		var x;
		x ='<MARQUEE id="'+this.baseString+'" onmouseover="'+this.objCurrentName+'.stopScroll();"  onmouseout="'+this.objCurrentName+'.startScroll();" ';
		if(this.styleString){
			x = x + ' style="'+this.styleString+'" ';
		}
		if(this.CurrentDirection){
			x = x + ' direction='+this.CurrentDirection;
		}
		x = x + ' scrollAmount=4 scrollDelay=80 ';
		if(this.sWidth){
			x = x + ' width='+this.sWidth;
		}
		if(this.sHeight){
			x = x + ' height='+this.sHeight;
		}
		
		x = x + '>';
		if(this.photoInfo.length>0){
			x = x + '<table border="0" cellspacing="0" cellpadding="0">'
			x = x + '<tr>';
			for(var i =0;i<this.photoInfo.length;i++){
				x = x + '<td>';
				x = x + '<a href="#" onclick="'+this.objCurrentName+'.showPhotoLarge(\''+this.photoInfo[i][0]+'\', '+this.photoInfo[i][1]+', '+this.photoInfo[i][2]+')">';
				x = x + '<IMG src="'+this.photoInfo[i][3]+'" ';
				if(this.photoInfo[i][4]){
					x = x + ' width="'+this.photoInfo[i][4]+'" ';
				}
				if(this.photoInfo[i][5]){
					x = x + ' height="'+this.photoInfo[i][5]+'" ';
				}
				x = x + ' border=0 ';
				if(this.photoInfo[i][6]){
					x = x + ' alt="'+this.photoInfo[i][6]+'" ';
				}
				x = x + '>';
				x = x + '</A>';
				x = x + '</td>';
				if(this.photoSeparator){
					x = x + '<td>';
					x = x + this.photoSeparator;
					x = x + '</td>';
				}
			}
			x = x + '</tr>';
			x = x + '</table>'
		}
		x = x + '</MARQUEE>';
		return x;
	}else{
		alert("Can't create Display Panel");
		return '';
	}
}

mkImageScroller.prototype.showPhotoLarge = function (photo_url,photo_width,photo_height){
	args=null;
	this.canScroll_popup = false;
	this.stopScroll();
	var features = "toolbar=0,resizable=1,status=0,menubar=0,height=700,width=1024,top=0,left=0";
//	var features = "dialogHeight:"+(photo_height+60)+"px;dialogWidth:"+(photo_width+9)+"px;edge: Raised; center: Yes; help: no; resizable: Yes; status: Yes;";
//	vReturnValue = window.showModalDialog(photo_url.replace(/.jpg/,'.htm'),args,features);
	vReturnValue = window.open(photo_url.replace(/.jpg/,'.htm'),args,features);
	this.canScroll_popup = true;
	this.startScroll();
}

mkImageScroller.prototype.startScroll = function (){
	if(this.canScroll_popup && this.canScroll_mouse){
		if(this.baseString){
		 	document.getElementById(this.baseString).start();
		}
 	}
}

mkImageScroller.prototype.stopScroll = function (){
	if(this.baseString){
	 	document.getElementById(this.baseString).stop();
	}
}

/*
0 - large url
1 - large width
2 - large height
3 - small url
4 - small width
5 - small height
6 - small alt
*/
mkImageScroller.prototype.addPhoto = function (large_url, large_width, large_height, small_url, small_width, small_height, small_alt){
	var i = this.photoInfo.length;
 	this.photoInfo[i] = new Array();
 	this.photoInfo[i][0] = large_url;
 	this.photoInfo[i][1] = large_width;
 	this.photoInfo[i][2] = large_height;
 	this.photoInfo[i][3] = small_url;
 	this.photoInfo[i][4] = small_width;
 	this.photoInfo[i][5] = small_height;
 	this.photoInfo[i][6] = small_alt;
}
// -->