//scroller javascript starts

var scrspeed=1.0;
var timSpeed=10,contHeight=100,active=0;
var scrollTim;
var jScroll,oScroll;




 

function makeScrollObj() {

	if (document.layers) {
		this.css = document.divCont1.document.divScroll2;
		this.scrollHeight = this.css.document.height;

	} else if (document.all) {
		this.css = document.all.divScroll2.style;
		this.scrollHeight = document.all.divScroll2.offsetHeight;
	}

        this.top = rtop;

        return this;

}


function rtop() {

	if (document.layers) {
        	return this.css.top;
	} else if (document.all) {
		return this.css.pixelTop;
	}

}

function submitdetailform() {
  if (verify_booking_details()){
	 document.form_1.submit()
  }
}

function verify_booking_details() {
	// Amount //
	if (document.form_1.strTotalCost.value == ""){
		alert ("Please Enter The Amount");
		document.form_1.strTotalCost.focus();
		return false;
	}
	
	// Amount must be numeric //
	if (checkNumeric(document.form_1.strTotalCost,1,'','','','',' ') == false){
		alert ("Amount must be numeric");
		document.form_1.strTotalCost.focus();
		return false;
	}
	
	// Credit Card Number //
	if (document.form_1.strCardNumber.value == ""){
		alert ("Please Enter The Credit Card Number");
		document.form_1.strCardNumber.focus();
		return false;
	}
	
	// Credit Card Number Length //
	if (document.form_1.strCardNumber.value.length != 16){
		alert ("Credit Card Number Must Be 16 Long");
		document.form_1.strCardNumber.focus();
		return false;
	}
	
	// Reference //
	if (document.form_1.strReference.value == ""){
		alert ("Please Enter The Reference");
		document.form_1.strReference.focus();
		return false;
	}
				
	return true;
}

function checkNumeric(objName,minval, maxval,comma,period,hyphen,space)
{
	var numberfield = objName;
	if (chkNumeric(objName,minval,maxval,comma,period,hyphen,space) == false)
	{
		numberfield.select();
		numberfield.focus();
		return false;
	}
	else
	{
		return true;
	}
}

function chkNumeric(objName,minval,maxval,comma,period,hyphen,space)
{
// only allow 0-9 be entered, plus any values passed
// (can be in any order, and don't have to be comma, period, or hyphen)
// if all numbers allow commas, periods, hyphens or whatever,
// just hard code it here and take out the passed parameters
var checkOK = "0123456789." + comma + period + hyphen + space;
var checkStr = objName;
var allValid = true;
var decPoints = 0;
var allNum = "";

for (i = 0;  i < checkStr.value.length;  i++)
{
ch = checkStr.value.charAt(i);
for (j = 0;  j < checkOK.length;  j++)
if (ch == checkOK.charAt(j))
break;
if (j == checkOK.length)
{
allValid = false;
break;
}
if (ch != ",")
allNum += ch;
}
if (!allValid)
	{	
	alertsay = "Please enter only these values \""
	//alertsay = alertsay + checkOK + "\" in the \"" + checkStr.name + "\" field."
	alertsay = alertsay + checkOK + "\" in this field."
	//alert(alertsay);
	return (false);
	}
}



function scroll(speed) {

        var way=speed>0?1:0;

        if ((!way && oScroll.top()>-oScroll.scrollHeight+contHeight) || (oScroll.top()<0 && way)) 
        {
                oScroll.css.top=oScroll.top()+speed;
                scrollTim = setTimeout('scroll('+speed+')',timSpeed);
        }

}


function noScroll() 
{

        clearTimeout(scrollTim);

}


function scrollInit() 
{
	oScroll=new makeScrollObj('divScroll2','divCont1');

	if (document.layers != null) 
        {
		oScroll.css.visibility='show';

	} 
        else if (document.all) 
        {
		oScroll.css.visibility = 'visible'; 
	}

}




