/* --------------------
function: outLink
purpose: Pop up third-party site disclaimer with link to third-party site
params: website (string -- URL to populate new window with)
---------------------- */
function outLink(website){
website = website.replace(/\\/,"\\");
	var outlink = window.open("/outlink.php?goto=" + website, "outlink", "width=400,height=250,screenX=0,screenY=0,top=0,left=0,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=0,resizable=0");
	outlink.focus();
}

/* --------------------
function: PDFdisclaimer
purpose: Pop up Adobe Acrobat disclaimer window and link to Important Product Info
params: filename (string -- which PDF to view)
---------------------- */
function PDFdisclaimer(filename,filetitle)
{
	var encodedTitle = filetitle.split(" ").join("%20");
	var PDF = window.open('/pdf_opener.php?pdf=' + filename+"&title=" + encodedTitle, 'PDF', 'width=300,height=350,screenX=0,screenY=0,top=0,left=0,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=0,resizable=1' );
	PDF.focus();
}

/* --------------------
function: viewPDF
purpose: Open the PDF once Acrobat disclaimer has been viewed
params: filename (string -- which PDF to view)
---------------------- */
function viewPDF(filename)
{
	var encodedPDFName = filename.split(" ").join("%20");
	window.open('/PDF/' + encodedPDFName);
	//self.close();
}

/* --------------------
function: openWin
purpose: opens a popup window
params: url to open, width and height of window
---------------------- */

	function openWin(url, w, h)
	{
		var winprop = "toolbar=0,scrollbars=1,location=0,statusbar=no,menubar=0,resizable=1,width=" + w + ",height=" + h;
		openwin = window.open(url,'',winprop);
	}


/* --------------
function: MM_reloadPage
purpose:
params:
------------------------*/


function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

/*----------------------------------
function: gotoOutlink(
--------------------------------*/
function gotoOutlink(outLinkURL)
{
	openWin(outLinkURL, '', '');
	self.close()
}

/*----------------------------------
function: getRootPath(
--------------------------------*/
function getRootPath()
{
	var rootPath = "" , sPathName = "", 	sHostName = ""
	if (window.rootPath) ret = window.rootPath
	sPathName = window.location.pathname + ""
	if ( sPathName == "" ) sPathName = window.top.location.pathname + ""
	if ( sPathName.lastIndexOf("/") == sPathName.length - 1 ) sPathName = sPathName.substr(0,sPathName.lastIndexOf("/"))
	if ( sPathName.indexOf("/") == 0) sPathName = sPathName.substr(1)
	if ( sPathName.indexOf("/") > 0 ) sPathName = sPathName.substr(0,sPathName.lastIndexOf("/"))
	if ( sPathName.indexOf("/") > 0 ) {
		sPathName = sPathName.substr(0,sPathName.lastIndexOf("/"))
		//if (  sPathName.indexOf("/") > 0 ) sPathName = sPathName.substr(0,sPathName.lastIndexOf("/"))
	} else sPathName = ""
	if (sPathName != "" && sPathName.indexOf("/") != 0 ) sPathName = "/" + sPathName
	sHostName = window.location.host + ""
	rootPath = window.location.protocol + "//" + sHostName +  sPathName  + "/"
	return rootPath + getApplicationRoot() + "/";
}



