

function checkContent(){

 
	
            if(document.getElementById("amount").value == "" || CurrencyFormatted(document.getElementById("amount").value)==-1){

                        alert("Please enter a number in the Amount box")

                        return -1;

            }

            else if(document.getElementById("os0").value == "" || isNaN(document.getElementById("os0").value)){

                        alert("Please enter a reference number in the Reference Number box")

                        return -1;

            }

 

            document.getElementById("amount").value = CurrencyFormatted(document.getElementById("amount").value)
			document.paypal.submit();
}

 

//check the currency,

function CurrencyFormatted(amount)

{
            var i = parseFloat(amount);

            //if value is not numeric return -1

            if(isNaN(i)){

                        return -1;

            }

 

            //if they are inserting a minus number return -1

            if(i < 0){

                        return -1;

            }

 

            //returns the absolute value

            i = Math.abs(i);

            i = parseInt((i + .005) * 100);

            i = i / 100;

            s = new String(i);

            //format decimal point

            if(s.indexOf('.') < 0){

                        s += '.00';

            }

 

            if(s.indexOf('.') == (s.length - 2))

                        { s += '0';

            }

 

            return s;

}

 

