// JavaScript Document

function ViewImage(ifile,ix,iy,ititle,dourl) {
//VIEW IMAGE IN DOCUMENT
var win;
var sWidth;
var sHeight;
//alert(ifile);
var NS = (document.layers) ? 1 : 0;
//alert (ix+","+iy);
//alert(unescape(ifile));
if (dourl==1) {
   var temp=new Array();
   temp=ifile.split('?');
   var temp2=new Array();
   temp2=temp[1].split('&');
   var temp3=new Array();
   var nparams="";
   for (i=0;i<temp2.length;i++) {
      temp3=temp2[i].split('=');
      nparams=nparams+(nparams==''?'':'&')+temp3[0]+"="+escape(temp3[1]);
    }
   nparams=temp[0]+"?"+nparams;
   ifile=nparams;
}

win = window.open("","imageviewer","width="+ix+",height="+iy+",scrollbars=yes");
if (NS) {
		sWidth = win.innerWidth;
		sHeight = win.innerHeight;
	} else {
		sWidth = win.document.body.clientWidth;
		sHeight = win.document.body.clientHeight;
		}
//alert("sWidth,sHeight:"+sWidth+","+sHeight+"\nix,iy"+ix+","+iy);
//if(sWidth!=ix || sHeight!=iy) {
//	win.close();
//	setTimeout("ViewImage('"+ifile+"',"+ix+","+iy+",'"+ititle+"')", 250);
//	return;
//	}
win.document.open();
win.document.location=ifile;
win.document.close();
win.focus();
//win.scrollbars.visible=true;	

}

function ViewFile(ifile) {
win=window.open(ifile);
}
