
function SetPageVariables() {



	// set the following variables :
	// this.IE50  - browser = IE 5.0 - 5.49
	// this.IE55up - browser = IE 5.5+
	// this.Mozzies - browser = netscape 7+ and mozilla family
	// this.BrowserIsCompatible - Site is designed for IE 5+ & Netscape 7+ & Mozillas
	// this.PageMode - what mode is this page? G = Graphic, P = Printer Friendly, T = Text

	// browser compatibility ...
	// only intersted in IE 5+, NS7+ and Mozzie family.

	var agent = navigator.userAgent.toLowerCase();
	var version = parseInt(navigator.appVersion);
	var appVer = navigator.appVersion.toLowerCase();
	var iePos  = appVer.indexOf('msie');
	var ieVer = appVer.substring(iePos+5,appVer.indexOf(';',iePos)) ;

	Opera = (agent.indexOf('opera') != -1) ;

	this.IE50 = ( ( iePos !=-1 ) && ( ( parseFloat(ieVer) >=5.0 ) &&  ( parseFloat(ieVer) <5.5 ) ) && !( Opera ) ) ;
	this.IE55up = ( ( iePos !=-1 ) && ( parseFloat(ieVer) >=5.5 ) && !( Opera ) ) ;

	NS6 = (agent.indexOf('netscape/6') !=-1 ) || (agent.indexOf('netscape6') !=-1 ) ;
	NSC = ((agent.indexOf('mozilla')!=-1) && ((agent.indexOf('spoofer')==-1) && (agent.indexOf('compatible') == -1)) && (version >=5 ) );

	this.Mozzies = ( NSC && !( NS6 || Opera ) ) ;
	this.BrowserIsCompatible = ( IE50 || IE55up || Mozzies ) ;


	// set PageMode for the menu hover mimic code and text-only code.

	var cookieName = 'ICCA_ViewMode' ;

	var pmvalue = ( BrowserIsCompatible ) ? 'G' : 'T' ;


	var docloc = window.location.href.toLowerCase() ;
	var ppf = ( docloc.indexOf('&ppf') != -1 ) ;

	if ( ppf )
	{
		pmvalue = 'P' ;
	}

	else if ( document.cookie )

	{
		index = document.cookie.indexOf(cookieName);
		if ( index >=0 ) 
		{
			pmvalue = document.cookie.substr( index + cookieName.length +1 , 1 ) ;
		}
	} 

	this.PageMode = pmvalue ;

	return true ;

}



// set global variables ..
SetPageVariables() ;


// mimic the hover behaviour for the top menu bar 
// for use with IE flavour browsers
// - when PageMode != G, it stops the mimic hover menu and prevents js error messages

startList = function() {
if (document.all&&document.getElementById) 
{
	if ( PageMode == 'G' ) 
	{
		navRoot = document.getElementById('nav');
		for (i=0; i<navRoot.childNodes.length; i++) 
		{
			node = navRoot.childNodes[i];
			if (node.nodeName=='LI') 
			{
				node.onmouseover=function() 
				{
					this.className+=' over';
				}
				node.onmouseout=function() 
				{
					this.className=this.className.replace(' over', '');
				}
			}
		}
	}
}
}


// load in another stylesheet - customised for certain browsers .. - this is for the drop-down menus
if ( PageMode == "G" ) {

	if ( IE50 ) {
		document.write( '<LINK REL=STYLESHEET TYPE="text/css" HREF = "/Sectors/ICCA/webiccaa.nsf/vLA/css_extra/$File/common_IE50_style.css">' ) ;
		// window.onload=startList; - disabled because another onload event will disable this one ... so use attachEvent.
		if (window.attachEvent) window.attachEvent("onload", startList);
	}

	else if ( IE55up )
	{
		document.write( '<LINK REL=STYLESHEET TYPE="text/css" HREF = "/Sectors/ICCA/webicca.nsf/vLA/css_extra/$File/common_IE55_style.css">' ) ;
		// window.onload=startList; - disabled because another onload event will disable this one ... so use attachEvent.
		if (window.attachEvent) window.attachEvent("onload", startList);
	}

	else if ( Mozzies )
	{
		document.write( '<LINK REL=STYLESHEET TYPE="text/css" HREF = "/Sectors/ICCA/webicca.nsf/vLA/css_extra/$File/common_MOZ_style.css">' ) ;
	}
}


// switch page mode .. for switching between graphic and text mode ..
function SwitchPageMode( pmode ) {
	var cookieName = 'ICCA_ViewMode' ; 
	var cexpire = new Date() ;
	cexpire.setFullYear( cexpire.getFullYear() +1 ) ; 

	pgmode = ( BrowserIsCompatible ) ? pmode : 'T' ;
	document.cookie = cookieName + '=' + pgmode + '; expires=' + cexpire.toGMTString() + '; path=/;' ; 
	window.location.reload( true )
}


function openPopup( srcfile ) 
{
	var wTmp = window.open(srcfile, "_puDetails", "width=540,height=400,left=55,top=40,scrollbars=yes,status=no,toolbar=no,menubar=no" );
	wTmp.focus();

}

