

// redirect to a url

function redirectOption(obj) {



	target = obj.options[obj.selectedIndex].value

	if (target != "x") window.location.href = target;



}



function setDrops(theForm, day, month, year) {

	var now = new Date();

	var theday = now.getDate()-1;

	var themonth = now.getMonth();

	var theyear = now.getFullYear();

	if(day != "") theday = (day - 1);	
	
	if(month != "") themonth = (month - 1);
	
	if(year != "") theyear = year;
	
	
	theForm.day.selectedIndex = theday
	theForm.month.selectedIndex = themonth;

	var found = 0;
		

	for(i=1;i<theForm.year.options.length;i++) {

		if (theForm.year.options[i].value == theyear) {

			found = i;

			break;

		}

	}

	theForm.year.selectedIndex = found;

}



function update_day() {

	var ref = document.searchform;

	var target = ref.day;

	target.value = ref.Day.value;

}

function update_month() {

	var ref = document.searchform;

	var target = ref.month;

	target.value = ref.Month.value;

}

function update_year() {

	var ref = document.searchform;

	var target = ref.year;

	target.value = ref.Year.value;

}



// show the 'data' div

function showDataDiv(DivID) {

	turnOff('paymentDiv');

	turnOff('chequeDiv');

	turnOff('phoneDiv');

	turnOn(DivID);

}



// turn off function

function turnOff(DivID) {

	if (document.getElementById) { //gecko(NN6) & IE 5+

		document.getElementById(DivID).style.visibility = "hidden";

		document.getElementById(DivID).style.display = "none";

	} else if (document.all) { // IE 4+

		document.all[DivID].style.visibility = "hidden";

		document.all[DivID].style.display = "none";

	} else if (document.layers) { // NS4+

		document.layers[DivID].visibility = "hide";

		document.layers[DivID].display = "none";

	} else {

		// nothing

	}

}



// turn on function

function turnOn(DivID) {

	if (document.getElementById) { //gecko(NN6) & IE 5+

		document.getElementById(DivID).style.visibility = "visible";

		document.getElementById(DivID).style.display = "block";

	} else if (document.all) { // IE 4+

		document.all[DivID].style.visibility = "visible";

		document.all[DivID].style.display = "block";

	} else if (document.layers) { // NS4+

		document.layers[DivID].visibility = "show";

		document.layers[DivID].display = "block";

	} else {

	}

}



// boolean check for whether the dic is visible or not

function isVisible(DivID) {

	if (document.getElementById) { //gecko(NN6) & IE 5+

		if (document.getElementById(DivID).style.visibility == "visible") {

			return true;

		} else {

			return false;

		}

	} else if (document.all) { // IE 4+

		if (document.all[DivID].style.visibility = "visible") {

			return true;

		} else {

			return false;

		}

	} else if (document.layers) { // NS4+

		if (document.layers[DivID].visibility = "show") {

			return true;

		} else {

			return false;

		}

	} else {

		// nothing

	}

}
