	// CHECK CLIENT BROWSER & PLATFORM
// RESULT:	ua	= userAgent
//			an	= appName
//			av	= application version 5.5/6.0/etc.
//			ie	= true/false
//			ns	= true/false
//			mac	= true/false
//			dom	= true/false
	var ua	= navigator.userAgent.toLowerCase();
	var an	= navigator.appName.toLowerCase();
	var av	= parseFloat(navigator.appVersion.slice(0, navigator.appVersion.indexOf(' ')));
	
	var ie	= (an.indexOf('microsoft internet explorer') >= 0);
	var ns	= (an.indexOf('netscape') >= 0);
	var mac	= (ua.indexOf('mac') >= 0);
	var dom = (document.getElementById) ? true : false;
	
	if (ua.indexOf('msie') >= 0) { av = parseFloat(ua.slice(ua.indexOf('msie') + 5, ua.indexOf(';', ua.indexOf('msie') + 5))); }
//	alert( 'User Agent:\n\tua = ' + ua + '\n\nApplication Name:\n\tan = ' + an + '\n\nApplication Version:\n\tav = ' + av + '\n\nInternet Explorer:\n\tie = ' + ie + '\n\nNetscape:\n\tns = ' + ns + '\n\nMacintosh:\n\tmac = ' + mac + '\n\nDOM Compliant:\n\tdom = ' + dom);

	
	
	var client = new IdentifyClient();
	

	// Check client browser & platform specifics
	function IdentifyClient() {
		this.agent = navigator.userAgent.toLowerCase();
		this.name = navigator.appName.toLowerCase();
		this.version = parseFloat(navigator.appVersion.slice(0, navigator.appVersion.indexOf(' ')));
		
		this.ie = (this.name.indexOf('microsoft internet explorer') >= 0);
		this.ns = (this.name.indexOf('netscape') >= 0);
		this.mac = (this.name.indexOf('mac') >= 0);
//		var dom = (document.getElementById) ? true : false;
		var dom = true;
		
		if (this.agent.indexOf('msie') >= 0) { this.version = parseFloat(this.agent.slice(this.agent.indexOf('msie') + 5, this.agent.indexOf(';', this.agent.indexOf('msie') + 5))); }
		
		return this;
	}



	// Launch pop-up window
	// Requires:	IdentifyClient
	function LaunchWindow( psWindowURL, psWindowName, piWidth, piHeight, pbResizable, pbScrollbars, pbMenubar, pbToolbar, pbLocation, pbStatus ) {
		if (client.mac) {
			if (client.ie && client.version >= 4 && client.version < 5) piHeight = parseInt(piHeight + 17);
		}
		var windowAttribs = 'width=' + piWidth + ',height=' + piHeight + ',resizable=' + Number(pbResizable) + ',scrollbars=' + Number(pbScrollbars) + ',menubar=' + Number(pbMenubar) + ',toolbar=' + Number(pbToolbar) + ',location=' + Number(pbLocation) + ',status=' + Number(pbStatus);
		var win = window.open(psWindowURL, psWindowName, windowAttribs);
		if (win != null) {
			if (win.opener == null) win.opener = self;
		}
		win.focus();
		
		return win;
	}


	function CreateObject(imgName, imgSrc) {
		if (dom) {
			var tempImg = document.createElement("img");
			tempImg.src = imgSrc;
			tempImg.id = imgName;
			tempImg.style.visibility = 'hidden';
			tempImg.style.position = 'absolute';
			tempImg.style.top = 0;
			document.body.appendChild(tempImg);
		} else {
			eval(imgName+' = new Image()');
			eval(imgName+'.src = "'+imgSrc+'"');
		}
	}


	// Changes the image source
	// Requires:	IdentifyClient
	function ChangeImage( psImageRef, psImageVariable ) {
		var loImg = (client.dom) ? document.getElementById(psImageRef) : document.images[psImageRef];
		if (client.dom) {
			var loImageElement = document.getElementById(psImageVariable);
			if (loImg && loImageElement) loImg.setAttribute("src", loImageElement.getAttribute("src"));
		} else { loImg.src = eval(psImageVariable + ".src"); }
	}

	
	function ToggleCalendar( psCalendarID ) {
		var loCal = document.getElementById(psCalendarID);
		
		if (loCal) {
			loCal.style.display = (loCal.style.display != 'inline') ? 'inline' : 'none';
		} else {
			alert("calendar not found");
		}
	}
	
	