/*************************************************************************/
/* Below are the global javascript cariables that are used in the viewer */
/*************************************************************************/
	var debug_string = '';
	/*IE calls "clickposition" when dragging the zone this variable is used */
	/*to prevent "clickposition" from doing anything when "my_DragFunc" is called*/
	var zone_test = false; 

	var top; /* used to define the bottom of the page title, links etc */
	
	var stats = getSize();
	var pgw = stats["myWidth"]; /* page width */
	var pgh = stats["myHeight"];/* page height */

	var imw; /* Width of viewer image */
	var imh; /* Height of viewer image */
	var navw; /* Width of navigation image */
	var spc; /* space distance */

/* How many images are being displayed and if they can be compared */
	var no_ims;
	var compare;

/* These are the dimensions of the original image */
	var max_x;
	var max_y;

/* = viewer_thumbsize (navw, max_x, max_y); */	
	var ts;

/* starting positions for the viewer and navigation images */
	var iml;
	var imt;
	var navl;
	var navt;

/* These are the dimensions of the thumbnail or navigation image */
	var min_x; /*  = ts['x']; */
	var min_y; /*  = ts['y']; */
/* These are the dimensions of the main view window */
	var target_w; // = imw;
  	var target_h; // = imh;
	var tw_temp; // = target_w;
  	var th_temp; // = target_h;
/* These are the dimensions of the current pyramidal layer of the original image */
	var wid;// = min_x*2;
	var hei;// = min_y*2;
/* These values are used to define the what part of the image is displayed in the viewer */
	var rgn;
	var rgn_x;// = 0;
	var rgn_y;// = 0;
	var rgn_w;// = target_w;
	var rgn_h;// = target_h;
/* Paths and initial file names used in the viewer */
	var server;// = '$GLOBALS[iipimage_server]';  
	var image_path;// = '$GLOBALS[pyr_path]';
	var file_1;// = '$im_details[file]';
	var qua_no = 75;
	var qua = '&QLT=' + qua_no;
	var fif_1;// = 'FIF=' + image_path + file + qua;
/* Initial contrast control variables */  
	var contrast_1a = 1;
	var contrast_1b = 1;
	var con_adjust_1 = 0.1;
	var cnt = "CNT=" + contrast_1a;
	var cnt_1 = "CNT=" + contrast_1b;
	//var cvt = 'WID=' + wid + '&CVT=jpeg';
/* Variables defining the origin of the navigation thumbnail */ 
	var start_y = 0;
	var start_x = 0;
/* Additonal variable required by the viewer */  
	var sds = 'SDS=0,90';
	var thumbx = 0;
	var xfit = 0;
	var yfit = 0;	
/* Other variables used to control conditions in the viewer */ 
	var dbl = 0;
	var sng = 0;
	var tds_x = 0;
	var tds_y = 0;
	var wert = 0;
	var zone_resized = 0;	
	
	var frac = 0;

/* used when doing direct images comparisons */
	var file_2;// = '$im_details[file]';
	var fif_2;// = 'FIF=' + image_path + file2 + qua; 
	var contrast_2a = 1;
	var contrast_2b = 1;
	var con_adjust_2 = 0.1;
	var cnt_2 = "CNT=" + contrast_2b;

/*************************************************************************/
/*************************************************************************/

/****************************************************************************/
/* Below are the additional global javascript variables used in other pages */
/****************************************************************************/

	var no_ims = 2;
	var compare = 1;
	var which;
	
	var file_1;
	var title_1;
	var bit_1;
	var band_1;
	var details_1;
	
	var file_2;
	var title_2;
	var bit_2;
	var band_2;
	var details_2;
	
	var wfr;
	var hfr;
	var xfr;
	var yfr;
	
	//Windows paths
	//var server = 'http://'+document.domain+'/fcgi-bin/IIPImageServer.fcgi?';
	//var image_path = 'C:/Program Files/Apache Group/Apache2/htdocs/iipimage/index_files/';

	//Linux paths
	//var server = 'http://'+document.domain+'/fcgi-bin/iipsrv.fcgi?';
	var server = 'http://zoom.smk.dk/fcgi-bin/iipsrv.fcgi?';
	
	var image_path = '/var/www/html/iipimage/index_files/';

	var server_path = server + 'FIF=' + image_path;

	var current_painting=new Array();
	
	var paintings=new Array();
	
	var painting_1=new Array();
	painting_1[0] = 'Jacob Jordaens, "The Ferry Boat to Antwerp", 1623. Oil on canvas, 279 x 467 cm';
	painting_1[1] = 'Jordaens SYMM-pyramid.tif,8,3,8448,5100,visible';
	painting_1[2] = 'Jordaens X-ray-pyramid.tif,8,1,8448,5100,x-ray';
	paintings[1] = painting_1;
	
	var painting_2=new Array();
	painting_2[0] = 'Andrea Mantegna, "Kristus som den lidende frelser", 1495-1500. Oil on canvas, 78 x 48 cm';
	painting_2[1] = 'KMSsp69precons-pyramid.tif,8,3,4464,7250,visible';
	painting_2[2] = 'KMSsp69postcons-pyramid.tif,8,1,4464,7250,visible';
	paintings[2] = painting_2;



