function Preview(name) {

	var prevWnd=window.open("", name, "width=555,height=414,scrollbars=yes,resizable=yes,status=0");

	prevWnd.document.open();

	prevWnd.document.writeln('<html><title>Preview of Photo</title><body bgcolor=#ffffff>');

	prevWnd.document.writeln('<center><img src="g_images/' + name + '.jpg" border="0"></center>');

	prevWnd.document.writeln('</body></html>');

	prevWnd.document.close();

}



function formSubmit()
{
	if (document.all || document.getElementById) {
		var frm = document.Registration;

		if (frm.first_name.value.length==0) {
			window.alert("Please enter your First Name.");
			frm.first_name.select();
			frm.first_name.focus();
			return false;
		}
		
		if (frm.last_name.value.length==0) {
			window.alert("Please enter your Last Name.");
			frm.last_name.select();
			frm.last_name.focus();
			return false;
		}
		function testemail(src) {
			var emailReg = "^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[\\w]$";
			var regex = new RegExp(emailReg);
			return regex.test(src);
		}
		if (!testemail(frm.email.value)) {
			window.alert("Please enter your Email or verify it is formated correctly.");
			frm.email.select();
			frm.email.focus();
			return false;
		}



		if (frm.country.selectedIndex == 0) {

			window.alert("Please select your Country.");

			frm.country.focus();

			return false;

		}



		if (frm.city.value.length==0) {

			window.alert("Please enter your City.");

			frm.city.select();

			frm.city.focus();

			return false;

		}



		if (frm.gender.selectedIndex == 0) {

			window.alert("Please select your Gender.");

			frm.gender.focus();

			return false;

		}



		if (frm.occupation.selectedIndex == 0) {

			window.alert("Please select your Occupation.");

			frm.occupation.focus();

			return false;

		}

	}

}

function donateFormSubmit(){
	if (document.all || document.getElementById) {
		var frm = document.Registration;

		if (frm.first_name.value.length==0) {
			window.alert("Please enter your First Name.");
			frm.first_name.select();
			frm.first_name.focus();
			return false;
		}

		if (frm.last_name.value.length==0) {
			window.alert("Please enter your Last Name.");
			frm.last_name.select();
			frm.last_name.focus();
			return false;
		}
		if (frm.country.selectedIndex == 0) {
			window.alert("Please select your Country.");
			frm.country.focus();
			return false;
		}
		if(frm.phone.value.length == 0){
			alert('Please enter your phone number');
			frm.phone.select();
			frm.phone.focus();
			return false;
		}
		function testemail(src){
			var emailReg = "^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[\\w]$";
			var regex = new RegExp(emailReg);
			return regex.test(src);
		}
		if (!testemail(frm.email.value)) {
			window.alert("Please enter your Email or verify it is formated correctly.");
			frm.email.select();
			frm.email.focus();
			return false;
		}
		if(frm.amount.value.length == 0){
			alert('Please enter an amount in order to process payment.');
			frm.amount.select();
			frm.amount.focus();
			return false;
		}
		if(isNaN(frm.amount.value)){
			alert("Please enter a numeric value");
			frm.amount.select();
			frm.amount.focus();
			return false
		}
		if(frm.currency[frm.currency.selectedIndex].value == "Select Currency"){
			alert("Please select a currency");
			return false;
		}
		if(frm.currency[frm.currency.selectedIndex].value == "422" && frm.amount.value.indexOf(".") >= 0){
			alert("Decimal places are not allowed for LBP (Lebanese Pound). Please remove it to proceed.");
			frm.amount.select();
			frm.amount.focus();			
			return false;
		}

		frm.Submit.value='One Moment Please...';
		frm.Submit.disabled=true;
	}

}



function display_todays_date(){

var today = new Date();

var numerical_day=today.getDay();

var numerical_month=today.getMonth();

var date=today.getDate();

var year=today.getFullYear();

var weekday_array = new

Array('Sunday','Mon','Tue','Wed','Thu','Fri','Sat');

var day_of_the_week = weekday_array[numerical_day];

var month_array = new Array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');

var month_name = month_array[numerical_month];

var now = new Date();

var hours = now.getHours();

var minutes = now.getMinutes();

var timeValue = "" + ((hours >12) ? hours -12 :(hours ==0) ? hours +12 :hours);

timeValue += ((minutes < 10) ? ":0" : ":") + minutes;

timeValue += (hours >= 12) ? " PM" : " AM";

var date_string=day_of_the_week+' '+month_name+' '+date+', '+year+' - '+timeValue;

document.write(date_string);

}