function validateField(id)
{

	if (!$(id).value)
	{
		$(id).style.border = "1px solid #FF0000";
		$(id).style.background = "#ffc"; 
		return false;
	}
	else
	{
		$(id).style.border = "";
		$(id).style.background = ""; 
	}

}//end

function validateEmail(email_id) 
{

   var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
   var address = $(email_id).value;
   if(reg.test(address) == false) {
			$(email_id).style.border = "1px solid #FF0000";
			$(email_id).style.background = "#ffc"; 
			return false;
   }
   else
   {
			$(email_id).style.border = "";
			$(email_id).style.background = ""; 
   }
   
}// end

function compareFields(id1,id2,error_id)
{

	if (!$(id1).value || !$(id2).value) 
	{
			$(error_id).style.border = "1px solid #FF0000";
			$(error_id).style.background = "#ffc"; 
			return false;
	} else {

		if ($(id1).value != $(id2).value) {
			$(error_id).style.border = "1px solid #FF0000";
			$(error_id).style.background = "#ffc"; 
			return false;
		} else {
			$(error_id).style.border = "";
			$(error_id).style.background = ""; 
		}

	}	
	
}// end

function updateSelect(type,id)
{

new Ajax.Updater('',"ajax_functions.php", 
{ 
	method: "post",
	parameters: 
	{
		mode: 'updateSelect',
		type: type,
		id: $(id).value
	},
	onSuccess: function(transport) 
	{
		$(type+'_list').innerHTML = transport.responseText;	
	}
});

}// end
