
	function checkInput(input)
	{
		/* convert to a number */
		input.value = parseInt(input.value);
		
		/* validate */
		if (input.value == "NaN") {
      alert('Please enter a numeric value');
			input.value = 0;
			input.focus();
			input.select();
			return false;
		}
		
		return true;
	}
	
	function formatCurrency(num)
	{
		num = num.toString().replace(/\$|\,/g,'');
		
		if(isNaN(num))
			num = "0";
			
		sign = (num == (num = Math.abs(num)));
		num = Math.floor(num*100+0.50000000001);
		cents = num%100;
		num = Math.floor(num/100).toString();
		
		if(cents<10)
			cents = "0" + cents;
			
		for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
			num = num.substring(0,num.length-(4*i+3))+','+
				num.substring(num.length-(4*i+3));

		return (((sign)?'':'-') + num + '.' + cents);
	}
	
	function toCurrency(floatinput)
	{
//		return formatCurrency( Math.round(100.00 * floatinput) / 100.00 );
		return formatCurrency( floatinput );
	}


	/*
	============================================================
	Script:     Random Quote
	
	Functions:  This simple script allows you to print random
							quotations in the page.  Any number of quotes
							may be used.
							
	Browsers:   All
	
	Author:     etLux
	============================================================
	
	NOTE:
		In quotation 8, note the text, \"beauty\" -- if you need
		to use double-quote " marks, you *must* precede each
		double-quote with a backslash \... otherwise the script
		will break.
	*/
	
	// ==============================================
	// Copyright 2004 by CodeLifter.com
	// Free for all; but please leave in this header.
	// ==============================================
	
	function showQuotation()
	{
		var Quotation=new Array();
		
		// Set up the quotations to be shown, below.
		// To add more quotations, continue with the pattern, adding to the array.
		// Remember to increment the Quotation[x] index!
	
		Quotation[0] = "Oxygen is a necessary component in every chemical reaction important to human physiology.";
		Quotation[1] = "We can survive without water for a few days and without food for literally weeks but without oxygen we can only live for a few minutes.";
		Quotation[2] = "Nutrients in our bodies, such as proteins, carbohydrates and fats must have a constant supply of oxygen to convert \"potential\" energy.";
		Quotation[3] = "\"Oxygen Debt\" is now a significant issue with sports people.";
		Quotation[4] = "Physical Stress consumes large quantities of oxygen and, therefore, reduces the supply to numerous cells and tissues throughout the body.";
		Quotation[5] = "Australians are renowned worldwide for their high participation rates and achievements in sport, and for their strong anti-drug stance.";
		Quotation[6] = "Proper oxygenation allows the body to produce and supply ATP to the muscles, giving them strength and elasticity.";
		Quotation[6] = "A lack of oxygen (hypoxia) causes the body to produce an oxygen-deficient form of ATP called lactic acid. reducing muscle efficiency.";
		Quotation[7] = "Sports OxyShot is 100% Australian owned and manufactured. It is totally 100% non-toxic and drug-free";
	
		var Q = Quotation.length;
		var whichQuotation=Math.round(Math.random()*(Q-1));
		
		document.write(Quotation[whichQuotation]);
	}
	
	
	function showDate() {
			var mydate=new Date()
			var year=mydate.getYear()
			if (year < 1000)
				year+=1900
			var day=mydate.getDay()
			var month=mydate.getMonth()
			var daym=mydate.getDate()
			var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
			var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December")
			document.write(dayarray[day]+", "+montharray[month]+" "+daym+", "+year)
	}
	
	
	
	
	//-- Original concept by Cameron Gregory cameron@corona.att.com
	
	var tickertapeform
	tt_speed=350;
	tt_len=35;
	tt_space="                                                                                                    ";
	tt_tid = 0;
	tt_message=".";
	tt_c= -tt_len;
	
	function move() {
		cend=Math.min(tt_c+tt_len,tt_message.length);
		if (tt_c <0)
			cstart=0;
		else
			cstart=tt_c;
		if (tt_c < 0)
			tt_f.scroll.value=tt_space.substring(0,-tt_c) + tt_message.substring(cstart,cend);
		else
			tt_f.scroll.value=tt_message.substring(cstart,cend);
	
		tt_c = tt_c +1;
		if (tt_c == tt_message.length ) tt_c = -tt_len;
		tt_tid=window.setTimeout("move()",tt_speed);
	}
	
	function tt_start(x) {
		tt_f=x;
		tt_tid=window.setTimeout("move()",tt_speed);
	}
	
	function tt_cleartid() {
		window.clearTimeout(tt_tid);
	}
	
	// for some reason on some pages this crashes netscape
	function ticker(m,l,s)
	{
		tt_message=m;
		tt_len=l;
		tt_speed=s;
		
		document.write('<FORM name=tickertapeform><input name=scroll class="tickerAppearance" size=');
		document.write(tt_len);
		document.write(' value=""></FORM>');
		tt_start(document.tickertapeform);
	}
	
	
	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 YY_checkform() { //v4.66
	//copyright (c)1998,2002 Yaromat.com
		var args = YY_checkform.arguments; var myDot=true; var myV=''; var myErr='';var addErr=false;var myReq;
		for (var i=1; i<args.length;i=i+4){
			if (args[i+1].charAt(0)=='#'){myReq=true; args[i+1]=args[i+1].substring(1);}else{myReq=false}
			var myObj = MM_findObj(args[i].replace(/\[\d+\]/ig,""));
			myV=myObj.value;
			if (myObj.type=='text'||myObj.type=='password'||myObj.type=='hidden'){
				if (myReq&&myObj.value.length==0){addErr=true}
				if ((myV.length>0)&&(args[i+2]==1)){ //fromto
					var myMa=args[i+1].split('_');if(isNaN(myV)||myV<myMa[0]/1||myV > myMa[1]/1){addErr=true}
				} else if ((myV.length>0)&&(args[i+2]==2)){
						var rx=new RegExp("^[\\w\.=-]+@[\\w\\.-]+\\.[a-z]{2,4}$");if(!rx.test(myV))addErr=true;
				} else if ((myV.length>0)&&(args[i+2]==3)){ // date
					var myMa=args[i+1].split("#"); var myAt=myV.match(myMa[0]);
					if(myAt){
						var myD=(myAt[myMa[1]])?myAt[myMa[1]]:1; var myM=myAt[myMa[2]]-1; var myY=myAt[myMa[3]];
						var myDate=new Date(myY,myM,myD);
						if(myDate.getFullYear()!=myY||myDate.getDate()!=myD||myDate.getMonth()!=myM){addErr=true};
					}else{addErr=true}
				} else if ((myV.length>0)&&(args[i+2]==4)){ // time
					var myMa=args[i+1].split("#"); var myAt=myV.match(myMa[0]);if(!myAt){addErr=true}
				} else if (myV.length>0&&args[i+2]==5){ // check this 2
							var myObj1 = MM_findObj(args[i+1].replace(/\[\d+\]/ig,""));
							if(myObj1.length)myObj1=myObj1[args[i+1].replace(/(.*\[)|(\].*)/ig,"")];
							if(!myObj1.checked){addErr=true}
				} else if (myV.length>0&&args[i+2]==6){ // the same
							var myObj1 = MM_findObj(args[i+1]);
							if(myV!=myObj1.value){addErr=true}
				}
			} else
			if (!myObj.type&&myObj.length>0&&myObj[0].type=='radio'){
						var myTest = args[i].match(/(.*)\[(\d+)\].*/i);
						var myObj1=(myObj.length>1)?myObj[myTest[2]]:myObj;
				if (args[i+2]==1&&myObj1&&myObj1.checked&&MM_findObj(args[i+1]).value.length/1==0){addErr=true}
				if (args[i+2]==2){
					var myDot=false;
					for(var j=0;j<myObj.length;j++){myDot=myDot||myObj[j].checked}
					if(!myDot){myErr+='* ' +args[i+3]+'\n'}
				}
			} else if (myObj.type=='checkbox'){
				if(args[i+2]==1&&myObj.checked==false){addErr=true}
				if(args[i+2]==2&&myObj.checked&&MM_findObj(args[i+1]).value.length/1==0){addErr=true}
			} else if (myObj.type=='select-one'||myObj.type=='select-multiple'){
				if(args[i+2]==1&&myObj.selectedIndex/1==0){addErr=true}
			}else if (myObj.type=='textarea'){
				if(myV.length<args[i+1]){addErr=true}
			}
			if (addErr){myErr+='* '+args[i+3]+'\n'; addErr=false}
		}
		if (myErr!=''){alert('The required information is incomplete or contains errors:\t\t\t\t\t\n\n'+myErr)}
		document.MM_returnValue = (myErr=='');
	}
	
	function MM_validateForm() { //v4.0
		var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
		for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
			if (val) { nm=val.name; if ((val=val.value)!="") {
				if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
					if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
				} else if (test!='R') { num = parseFloat(val);
					if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
					if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
						min=test.substring(8,p); max=test.substring(p+1);
						if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
			} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
		} if (errors) alert('The following error(s) occurred:\n'+errors);
		document.MM_returnValue = (errors == '');
	}
