/////////////////////////////////////////////////////////////////
//
// JavaScript Shared Functions for Information4U policy
// (c) 2000,2001 GlendaleSystems.com Ltd.
//
//
////////////////////////////////////////////////////////////////


function syncTOC(){
   if(window.name!="glossary"){
	if(document.all && parent.toc.document.easyhh_toc){
		if(parent.toc.synchroniseTOC) parent.toc.synchroniseTOC();
	}
   }
}

//Create the chmfile object for each page
var chmfile = new Object();
    chmfile.fullname = "";
    chmfile.name = "";
    chmfile.path = "";
    chmfile.page = "";
getchmfile();


function getchmfile(){
	var ra, sl, a, X, Y, Z;
	ra = /:/;
	a = location.href.search(ra);
	sl = "::";
	Y = location.href.lastIndexOf(sl);
	if (a == 4) {		// file: or http: 
		Y = location.href.lastIndexOf("/");
		chmfile.page = unescape(location.href.substring(Y+1));
		if(location.href.substring(0,4) == "file"){
			chmfile.path = unescape(location.href.substring(8, Y+1));
			}
		}
	else	{
		if (a == 2) X = 14;	// mk:@MSITStore: 
		if (a == 7) X = 7;	// ms-its: 
		chmfile.fullname = unescape(location.href.substring(X, Y));
		Z = chmfile.fullname.lastIndexOf("\\");
		chmfile.path = unescape(chmfile.fullname.substring(0, Z+1));
		chmfile.name = unescape(chmfile.fullname.substring(Z+1));
		chmfile.page = unescape(location.href.substring(Y+3));
	}
//	alert(location.href+"\n\n"+"fullname="+chmfile.fullname+"\n"+"path="+chmfile.path+"\n"+"name="+chmfile.name+"\n"+"page="+chmfile.page);
}



function callCHMpage(newCHM, newHTM) {

//	wURL="ms-its:" + newCHM +"::/"+ newHTM;
	wURL=newHTM.toLowerCase();
	wFeatures = "left=100,top=100,width=500,height=310,scrollbars=yes,resizable=yes"

	w=window.open("","glossary", wFeatures);
	w.document.write("<font color=white face=arial>Loading...please wait</font>");
	w.document.bgColor="#3333CC";
	w.location.href = wURL;
	w.focus();
}


function showpolicy(reference)
{//alert("ShowPolicy("+reference+")");
	var referenceUrl = "policies/pol"+reference+".txt";
	//alert(referenceUrl);
	policyWindow=window.open(referenceUrl,'PolicyWindow', 'width=600,height=300,resizable=yes,location=no,scrollbars=yes,toolbar=no,status=no');
	policyWindow.focus();
}

/////////////////////////////////////////////////////////////////
//
// End of JavaScript Shared Functions
//
/////////////////////////////////////////////////////////////////
