// checks if browser is IE
function CheckIsIE() 
{ 
    if  (navigator.appName.toUpperCase() == 'MICROSOFT INTERNET EXPLORER')  
    	{ return true;} 
    else { return false; } 
} 

// prints the contents of a frame with 
// framenamename is passed as path

function PrintThisPage(path) 
{ 

 if (CheckIsIE() == true) 
  { 
	 document.path.focus(); 
	 document.path.print(); 
  }      
  else 
   { 
	  window.frames['path'].focus(); 
	  window.frames['path'].print(); 
	} 

} 

// getFile name strips the path information leaving only the file name

function getFilename(path)

{

len = path.length;
got = 0;
for (i = len; i > 0; i--)
	{ 
	vb = path.substring(i,i+1);
	if (vb == "/" && got == 0) 
		{ 
		path=path.substring(i+1,len);
		got = 1;
		} 
	} 
return path;
}

//closes window
function closeWindow() {
	window.close();
	}
//prints window	
function printWindow() {
	window.print();
	}
//opens a window
// WIDTH,HEIGHT,CENTERX,CENTERY are not nessessary

function PopIt(window_URL,w,h,cx,cy)  {

	width=w||"0";
	height=h||"0";
	topPosition=cy||"0";
	leftPosition=cx||"0";
	
	screenWidth=screen.width;
	screenHeight=screen.height;
	if (width=="0") { 
		width="640";
		}
	if (height=="0") { 
		height="500";
		}
	if (leftPosition=="0") {
		if (width > screenWidth) { 
			width= screenWidth;
			leftPosition=0;
			}
		else {
			leftPosition=(screenWidth-width)/2;
			}
		}
	if (topPosition=="0") {
		if (height > screenHeight) { 
			height= screenHeight;
			topPosition=0;
			}
		else {
			topPosition=(screenHeight-height)/2;
			}
		}
	openParam2 = "toolbar=0,location=0,status=0,menubar=0,scrollbars=yes,copyhistory=0,resizable=1,alwaysRaised,titlebar=0,width="+width+",height="+height+",top="+topPosition+",left="+leftPosition;
	window.open(window_URL, "Print",openParam2);

}
