// JavaScript Document

function DT_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.DT_p) d.DT_p=new Array();
    var i,j=d.DT_p.length,a=DT_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.DT_p[j]=new Image; d.DT_p[j++].src=a[i];}}
}

function DT_swapImgRestore() { 
  var i,x,a=document.DT_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function DT_findObj(n, d) { 
  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=DT_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function DT_swapImage() { 
  var i,j=0,x,a=DT_swapImage.arguments; document.DT_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=DT_findObj(a[i]))!=null){document.DT_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

// Flash movie POP UP.


var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
// Handle all the FSCommand messages in a Flash movie.
function slideshow_DoFSCommand(command, args) {
	var slideshowObj = isInternetExplorer ? document.all.slideshow : document.slideshow;

	if(command == 'openWindow'){
		var qs = args.split('&');			// split the arguments
		var w = qs[1].split('=')[1];			// width
		var h = (1 * qs[2].split('=')[1]) + 19;		// height, I add 19 pixels to the height for the menu bar

		// modify this line if you have another template displaying your big view

		// qs[0]: big image src
		// qs[1]: big image width
		// qs[2]: big image height

		// cmswin=window.open("big.cfm?lan=1&" + args,"cmswin","width="+w+",height="+h+",scrollbars=no,top=200,left=300,resizable=no");
		cmswin=window.open(qs[0].split("=")[1],"cmswin","width="+w+",height="+h+",scrollbars=no,top=200,left=300,resizable=no");

		window.cmswin.focus();
	}
}
// Hook for Internet Explorer.
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	document.write('<script language=\"VBScript\"\>\n');
	document.write('On Error Resume Next\n');
	document.write('Sub slideshow_FSCommand(ByVal command, ByVal args)\n');
	document.write('	Call slideshow_DoFSCommand(command, args)\n');
	document.write('End Sub\n');
	document.write('</script\>\n');
}
