// JavaScript Document 6.0.124 
var ex,u,p,f,loc,j,k,m,foc, xmlhttp='', agt, theStr, browser, version, canUseDoesit='', userTerm, thePath, popp, pass;//,mU,mP;
//var ex,u,p,f,j,k,m,foc, xmlhttp='', agt, theStr, browser, version, canUseDoesit='', userTerm, thePath, popp;//,mU,mP;
var oHTMLlen=0;
var maxSecs=5;
var pauses=250;
 
function pass_inline(a){
	pass="inline";
	getBrowser('blockOmniweb');
	if (!canWeProceed()) return false;
	setGlobals(a);
	setCanUseDoesit();
	if (f && f.substring(0,7)=="stepup_") {
		f=f.substr(7);
		thePath='';
	} else thePath=(f && window.parent.frames[f])?window.parent.frames[f]:window;
	foc='';
	return pass_pop();
}

function setGlobals(a){
	a=a.split('&');
	ex=a[0].replace('?','');
	u=a[1];
	p=a[2];
	f=a[3];
	userTerm=a[4];
	//mU=(a[6] % 2 == 1) ; 
	//mP=((a[6] == 2) || (a[6] == 3));

loc=(a[7])?a[7]:'';

}
function setCanUseDoesit(){
	if (document.getElementsByTagName && !(browser=='Opera' && version < 7) &&  !(browser=='OmniWeb' && version==5)) canUseDoesit=true;
}
function init(){
	setGlobals(location.search);
	thePath=(f && opener.parent.frames[f])?opener.parent.frames[f]:opener; 
	getBrowser();
	setCanUseDoesit();
	if (!canWeProceed()) { window.close();return;}
	foc='ppt1';
	var	is_nav4dn = (browser=='Netsc' && version < 5);
	if (u=='') {
		if (is_nav4dn) MM_findObj("ppt1").value='Enter password below';
		else  MM_findObj("ppuid").className='invis';
		foc='ppt2';
	}
	if (p=='') { 
		if (is_nav4dn) MM_findObj("ppt2").value='Enter username above';
		else MM_findObj("pppw").className='invis';	
		foc='ppt1';
	}
	if (p=='pp' || u=='uu')	MM_findObj(foc).focus(); //the p/u condtion is req'd by IE(?)
}
function pass_pop(){
	MM_findObj("ppbtn").disabled=true;
	j=(u=='uu')?MM_findObj("ppt1").value+'/':'';
	k=(p=='pp')?MM_findObj("ppt2").value+'.':'';
	if ((!j && (!k || k=='.')) || (!k && (!j || j=='/')) || (j && j!='/' && k=='.') || (k && k!='.' && j=='/') || (j=='/' && k=='.' )) {
		alert('Missing information - unable to proceed');
		if (foc) MM_findObj(foc).focus();
		MM_findObj("ppbtn").disabled=false;
	} else {
		if (k.indexOf('/') != -1) k='f3od9c0043odfkdjsdgbg9342';
		m=(p)?ex:'';
doesFileExist(loc+j+k+m,getXmlHttp());//~
//		doesFileExist(j+k+m,getXmlHttp());
	}
	return false;
}

function MM_findObj(n,d){//v4.01
var p,i,x;if(!d)d=document;if((p=n.indexOf("?"))>0&&parent.frames.length){d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}if(!(x=d[n])&&d.all)x=d.all[n];for(i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];for(i=0;!x&&d.layers&&i<d.layers.length;i++)x=MM_findObj(n,d.layers[i].document);if(!x && d.getElementById) x=d.getElementById(n);return x;
}
function getBrowser(partial){
	agt=navigator.userAgent.toLowerCase();
	if (isIt('konqueror')) browser = "Konqueror";
	else if (isIt('safari')) browser = "Safari";
	else if (isIt('omniweb')) browser = "OmniWeb";
	else if (isIt('opera')) browser = "Opera";
	else if (isIt('webtv')) browser = "WebTV";
	else if (isIt('icab')) browser = "iCab";
	else if (isIt('msie')) browser = "IE";
else if (partial) null;
	else if (!isIt('compatible')){
		browser = "Netsc"
		version = agt.charAt(8);
	}
	if (!version) version = agt.charAt(place + theStr.length);
	if (browser=="OmniWeb" && !Number(version)) version = agt.charAt(place + theStr.length +1) ;// for omniweb4&5
}

function canWeProceed(){
	if (browser=='OmniWeb' && version < 5) {
		alert("Omniweb "+version+" is not supported.\n\nPlease upgrade to version 5+")
		return false;
	} 
	return true;
}

function isIt(str){
	place = agt.indexOf(str) + 1;
	theStr = str;
	return place;
}
function getXmlHttp(){
	/*@cc_on @*/
	/*@if (@_jscript_version >= 5)
		try{ //to get MS HTTP request object
			xmlhttp=new ActiveXObject("Msxml2.XMLHTTP.4.0");
		}catch(e){
			try{ //to get MS HTTP request object
				xmlhttp=new ActiveXObject("Msxml2.XMLHTTP")
			}catch(e){
				try{// to get the old MS HTTP request object
					xmlhttp = new ActiveXObject("microsoft.XMLHTTP");
				}catch(e){
					//this (empty) catch required by winIE6
				}
			}
		}
	//@else
		//xmlhttp=false;
	@end @*/
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') xmlhttp = new XMLHttpRequest();
	return xmlhttp;
}

function doesFileExist(url,xmlhttp){
	if ( typeof xmlhttp != 'object') {
			if (thePath) {
				if (canUseDoesit && thePath.document.getElementsByTagName('BODY')[0].innerHTML != 'undefined') oHTMLlen=thePath.document.getElementsByTagName('BODY')[0].innerHTML.length;//undefnd for macOpera<7 which does not support innerhtml (while safari does not support outer)

thePath.location=loc+j+k+m;
//				thePath.location=j+k+m; //~
			} else openStepup();
			if (!foc) {//inline
				if (!f || f == self.name){inlineTidy(); return;}
				if (!thePath && (typeof popp != 'undefined')) thePath=popp;
			}
			if (canUseDoesit && ( (thePath != popp && (typeof thePath.document.getElementsByTagName('BODY')[0].innerHTML != 'undefined') )  || (thePath == popp ) ))  {
				setTimeout('doesit()',1500);
				if (foc) {displayCheckingAuth('Checking...');} else inlineTidy();
			} else {
				if (!foc) inlineTidy();
				else self.close();
			}
	} else {
		xmlhttp.open("HEAD", url, true, "", "");
		xmlhttp.onreadystatechange = HandleStateChange;
		xmlhttp.send(null)  ;
	}
}  

function openStepup(){
	var dims=f.split('_'), stepT, stepL,hh=0,ww=0,ah=0, aw=0;
	hh=dims[0];
	ww=dims[1];
	if (screen.availableHeight) {
		ah=screen.availableHeight-15 ;
		aw=screen.availableWidth-5 ;
	} else {
		ah=screen.height-80;
		aw=screen.width -40;
	}
	if (hh > ah) hh=ah;
	if (ww > aw) ww=aw;
	if (browser == "Opera")	stepT=stepL=0;
	else {
		stepT=(ah-hh)/2;
		stepL=(aw-ww)/2;
	}
	var attr='resizable=yes,scrollbars=yes,top='+stepT+',left='+stepL+',screenY='+stepT+',screenX='+stepL+',width='+ww+',height='+hh;
	if (popp && !popp.closed) popp.close();
	popp=window.open(j+k+m,'popp',attr);
}

function inlineTidy(){
	MM_findObj("ppbtn").disabled=false;
	displayCheckingAuth('');
}

function HandleStateChange() {
	if (xmlhttp.readyState==4) {
		if (xmlhttp.status==200) {
			if (!foc) inlineTidy();
			if (thePath) {
				thePath.location=loc+j+k+m;
				if (pass != 'inline'){
					if (browser == "IE") self.close();
					else window.open('vwd_getpass6.htm?closeit','popp','top=0,left=0,height=100,width=100');// the only way I could close the popup
				}
			} else openStepup();
		} else { 
			if (xmlhttp.status==403) {
				alert('Error. Try again or contact webmaster.');
				if (!foc) inlineTidy();
				if (pass != 'inline'){
					if (browser == "IE") self.close();
					else window.open('vwd_getpass6.htm?closeit','popp','top=0,left=0,height=100,width=100');// the only way I could close the popup
				}
			} else {
				alert('Authorization Failed. Try again.');
				displayCheckingAuth('');
			}
			if (foc) MM_findObj(foc).focus();
			MM_findObj("ppbtn").disabled=false;
		}
	}
}

function doesit(){
	var x=0,y=0,z=0;
	 while (x<maxSecs*1000/pauses && !thePath.document.getElementsByTagName('BODY')){
		if (x==0) alert('Checking...');
		x+=1;
		pauser(pauses);
	 }
	 x = x < maxSecs*1000/pauses;	 
	var ff=((typeof thePath.document.getElementsByTagName('HEAD')[0] == 'undefined') || (thePath.document.getElementsByTagName('HEAD')[0].innerHTML.length < 16) || (thePath.document.getElementsByTagName('BODY')[0].innerHTML.length==oHTMLlen)) ;//ohtml stuff forif file is donwloaded, like js (or opened like music??? )
	if (x && ff) {
		if (thePath && (thePath != popp) && foc) {inlineTidy(); window.close();}//for safari vs self.close();
	} else {
	 	while (x && y<maxSecs*1000/pauses && String(thePath.document.getElementsByTagName('BODY')[0].innerHTML)=='undefined'){
			if (y==0) alert('Checking...');
			pauser(pauses);
			y+=1;
		 }
		 y = y < maxSecs*1000/pauses;
		while (x && y && z<maxSecs*1000/pauses && thePath.document.getElementsByTagName('BODY')[0].innerHTML.length== oHTMLlen){
			if (z==0) alert('Checking...') ;
			pauser(pauses);
			z+=1;
		}
		z = z < maxSecs*1000/pauses;
		if (!x || !y || !z || is404(thePath.document.getElementsByTagName('HEAD')[0])) {
			if (thePath != popp) {
				thePath.history.back();
			} else {
				if ((typeof popp !='undefined') && !popp.closed) popp.close(); // for stepup
				inlineTidy(); // needed?
			}			
			alert('Authorization Failed. Try again.');
			displayCheckingAuth('');
			MM_findObj("ppbtn").disabled=false;
			if (foc) MM_findObj(foc).focus();
		} else 	{
			inlineTidy(); 
			//if (thePath && (thePath != popp)) window.close(); //window for safari //self.close() safari ignores
			if (foc && thePath && (thePath != popp)) window.close(); //window for safari //self.close() safari ignores
		}
	}
}
function is404(hd){
	if (hd.getElementsByTagName('TITLE').length == 0 ) return false ;
	var str=hd.getElementsByTagName('Title')[0].innerHTML.toLowerCase();
	if (userTerm){
		userTerm=userTerm.replace(/^\s+/,'');
		userTerm=userTerm.replace(/\s+$/,'');
	} 
	if ((str && userTerm && str.indexOf(userTerm) != -1) || (str.indexOf("cannot") != -1) || (str.indexOf("unable") != -1) || (str.indexOf("404") != -1) || (str.indexOf("not found") != -1) ) return true;
return false;
}
function displayCheckingAuth(str){
	if (MM_findObj("ppt1")) MM_findObj("ppt1").value=str;
	if (MM_findObj("ppt2")) MM_findObj("ppt2").value=str;
}

function pauser(max){
	d = new Date();
	var diff=0;
	while (diff < max){
		var ms=new Date();
		diff = ms-d ;
	}
}