<!--
	var version = parseInt (navigator.appVersion) ;

	NS4 = (navigator.appName.indexOf("Netscape") >= 0 && parseFloat(navigator.appVersion) >= 4);
	IE4 = navigator.appVersion.indexOf("MSIE") >= 0 && document.all != null;

	if (NS4){
		document.write('<link rel="stylesheet" type="text/css" href="/au/netscape.css">');
	}else{
		document.write('<link rel="stylesheet" type="text/css" href="/au/style.css">');
	}
// Common JavaScript Function
// Used by DreamWeaver

// Display status message
function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}

// Restore swap image
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

// Preload images
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

// commmon DM function 
function MM_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.getElementById(n); return x;
}

// swap images
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

// open centered browser window
function MM_openBrWindow(theURL,winName,features, myWidth, myHeight, isCenter) { //v3.0
  if(window.screen)if(isCenter)if(isCenter=="true"){
    var myLeft = (screen.width-myWidth)/2;
    var myTop = (screen.height-myHeight)/2;
    features+=(features!='')?',':'';
    features+=',left='+myLeft+',top='+myTop;
  }
  var w = window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);
  // if the popup window was opened then set the focus so it is always at the front
  if (w.constructor == window.constructor)
	{
		// Popup window was opened
		w.focus();
	}
}

function OpenBrowser(strURL, strName)
	{
		var newWindow;
		newWindow = window.open(strURL,strName,'resizable=yes,scrollbars=yes,menubar=no,toolbar=no,status=0');
	}

// opens link in parent window
function openParentWin(winLink){
window.opener.location.href = winLink;
window.close()
}

function getEmail(obj,receiver,domain)
{
	//asigns an e-mail address to the href atribute of the object being passed in.
	var a = String.fromCharCode(109,97,105,108,116,111,58); //mailto
	var b = String.fromCharCode(64) //@
	var c = String.fromCharCode(97,117,115,116,114,97,108,105,97,110,117,110,105,116,121,46,99,111,109,46,97,117) //australianunity.com.au
	
	switch (domain) {
	case '':
		obj.href = a + receiver + b + c
		break
	default:
		obj.href = a + receiver + b + domain
		break
	}
}

function getEmailText(receiver,domain)
{
	//returns the email address as a text string
	var b = String.fromCharCode(64) //@
	var c = String.fromCharCode(97,117,115,116,114,97,108,105,97,110,117,110,105,116,121,46,99,111,109,46,97,117) //australianunity.com.au
	
	switch (domain) {
	case '':
		return receiver + b + c
		break
	default:
		return receiver + b + domain
		break
	}
}

function date_dob(dtStr, currDate){

	var blnCheck = true;		

	//blnCheck = isDate(dtStr);		
	//var dt_dob = ParseDate(dtStr);
	var dt_dob = dtStr;
	var dt_today = ParseDate(currDate);
	
	if (dt_dob.getFullYear() < 1900)
	{
		blnCheck = false;
	}
			
	dt_today.setFullYear(dt_today.getFullYear()-16)
			
	if (Date.parse(dt_today) <= Date.parse(dt_dob)){				
		blnCheck = false;
	}      	
		return blnCheck;	
}


function ParseDate(str1){
        // Parse the string in DD/MM/YYYY format
        re = /(\d{1,2})\/(\d{1,2})\/(\d{4})/
        var arr = re.exec( str1 );
        return new Date( parseInt(arr[3]), parseInt(arr[2], 10) - 1, parseInt(arr[1], 10) );
}

/*--------------------------------------------------------------------------------------------------------------
							Date Functionality
--------------------------------------------------------------------------------------------------------------
*/
 
//
// uses the parseDateStr to parse the input date string into an array of date elements.
// If the input date string is valid a valid Date object is returned, otherwise, a structured error
// message is returned.  The error message is in the following format: <error-number>:<description>

var dtCh = "/";
var minYear=1900;
var maxYear = 3000;

function date_depdob(dtStr,currDate){

	var blnCheck;
		
	blnCheck = isDate(dtStr);		
	
	if (blnCheck){
		var dt_dob = ParseDate(dtStr);
		var dt_today = ParseDate(currDate);
				
		if (Date.parse(dt_today) < Date.parse(dt_dob)){
					
				blnCheck = false;
		}      
	}	
	return blnCheck;	
}

function date_dob(dtStr, currDate){

	var blnCheck = true;		

	//blnCheck = isDate(dtStr);		
	//var dt_dob = ParseDate(dtStr);
	var dt_dob = dtStr;
	var dt_today = ParseDate(currDate);
	
	if (dt_dob.getFullYear() < 1900)
	{
		blnCheck = false;
	}
			
	dt_today.setFullYear(dt_today.getFullYear()-16)
			
	if (Date.parse(dt_today) <= Date.parse(dt_dob)){				
		blnCheck = false;
	}      	
		return blnCheck;	
}

function ParseDate(str1){
        // Parse the string in DD/MM/YYYY format
        re = /(\d{1,2})\/(\d{1,2})\/(\d{4})/
        var arr = re.exec( str1 );
        return new Date( parseInt(arr[3]), parseInt(arr[2], 10) - 1, parseInt(arr[1], 10) );
}

function date_healthCover(dtStr, currDate){

	var blnCheck;
		
	blnCheck = isDate(dtStr);
		
	if (blnCheck){	
		var dt_maxStart = ParseDate(currDate);	
		var dt_Start = ParseDate(dtStr);
	
		dt_maxStart.setFullYear(dt_maxStart.getFullYear()+1)

		if (Date.parse(dt_Start) > Date.parse(dt_maxStart)){
				blnCheck = false;
		}	
	}
	return blnCheck;
}

function isInteger(s){
	var i;
    for (i = 0; i < s.length; i++){   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    return true;
}


function stripCharsInBag(s, bag){
	var i;
    var returnString = "";    
    for (i = 0; i < s.length; i++){   
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function daysInFebruary (year){
	// February has 29 days in any year evenly divisible by four,
    // EXCEPT for centurial years which are not also divisible by 400.
    return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}

function DaysArray(n) {
	for (var i = 1; i <= n; i++) {
		this[i] = 31
		if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
		if (i==2) {this[i] = 29}
   } 
   return this
}


function isDate(dtStr){

	var daysInMonth = DaysArray(12);
	var pos1 = dtStr.indexOf(dtCh);	
	var pos2 = dtStr.indexOf(dtCh,pos1+1);
	var strDay = dtStr.substring(0,pos1);
	var strMonth = dtStr.substring(pos1+1,pos2);
	var strYear = dtStr.substring(pos2+1);
	var isValidDate = true;
	
	strYr=strYear;
	
	if (strDay.charAt(0)=="0" && strDay.length>1) 
		strDay=strDay.substring(1);
	if (strMonth.charAt(0)=="0" && strMonth.length>1) 
		strMonth=strMonth.substring(1);
		
	for (var i = 1; i <= 3; i++) {
		if (strYr.charAt(0)=="0" && strYr.length>1) 
			strYr=strYr.substring(1);
	}
	
	month = parseInt(strMonth);
	day = parseInt(strDay);
	year = parseInt(strYr);
	
	if (pos1==-1 || pos2==-1){
		//alert("The date format should be : dd/mm/yyyy")
		isValidDate = false;
	}
	
	// Check Month
	if (strMonth.length<1 || month<1 || month>12){
		//alert("Please enter a valid month")
		isValidDate = false;
	}
	
	//Check Day
	if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
		//alert("Please enter a valid day")
		isValidDate = false;
	}
	
	if (strYear.length != 4 || year==0 || year<minYear){
		//alert("Please enter a valid 4 digit year starting from " + minYear)
		isValidDate = false;
	}
	
	if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
		//alert("Please enter a valid date");		
		isValidDate = false;
	}
return isValidDate;
}


function date_validateDateStr(dateStr){
	
	var ddmmyyyy = date_parseDateStr(dateStr);
	
	//Invalid format
	if(!ddmmyyyy){
		return -1;
	}
	if(ddmmyyyy[0] > 31){
		return ' Date';
	}
	if(ddmmyyyy[1] > 12){
	
		return ' Month';
	}
	//Rechecking the year length is 4
	if(ddmmyyyy[2].length > 4){
		return ' Year';
	}		
	var dt = new Date(ddmmyyyy[2], ddmmyyyy[1], ddmmyyyy[0] );
	//dt.setDate(ddmmyyyy[0]);	
	//dt.setMonth(ddmmyyyy[1]);
	//dt.setFullYear(ddmmyyyy[2]);		

	//
	// js Date class is very relax about date value, for example it happily accepts
	// something like 30/Feb/2006 - in doing so, it rolls the date forward to 2nd of March
	// this is because there's only 28 days for feb in 2006. 
	//
	// So the the following test to make sure that the day and month value has not rolled
	// after we've set date elements.
	//
	if(dt.getDate() != ddmmyyyy[0]){
		return ' Date';
	}
	if(dt.getMonth() != ddmmyyyy[1]){
			return ' Month';
	}
	if (dt.getFullYear() < 1900){
		return -2;
	}
	
	return dt;
	
}

//
// PRIVATE function - for internal use only
function date_splitDateElements(dateStr, separators){
	var res = null;
	
	for(j=0; j<separators.length; j++){
		res = dateStr.split(separators[j]);
		if(res && (res.length > 2)){
			break;
		}else{
			res = null;
		}
	}
	
	return res;
}
// return a zero-based month short name, eg. 0-> Jan, 1-> Feb etc..
function date_getMonthShortName(nthMonth){
	var MonthNames = new Array('Jan', 'Feb', 'Mar',
								'Apr', 'May', 'Jun', 
								'Jul', 'Aug', 'Sep',
								'Oct', 'Nov', 'Dec');
	if(nthMonth > MonthNames.length){
		return '';
	}
	return MonthNames[nthMonth];	   
}
function date_getMonthName(nthMonth){
	var MonthNames = new Array('January', 'February', 'March',
								'April', 'May', 'June', 
								'July', 'August', 'September',
								'October', 'November', 'December');	
								   	
	if(nthMonth > MonthNames.length){
		return '';
	}
	return MonthNames[nthMonth];	   
}
//
// this function parses the date string and returns an array containing 3 elements:
// dd, mm, yyyy - returns null if the input date string unrecognisable.
//
function date_parseDateStr(dateStr){

	// Following are recognisable date formats
	var ddmmyyyy    = /(\d{1,2})\/(\d{1,2})\/(\d{4})$/;			// dd mm yyyy, eg 23 01 2006
	var ddMonthyyyy = /(\d{1,2})\/([a-z]{3,})\/(\d{4})$/i;		// dd Month yyyy, eg. 23 Jan 2006, or 23 January 2006
	
	//Currently commented as it effecting finally VB Date Format -- ut_FormatDate
	//var ddmmyyyy    = /[0-9]{1,2}[\s+|\-|\/|\\][0-9]{1,2}[\s+|\-|\/|\\][0-9]{4}/;			// dd mm yyyy, eg 23 01 2006
	//var ddMonthyyyy = /[0-9]{1,2}[\s+|\-|\/|\\][a-z]{3,}[\s+|\-|\/|\\][0-9]{4}/i;		// dd Month yyyy, eg. 23 Jan 2006, or 23 January 2006
	var dateElementSeparators = new Array(" ", "-", "\\", "/");
	
	var MonthNames = new Array('Jan|January', 'Feb|February', 'Mar|March',
								'Apr|April', 'May', 'Jun|June', 
								'Jul|July', 'Aug|August', 'Sep|September',
								'Oct|October', 'Nov|November', 'Dec|December');		   
	var res;
		
	if(ddmmyyyy.test(dateStr)){	
		res = date_splitDateElements(dateStr, dateElementSeparators);
	}else if(ddMonthyyyy.test(dateStr)){
		res = date_splitDateElements(dateStr, dateElementSeparators);
		if(res){	
			var mIdx = 1;
			for(mIdx = 0; mIdx < MonthNames.length; mIdx++){ //(m in MonthNames){
				re = new RegExp(MonthNames[mIdx], 'i');
				if(re.test(res[1])){
					res[1] = mIdx+1;
					break;
				}
			}
			
			if(mIdx >= MonthNames.length){
				res = null;
			}
		}
	}
	
	if(res){
		// nth Month is zero based in Javascript
		res[1]--;	
	}	
	return res;
}
// returns a VBScript compatible date string
function date_toVbsCompatibleDateStr(dateStr){
	var dt = date_validateDateStr(dateStr);
	var vbsDateStr = "";
	if(dt instanceof Date){
		vbsDateStr = dt.getDate() + ' ' + date_getMonthName(dt.getMonth()) + ' ' + dt.getFullYear();
	}
	
	return vbsDateStr;
}

function dateValidationTests(){
	var dt;
	var testDates = new Array(
		//'23 01 2006', '23 Jan 2006', '23 January 2006',
		//'23 xx 2006', '34 01 2006', '29 Feb 2006',
		'23/01/2006', '23-01-2006',
		'23/Jan/2006',
		'28-Feb-2006');
			
	for (i=0; i<testDates.length; i++){		
		dt = testDates[i];
		var res = date_validateDateStr(dt);
		if(res instanceof Date){
			alert(dt + ' is a valid date:' + res);		
			alert('VB date:' + date_toVbsCompatibleDateStr(dt));
		}else{
			alert(dt + ' is not a valid date - ' + res);
		}
	}
}
/*--------------------------------------------------------------------------------------------------------------
							End Date Functionality
--------------------------------------------------------------------------------------------------------------
*/
/*
 * Credit card validator
 */
/* This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Created by: David Leppek :: https://www.azcode.com/Mod10

Basically, the alorithum takes each digit, from right to left and muliplies each second
digit by two. If the multiple is two-digits long (i.e.: 6 * 2 = 12) the two digits of
the multiple are then added together for a new number (1 + 2 = 3). You then add up the 
string of numbers, both unaltered and new values and get a total sum. This sum is then
divided by 10 and the remainder should be zero if it is a valid credit card. Hense the
name Mod 10 or Modulus 10. 
*/
function Mod10ChecksumValidate(ccNumb) {  // v2.0
	var valid = "0123456789"  // Valid digits in a credit card number
	var len = ccNumb.length;  // The length of the submitted cc number
	var iCCN = parseInt(ccNumb);  // integer of ccNumb
	var sCCN = ccNumb.toString();  // string of ccNumb
	sCCN = sCCN.replace (/^\s+|\s+$/g,'');  // strip spaces
	var iTotal = 0;  // integer total set at zero
	var bNum = true;  // by default assume it is a number
	var bResult = false;  // by default assume it is NOT a valid cc
	var temp;  // temp variable for parsing string
	var calc;  // used for calculation of each digit

	// Determine if the ccNumb is in fact all numbers
	for (var j=0; j<len; j++) {
		temp = "" + sCCN.substring(j, j+1);
		if (valid.indexOf(temp) == "-1"){bNum = false;}
	}

	// if it is NOT a number, you can either alert to the fact, or just pass a failure
	if(!bNum){
		/*alert("Not a Number");*/bResult = false;
	}

	// Determine if it is the proper length 
	if((len == 0)&&(bResult)){  // nothing, field is blank AND passed above # check
		bResult = false;
	} else{  // ccNumb is a number and the proper length - let's see if it is a valid card number
		if(len >= 15){  // 15 or 16 for Amex or V/MC
			for(var i=len;i>0;i--){  // LOOP throught the digits of the card
				calc = parseInt(iCCN) % 10;  // right most digit
				calc = parseInt(calc);  // assure it is an integer
				iTotal += calc;  // running total of the card number as we loop - Do Nothing to first digit
				i--;  // decrement the count - move to the next digit in the card
				iCCN = iCCN / 10;                               // subtracts right most digit from ccNumb
				calc = parseInt(iCCN) % 10 ;    // NEXT right most digit
				calc = calc *2;                                 // multiply the digit by two
				// Instead of some screwy method of converting 16 to a string and then parsing 1 and 6 and then adding them to make 7,
				// I use a simple switch statement to change the value of calc2 to 7 if 16 is the multiple.
				switch(calc){
					case 10: calc = 1; break;       //5*2=10 & 1+0 = 1
					case 12: calc = 3; break;       //6*2=12 & 1+2 = 3
					case 14: calc = 5; break;       //7*2=14 & 1+4 = 5
					case 16: calc = 7; break;       //8*2=16 & 1+6 = 7
					case 18: calc = 9; break;       //9*2=18 & 1+8 = 9
					default: calc = calc;           //4*2= 8 &   8 = 8  -same for all lower numbers
				}                                               
				iCCN = iCCN / 10;  // subtracts right most digit from ccNum
				iTotal += calc;  // running total of the card number as we loop
			}  // END OF LOOP
			if ((iTotal%10)==0){  // check to see if the sum Mod 10 is zero
				bResult = true;  // This IS (or could be) a valid credit card number.
			} else {
				bResult = false;  // This could NOT be a valid credit card number
			}
		}
	}
	// change alert to on-page display or other indication as needed.
//	if(bResult) {
//		alert("This IS a valid Credit Card Number!");
//	}
//	if(!bResult){
//		alert("This is NOT a valid Credit Card Number!");
//	}
	return bResult; // Return the results
}
//-->
