 var viewportwidth;
 var viewportheight;
 
 // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
 
 if (typeof window.innerWidth != 'undefined')
 {
      viewportwidth = window.innerWidth;
      viewportheight = window.innerHeight;
 }
 
// IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)

 else if (typeof document.documentElement != 'undefined'
     && typeof document.documentElement.clientWidth !=
     'undefined' && document.documentElement.clientWidth != 0)
 {
       viewportwidth = document.documentElement.clientWidth;
       viewportheight = document.documentElement.clientHeight;
 }
 
 // older versions of IE
 
 else
 {
       viewportwidth = document.getElementsByTagName('body')[0].clientWidth;
       viewportheight = document.getElementsByTagName('body')[0].clientHeight;
 }
 
 
 
 
var browser=navigator.appName;


 var sbwidth = 38;
 
 if (browser == "Microsoft Internet Explorer")	{sbwidth=38;}
 if (browser == "Netscape")						{sbwidth=38;}
 if (browser == "Opera")						{sbwidth=22;}

	
var scr_width = viewportwidth- sbwidth;

var scr_height =viewportheight;
var img_height = scr_height;

// adjust to width
var ratio = img_height/1000.0;
var img_width =1700*ratio;


if (img_width > scr_width) { img_width = scr_width; ratio = img_width/1700.0; img_height =  1000.0 * ratio }; 

img_height = Math.floor(img_height);
img_width = Math.floor(img_width);

/*
var vid_width = 480;
var vid_height = 300; 

var max_height = scr_height - 95 - 90 - 20;
var max_width = Math.floor(scr_width *0.60) -40 -12 -10;

vid_height = Math.floor(max_height * 300.0/400.0);
vid_width = Math.floor(vid_height / 300.0 * vid_width);
*/

//document.writeln(img_width +" and " + img_height);

