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];}
}
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];}}
} 

var slideCount = 550;
var slideDiv = "";
	
function slideLarge(divid) {
	var div = MM_findObj(divid);
	div.style.height = slideCount + "px";
	slideCount = 550;
	slideDiv = divid;
	setTimeout("slideMore()", 30);
}

function slideMore() {
	var div = MM_findObj(slideDiv);
	if(slideCount > 10) {
		slideCount -= 50;
		div.style.height = slideCount + "px";
		setTimeout("slideMore()", 30);
	}
	else {
		div.style.height = "570px";
		div.style.display = "none";
		slideCount = 550;
	}

}

function displayLargeImage(location, ext, hires_id, image_id)
{
	var imagefile = location;
	location = getLargeFilename(location, ext);
	var buf = "";
	if(ext == "swf"){
		buf = "<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'";
		buf += " codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' WIDTH='400' HEIGHT='400' id=OBJECT1>";
		buf += "<PARAM NAME=movie VALUE='/media/"+ location + "'> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> ";
		buf += "	<EMBED src='/media/" + location + "' quality=high bgcolor=#FFFFFF  WIDTH='400' HEIGHT='400' TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'></EMBED>";
		buf += "</OBJECT>";
	}
	else if(ext == "mov"){
		buf = "<OBJECT CLASSID='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B' WIDTH='550' HEIGHT='550' CODEBASE='http://www.apple.com/qtactivex/qtplugin.cab' >";
		buf += "	<PARAM NAME='SRC' VALUE='/media/" + location + "'>";
		buf += " <PARAM NAME='AUTOPLAY' VALUE='TRUE'>";
		buf += "	<PARAM NAME='CONTROLLER' VALUE='true'>";
		buf += "	<PARAM NAME='target' VALUE='myself'>";
		buf += "	<PARAM NAME='LOOP' VALUE='false'>";
		buf += "	<EMBED WIDTH='550' SRC='/media/" + location + "' ";
		buf += "	 HEIGHT='550' PLUGINSPAGE='http://www.apple.com/quicktime/download/index.html' ";
		buf += "	 AUTOPLAY='TRUE' LOOP='false' ";
		buf += "	 CONTROLLER='true' CACHE='true' >";
		buf += "</OBJECT>";
	}
	else if(ext == "flv") {
		buf = "<div id='flashcontent" + image_id + "'>" +
				"<strong>You need to upgrade your Flash Player</strong>" +
				"<p>Please go to the <a href='http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash'>Macromedia web site</a> " +
				"for the latest version.</p></div>";
	
	}
	else if(ext == "dcr"){
		buf = "<object classid='clsid:166B1BCA-3F9C-11CF-8075-444553540000' " + 
				"codebase='http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,0,0,0' " + 
				"ID=test width='550' height='550'> " + 
				"<param name=src value='/media/" + location + "'> " + 
				"<param name=swRemote value=\"swSaveEnabled='true' swVolume='true' swRestart='true' swPausePlay='true' swFastForward='true' swContextMenu='true' \"> " +
				"<param name=swStretchStyle value=none> " + 
				"<PARAM NAME=bgColor VALUE=#FFFFFF> " + 
				"<embed src='/media/" + location + "' bgColor=#FFFFFF  width='550' height='550' swRemote=\"swSaveEnabled='true' swVolume='true' swRestart='true' swPausePlay='true' swFastForward='true' swContextMenu='true' \" swStretchStyle=none " +
				"type='application/x-director' pluginspage='http://www.macromedia.com/shockwave/download/'></embed> " +
				"</object>";
	}
	else {
		if(!hires_id) {
			buf = "<img class='elimage' src='/scaler/image.jpg?&src=fi&name=" + location + "&crop=n&sz=400&wmde=y&image_id=" + image_id + "' border='0' alt='" + location + "'>";
		}
		else {
			if(hires_id > 0) {
				buf = "<img class='elimage' src='/scaler/image.jpg?&src=hires&name=image_" + hires_id + ".jpg&crop=n&sz=550&image_id=" + image_id + "&wmde=y' border='0' alt='" + hires_id + "'>";
			}
			else {
				buf = "<img class='elimage' src='/scaler/image.jpg?&src=fi&name=" + location + "&crop=n&sz=400&wmde=y&image_id=" + image_id + "' border='0' alt='" + location + "'>";
			}
		}

	}
	return buf;
}

function getLargeFilename(location, ext)
{
	if(ext == "jpg") return location;
	return location.substr(0, location.length - 3) + ext;
}

function hideLarge(divid) {
	var div = MM_findObj(divid);
	div.style.display = "none";
}

function showbox(divid) {
	var div = MM_findObj(divid);
	div.style.display = "block";
}