var PHONE_NUMBER_MESSAGE="Your phone number must consist ONLY of numbers without any spaces or other characters such as the + sign";

function Trim(str)
{

  return LTrim(RTrim(str));

}

function LTrim(str)
{

  for (var i=0; str.charAt(i)==" "; i++)
  {
    str =  str.substring(i,str.length-1);
  }
  return str;
}


function RTrim(str)
{

  for (var i=str.length-1; str.charAt(i)==" "; i--)
  {
    str = str.substring(0,i);
  }
  return str;
}
function numbersonly(myfield, e, dec)
{
    var key;
    var keychar;

    if (window.event)
       key = window.event.keyCode;
    else if (e)
       key = e.which;
    else
       return true;
    keychar = String.fromCharCode(key);

    // control keys
    if ((key==null) || (key==0) || (key==8) || 
        (key==9) || (key==13) || (key==27) || (key==46))
       return true;

    // numbers
    else if ((("0123456789").indexOf(keychar) > -1))
       return true;
    // decimal point jump
    else if (dec && (keychar == "."))
       {
       myfield.form.elements[dec].focus();
       return false;
       }
    else
       return false;
}
function remove0_numbersonly(myfield, e, dec)
{
    var key;
    var keychar;

    if (window.event)
       key = window.event.keyCode;
    else if (e)
       key = e.which;
    else
       return true;
    keychar = String.fromCharCode(key);

    // control keys
    if ((key==null) || (key==0) || (key==8) || 
        (key==9) || (key==13) || (key==27) )
       return true;
     // numbers
    else if ((("0123456789").indexOf(keychar) > -1))
       return true;
      // decimal point jump     
    else if (key==46)
        return false;
    
    else
       return false;
   
}

function frmdonorupdate_validate()
{
    if(frmdonorupdate.cc_card_Type_id.value=="0")
	{
		alert('Please select card type');
		frmdonorupdate.cc_card_Type_id.focus();
		return false;
	}
	if(Trim(document.frmdonorupdate.cc_nameoncard.value)=="")
	{
		alert('Please enter name on card');
		frmdonorupdate.cc_nameoncard.focus();
		return false;
	}
	
	cc_number = frmdonorupdate.cc_number.value;    	
	if(cc_number=="")
    {
	    alert("Please enter credit card no !");
	    frmdonorupdate.cc_number.focus();
	    return false;
    }

    ccflag=0;
    subfirst = cc_number.substr(0,cc_number.length-4);
    sublast = cc_number.substr(cc_number.length-4,cc_number.length);
    str = "";
    for(i=0;i<subfirst.length;i++)
    {
        str = str + "X";
    }
    
    if(((str!=subfirst) && isNaN(subfirst)) || isNaN(sublast))
    {
        alert("Please enter a valid credit card no !");
       frmdonorupdate.cc_number.focus();
       return false;
    }
    if(cc_number.length<13 || cc_number.length>16)
    {
        alert("Please enter a valid credit card no !");
       frmdonorupdate.cc_number.focus();
       return false;
    }		
}

function checkcard()
{
 if(Trim(document.frmdonation.cc_card_Type_id.value)=="")
    {
        alert('Please select card type');
        frmdonation.cc_card_Type_id.focus();
        return false;
    }
 if(Trim(document.frmdonation.cc_nameoncard.value)=="")
    {
        alert('Please enter Name on Card');
        frmdonation.cc_nameoncard.focus();
        return false;
    }
    if(document.frmdonation.cc_number.value=="")
    {
        alert('Please enter Card no.');
        frmdonation.cc_number.focus();
        return false;
    }    
    if(frmdonation.cc_number.value.length>16)
    {
        alert('Please enter Card no. in 16 digit');
        frmdonation.cc_number.focus();
        return false;
    }
    if(isNaN(frmdonation.card_verification.value))
    {
        alert('Please enter Card verification no. in numeric value');
        frmdonation.card_verification.focus();
        return false;
    }
    if(Trim(document.frmdonation.card_verification.value)=="")
    {
        alert('Please enter Card verification no.');
        frmdonation.card_verification.focus();
        return false;
    }
    if(frmdonation.card_verification.value.length > 4)
    {
        alert('Please enter Card verification no. in 4 digit');
        frmdonation.card_verification.focus();
        return false;
    }
    if(frmdonation.emailtodonor.checked == false)
    {
        alert('Please check email receipt.');
        frmdonation.emailtodonor.focus();
        return false;
    }
    if(frmdonation.termandcond.checked == false)
    {
        alert('Please accept the terms and conditions');
        frmdonation.termandcond.focus();
        return false;
    }
    document.getElementById('donate_button').value="Please Wait .....";
    document.getElementById('donate_button').disabled=true;

}


function checkcardconf()
{

 if(Trim(document.frmconference.cc_card_Type_id.value)=="")
    {
        alert('Please select card type');
        frmconference.cc_card_Type_id.focus();
        return false;
    }

 if(Trim(document.frmconference.cc_nameoncard.value)=="")
    {
        alert('Please enter Name on Card');
        frmconference.cc_nameoncard.focus();
        return false;
    }    
    
    if(Trim(document.frmconference.cc_number.value)=="")
    {
        alert('Please enter Card no.');
        frmconference.cc_number.focus();
        return false;
    }
    
    if(isNaN(frmconference.card_verification.value))
    {
        alert('Please enter Card verification no. in numeric value');
        frmconference.card_verification.focus();
        return false;
    }
    if(Trim(document.frmconference.card_verification.value)=="")
    {
        alert('Please enter Card verification no.');
        frmconference.card_verification.focus();
        return false;
    }
    
    if(frmconference.emailtodonor.checked == false)
    {
        alert('Please check email receipt.');
        frmconference.emailtodonor.focus();
        return false;
    }
   
    if(frmconference.termandcond.checked == false)
    {
        alert('Please check terms & condition.');
        frmconference.termandcond.focus();
        return false;
    }
    document.getElementById('donate_button').disabled=true;
    document.getElementById('donate_button').value="Please Wait .....";

}



function rdddonation_validate()
{
    var objRegExp  = /(^\d{3}$)|(^\d{3}-\d{3}$)/;
	var objRegExpnum  = /(^-?\d\d*$)/;
    if(document.getElementById('is_amount').checked==false)
	{
	    var radio_choice = false;
        for (counter = 0; counter < document.frmdonation.r_donation_amount.length; counter++)
        {
            if (document.frmdonation.r_donation_amount[counter].checked) radio_choice = true; 
        }
        if (!radio_choice)
        {
            alert("Please select/enter your donation amount.");
            document.frmdonation.is_amount.focus();
            return false;
        }
	}
	if(document.getElementById('is_amount').checked==true)
	{	
       if(Trim(document.frmdonation.donation_amount.value)=="")
        {
            alert('Please enter donation amount');
            frmdonation.donation_amount.focus();
            return false;
        }
        else if(frmdonation.donation_amount.value=="0" || isNaN(frmdonation.donation_amount.value))
        {
            alert('Amount must be a positive no');
            frmdonation.donation_amount.focus();
            return false;
        }
  	    else if((frmdonation.donation_amount.value*1)==0)
        {
	        alert("Amount must be a positive no!");
	        frmdonation.donation_amount.focus();
	        return false;
        }
    }
    if(Trim(document.frmdonation.RecurFrequencyInDays.value)=="")
    {
	    alert("Please select RDD Frequency InDays !");
	    frmdonation.RecurFrequencyInDays.focus();
	    return false;
    }
    if(Trim(document.frmdonation.RecurStartDate.value)=="")
    {
	    alert("Please select RDD start date  !");
	    frmdonation.RecurStartDate.focus();
	    return false;
    }

    if(document.frmdonation.RecurEndDate.value!="")
	{
        date_arr = document.frmdonation.RecurStartDate.value.split('-');
        var startDate = new Date(date_arr[0],(date_arr[1]-1),date_arr[2]);

        edate_arr = document.frmdonation.RecurEndDate.value.split('-');
        var endDate = new Date(edate_arr[0],(edate_arr[1]-1),edate_arr[2]);
        if(startDate>endDate)
        {
            alert('RDD start date should not be greater than end date');
            document.frmdonation.RecurStartDate.focus();
            return false;
        }
	  }	
    if(Trim(document.frmdonation.AccountName.value)=="")
    {
	    alert("Please enter Account Name !");
	    frmdonation.AccountName.focus();
	    return false;
    }
    
    if(Trim(document.frmdonation.AccountBSB1.value)=="" || isNaN(document.frmdonation.AccountBSB1.value) || document.frmdonation.AccountBSB1.value.length<3)
	{
		alert("Please enter your correct account BSB in the format (xxx-xxx) !");
		document.frmdonation.AccountBSB1.focus();
		return false;
	} 
    if(Trim(document.frmdonation.AccountBSB2.value)=="" || isNaN(document.frmdonation.AccountBSB2.value) || document.frmdonation.AccountBSB2.value.length<3)
	{
		alert("Please enter your correct account BSB in the format (xxx-xxx) !");
		document.frmdonation.AccountBSB2.focus();
		return false;
	}   
    
    if(Trim(document.frmdonation.AccountNumber.value)=="")
    {
	    alert("Please enter account number !");
	    frmdonation.AccountNumber.focus();
	    return false;
    }
    if(isNaN(frmdonation.AccountNumber.value))
    {
	    alert("Please enter Valid account number !");
	    frmdonation.AccountNumber.focus();
	    return false;
    }
   if(document.frmdonation.project_type.length!="1")
   {
    if(document.frmdonation.project_type.value=="")
    {        
        if(confirm("AIf you want to give donation to a Project please select the Project"))
         {
             return false;
         }
        else
         {
            return true;
         }		
    } 
    }
}

function frmdonorupdate_validate()
{
    if(frmdonorupdate.cc_card_Type_id.value=="0")
		{
			alert('Please select card type');
			frmdonorupdate.cc_card_Type_id.focus();
			return false;
		}
		if(Trim(document.frmdonorupdate.cc_nameoncard.value)=="")
		{
			alert('Please enter name on card');
			frmdonorupdate.cc_nameoncard.focus();
			return false;
		}
		
		cc_number = frmdonorupdate.cc_number.value;    	
		if(cc_number=="")
	    {
		    alert("Please enter credit card no !");
		    frmdonorupdate.cc_number.focus();
		    return false;
	    }
  
        ccflag=0;
        subfirst = cc_number.substr(0,cc_number.length-4);
        sublast = cc_number.substr(cc_number.length-4,cc_number.length);
        str = "";
        for(i=0;i<subfirst.length;i++)
        {
            str = str + "X";
        }
        
        if(((str!=subfirst) && isNaN(subfirst)) || isNaN(sublast))
        {
            alert("Please enter a valid credit card no !");
	       frmdonorupdate.cc_number.focus();
	       return false;
        }
        if(cc_number.length<13 || cc_number.length>16)
        {
            alert("Please enter a valid credit card no !");
	       frmdonorupdate.cc_number.focus();
	       return false;
        }		
}

function onetimeccdonation_validate()
	{
		if(frmdonation.cc_card_Type_id.value=="0")
		{
			alert('Please select card type');
			frmdonation.cc_card_Type_id.focus();
			return false;
		}
		if(Trim(document.frmdonation.cc_nameoncard.value)=="")
		{
			alert('Please enter name on card');
			frmdonation.cc_nameoncard.focus();
			return false;
		}
		
		cc_number = frmdonation.cc_number.value;    	
		if(cc_number=="")
	    {
		    alert("Please enter credit card no !");
		    frmdonation.cc_number.focus();
		    return false;
	    }
  
        ccflag=0;
        subfirst = cc_number.substr(0,cc_number.length-4);
        sublast = cc_number.substr(cc_number.length-4,cc_number.length);
        str = "";
        for(i=0;i<subfirst.length;i++)
        {
            str = str + "X";
        }
        
        if(((str!=subfirst) && isNaN(subfirst)) || isNaN(sublast))
        {
            alert("Please enter a valid credit card no !");
	       frmdonation.cc_number.focus();
	       return false;
        }
        if(cc_number.length<13 || cc_number.length>16)
        {
            alert("Please enter a valid credit card no !");
	       frmdonation.cc_number.focus();
	       return false;
        }
				
		if(Trim(document.frmdonation.amount.value)=="")
		{
			alert('Please enter donation amount');
			frmdonation.amount.focus();
			return false;
		}
		if(frmdonation.amount.value=="0" || isNaN(frmdonation.amount.value))
		{
			alert('Donation amount must be a positive no');
			frmdonation.amount.focus();
			return false;
		}		
		if((frmdonation.amount.value*1)==0)
	    {
		    alert("Donation amount must be a positive no!");
		    frmdonation.amount.focus();
		    return false;
	    }
	    if(document.frmdonation.project.length!="1")
	    {
	    if(document.frmdonation.project.value=="")
        {        
            if(confirm("To select a project and then proceed with your transaction click 'ok'. To simply proceed with your transaction click 'cancel' and your transaction will be processed"))
             {
                 return false;
             }
           else
           {
                return true;
           }
       }		
        } 	
	   document.getElementById('donate_button').disabled=true;
       document.getElementById('donate_button').value="Please Wait .....";

	}

function rccdonation_validate()
	{
		if(Trim(document.rccdonation.donation_amount.value)=="")
		{
			alert('Please enter donation amount');
			rccdonation.donation_amount.focus();
			return false;
		}
		if(rccdonation.donation_amount.value=="0" || isNaN(rccdonation.donation_amount.value))
		{
			alert('Amount must be a positive no');
			rccdonation.donation_amount.focus();
			return false;
		}		
		if((rccdonation.donation_amount.value*1)==0)
	    {
		    alert("Amount must be a positive no!");
		    rccdonation.donation_amount.focus();
		    return false;
	    }
	    if(Trim(document.rccdonation.RecurStartDate.value)=="")
		{
			alert('Please enter RCC Start Date');
			rccdonation.RecurStartDate.focus();
			return false;
		}
	 date_arr_start = document.rccdonation.RecurStartDate.value.split('-');
     edate_arr = document.rccdonation.RecurEndDate.value.split('-');
     if(document.rccdonation.RecurEndDate.value!="")
     {
	     if(parseInt(date_arr_start[2])<=parseInt(edate_arr[2]))
	        {
	            if(parseInt(date_arr_start[2])==parseInt(edate_arr[2]))
	            {
	                if(parseInt(date_arr_start[1])<=parseInt(edate_arr[1]))
	                {
	                    if(parseInt(date_arr_start[1])==parseInt(edate_arr[1]))
	                    {
	                        if(parseInt(date_arr_start[0])< parseInt(edate_arr[0]))
	                        {
	                        }
	                        else
	                        {
	                            alert('RCC start date should not be greater than end date');
                                document.rccdonation.RecurStartDate.focus();
                                return false;  
	                        }
	                    }
	                    else
	                    {
	                    }
	                } 
	                else
	                {
	                    alert('RCC start date should not be greater than end date');
                        document.rccdonation.RecurStartDate.focus();
                        return false;  
	                }       
	            }
	        }
	     else
	        {
	            alert('RCC start date should not be greater than end date');
                document.rccdonation.RecurStartDate.focus();
                return false;  
	        }
	   }

/*			
	    if(document.rccdonation.RecurEndDate.value!="")
	    {
		    date_arr = document.rccdonation.RecurStartDate.value.split('-');
            var startDate = new Date(date_arr[0],(date_arr[1]-1),date_arr[2]);
            
            edate_arr = document.rccdonation.RecurEndDate.value.split('-');
            var endDate = new Date(edate_arr[0],(edate_arr[1]-1),edate_arr[2]);
           if(startDate>endDate)
           {
               alert('RCC start date should not be greater than end date');
               document.rccdonation.RecurStartDate.focus();
               return false;
           }
	    }
*/	    	
		if(Trim(document.rccdonation.RecurFrequencyInDays.value)=="")
		{
			alert('Please enter RCC Frequency In Days');
			rccdonation.RecurFrequencyInDays.focus();
			return false;
		}
		if(rccdonation.cc_card_Type_id.value=="0")
		{
			alert('Please select card type');
			rccdonation.cc_card_Type_id.focus();
			return false;
		}
		if(Trim(document.rccdonation.cc_nameoncard.value)=="")
		{
			alert('Please enter name on card');
			rccdonation.cc_nameoncard.focus();
			return false;
		}
		
		cc_number = rccdonation.cc_number.value;    	
		if(cc_number=="")
	    {
		    alert("Please enter credit card no !");
		    rccdonation.cc_number.focus();
		    return false;
	    }
  
        ccflag=0;
        subfirst = cc_number.substr(0,cc_number.length-4);
        sublast = cc_number.substr(cc_number.length-4,cc_number.length);
        str = "";
        for(i=0;i<subfirst.length;i++)
        {
            str = str + "X";
        }
        
        if(((str!=subfirst) && isNaN(subfirst)) || isNaN(sublast))
        {
            alert("Please enter a valid credit card no !");
	       rccdonation.cc_number.focus();
	       return false;
        }
        if(cc_number.length<13 || cc_number.length>16)
        {
            alert("Please enter a valid credit card no !");
	       rccdonation.cc_number.focus();
	       return false;
        }
     
        if(document.getElementById("project_type123").length!="1")
        {
           if(document.getElementById("project_type123").value=="")
           {        
            if(confirm("AAAIf you want to give donation to a Project please select the Project"))
             {
                 return false;
             }
            else
             {
                return true;
             }		
           }
        } 
	}
		
function shippingautocomplete()
{
    if(document.frmdonorupdatebill.autocorrect.checked==true)
    {
    document.frmdonorupdate.family_name.value=document.frmdonorupdatebill.family_name.value;
    document.frmdonorupdate.crm_org_name.value=document.frmdonorupdatebill.crm_org_name.value;
    document.frmdonorupdate.donerfname.value=document.frmdonorupdatebill.donerfname.value;
    document.frmdonorupdate.pemail.value=document.frmdonorupdatebill.pemail.value;
    document.frmdonorupdate.semail.value=document.frmdonorupdatebill.semail.value;
    document.frmdonorupdate.pcontact.value=document.frmdonorupdatebill.pcontact.value;
    document.frmdonorupdate.scontact.value=document.frmdonorupdatebill.scontact.value;
    document.frmdonorupdate.mobile.value=document.frmdonorupdatebill.mobile.value;
    document.frmdonorupdate.fax.value=document.frmdonorupdatebill.fax.value;
    document.frmdonorupdate.address1.value=document.frmdonorupdatebill.address1.value;
    document.frmdonorupdate.address2.value=document.frmdonorupdatebill.address2.value;
    document.frmdonorupdate.suburb.value=document.frmdonorupdatebill.suburb.value;
    document.frmdonorupdate.state.value=document.frmdonorupdatebill.state.value;
    document.frmdonorupdate.country.value=document.frmdonorupdatebill.country.value;
    document.frmdonorupdate.postcode.value=document.frmdonorupdatebill.postcode.value;
    }
    else
    {
        document.frmdonorupdate.reset();
    }
}

function validateaccountrcc()
{
    if(Trim(document.frmbrowse.donation_amount.value)=="")
	{
		alert("Please enter your donation amount !");
		document.frmbrowse.donation_amount.focus();
		return false;
	}
	if(document.frmbrowse.donation_amount.value=="0" || isNaN(document.frmbrowse.donation_amount.value))
	{
		alert('Donation amount must be a positive no');
		document.frmbrowse.donation_amount.focus();
		return false;
	}		
	if((document.frmbrowse.donation_amount.value*1)==0)
    {
	    alert("Donation amount must be a positive no!");
	    document.frmbrowse.donation_amount.focus();
	    return false;
    }
    if(document.frmbrowse.RecurStartDate.value=="")
	{
		alert("Please enter your Recur Start Date !");
		document.frmbrowse.RecurStartDate.focus();
		return false;
	}
		 date_arr_start = document.frmbrowse.RecurStartDate.value.split('-');
     edate_arr = document.frmbrowse.RecurEndDate.value.split('-');
     if(document.frmbrowse.RecurEndDate.value!="")
     {
	     if(parseInt(date_arr_start[2])<= parseInt(edate_arr[2]))
	        {
	            if(parseInt(date_arr_start[2])== parseInt(edate_arr[2]))
	            {
	                if(parseInt(date_arr_start[1])<= parseInt(edate_arr[1]))
	                {
	                    if(parseInt(date_arr_start[1])== parseInt(edate_arr[1]))
	                    {
	                        if(parseInt(date_arr_start[0])< parseInt(edate_arr[0]))
	                        {
	                        }
	                        else
	                        {
	                            alert('RCC start date should not be greater than end date');
                                document.frmbrowse.RecurStartDate.focus();
                                return false;  
	                        }
	                    }
	                    else
	                    {
	                    }
	                } 
	                else
	                {
	                    alert('RCC start date should not be greater than end date');
                        document.frmbrowse.RecurStartDate.focus();
                        return false;  
	                }       
	            }
	        }
	     else
	        {
	            alert('RCC start date should not be greater than end date');
                document.frmbrowse.RecurStartDate.focus();
                return false;  
	        }
	   }
/*	
	if(document.getElementById('RecurEndDate').value!="")
	{
		date_arr = document.getElementById('RecurStartDate').value.split('-');
        var startDate = new Date(date_arr[0],(date_arr[1]-1),date_arr[2]);
        
        edate_arr = document.getElementById('RecurEndDate').value.split('-');
        var endDate = new Date(edate_arr[0],(edate_arr[1]-1),edate_arr[2]);
       if(startDate>endDate)
       {
       alert('RCC start date should not be greater than end date');
       document.getElementById('RecurStartDate').focus();
       return false;
       }
	}		
*/	
	if(document.frmbrowse.RecurFrequencyInDays.value=="")
	{
		alert("Please select your Recur Frequency In Days!");
		document.frmbrowse.RecurFrequencyInDays.focus();
		return false;
	}
	if(document.frmbrowse.cc_card_Type_id.value=="0")
		{
			alert('Please select card type');
			document.frmbrowse.cc_card_Type_id.focus();
			return false;
		}
	if(Trim(document.frmbrowse.cc_nameoncard.value)=="")
	{
		alert('Please enter name on card');
		document.frmbrowse.cc_nameoncard.focus();
		return false;
	}
	
	cc_number = document.frmbrowse.cc_number.value;    	
	if(cc_number=="")
    {
	    alert("Please enter credit card no !");
	    document.frmbrowse.cc_number.focus();
	    return false;
    }

    ccflag=0;
    subfirst = cc_number.substr(0,cc_number.length-4);
    sublast = cc_number.substr(cc_number.length-4,cc_number.length);
    str = "";
    for(i=0;i<subfirst.length;i++)
    {
        str = str + "X";
    }
    
    if(((str!=subfirst) && isNaN(subfirst)) || isNaN(sublast))
    {
        alert("Please enter a valid credit card no !");
       document.frmbrowse.cc_number.focus();
       return false;
    }
    if(cc_number.length<13 || cc_number.length>16)
    {
        alert("Please enter a valid credit card no !");
       document.frmbrowse.cc_number.focus();
       return false;
    }
   if(document.frmbrowse.project_type.length!="1")  	
   {
   if(document.frmbrowse.project_type.value=="")
    {        
        if(confirm("This organisation MAY have set up a project or projects to\n which you can make a donation.\n If you wish your payment to go to a project instead of to the general revenue please click \"cancel\" and then select the project from the list of projects given in the drop down list.\n  If not simply click \"OK\" and your payment will proceed"))
        {
         return true;
        }
        else
        {
            return false;
        }		
    }
    } 
   }

function validateaccount()
{
    var objRegExp  = /(^\d{3}$)|(^\d{3}-\d{3}$)/;
	var objRegExpnum  = /(^-?\d\d*$)/;	
	if(document.getElementById('is_amount').checked==false)
	{
	    var radio_choice = false;
        for (counter = 0; counter < document.frmbrowse.r_donation_amount.length; counter++)
        {
            if (document.frmbrowse.r_donation_amount[counter].checked) radio_choice = true; 
        }
        if (!radio_choice)
        {
            alert("Please select/enter your donation amount.");
            document.frmbrowse.is_amount.focus();
            return false;
        }
	}
	if(document.getElementById('is_amount').checked==true)
	{
	     if(Trim(document.frmbrowse.donation_amount.value)=="")
	    {
		    alert("Please enter your donation amount !");
		    document.frmbrowse.donation_amount.focus();
		    return false;		
	    }
	    else if(isNaN(document.frmbrowse.donation_amount.value))
	    {
		    alert("Please enter your Valid donation amount !");
		    document.frmbrowse.donation_amount.focus();
		    return false;
	    }  
	}
	if(document.frmbrowse.RecurFrequencyInDays.value=="--Select--")
	{
		alert("Please select frequency in days !");
		document.frmbrowse.RecurFrequencyInDays.focus();
		return false;
	} 
	if(document.frmbrowse.RecurStartDate.value=="")
	{
		alert("Please enter your RDD start date !");
		document.frmbrowse.RecurStartDate.focus();
		return false;		
	}
	if(document.getElementById('RecurEndDate').value!="")
	{
		date_arr = document.getElementById('RecurStartDate').value.split('/');
        var startDate = new Date(date_arr[0],(date_arr[1]-1),date_arr[2]);
        
        edate_arr = document.getElementById('RecurEndDate').value.split('/');
        var endDate = new Date(edate_arr[0],(edate_arr[1]-1),edate_arr[2]);
       if(startDate>endDate)
       {
       alert('RDD start date should not be greater than end date');
       document.getElementById('RecurStartDate').focus();
       return false;
       }
	}		
	
	if(Trim(document.frmbrowse.AccountName.value)=="")
	{
		alert("Please enter your account name !");
		document.frmbrowse.AccountName.focus();
		return false;
	} 	
	if(Trim(document.frmbrowse.AccountBSB1.value)=="" || isNaN(document.frmbrowse.AccountBSB1.value) || document.frmbrowse.AccountBSB1.value.length<3)
	{
		alert("Please enter your correct account BSB in the format (xxx) !");
		document.frmbrowse.AccountBSB2.focus();
		return false;
	}		
	if(Trim(document.frmbrowse.AccountBSB2.value)=="" || isNaN(document.frmbrowse.AccountBSB2.value) || document.frmbrowse.AccountBSB2.value.length<3)
	{
		alert("Please enter your correct account BSB in the format (xxx) !");
		document.frmbrowse.AccountBSB2.focus();
		return false;
	}				
    
    if(Trim(document.frmbrowse.AccountNumber.value)=="")
	{
		alert("Please enter your correct account number !");
		document.frmbrowse.AccountNumber.focus();
		return false;
	}
	if(isNaN(document.frmbrowse.AccountNumber.value))
	{
		alert("Please enter your valid account number !");
		document.frmbrowse.AccountNumber.focus();
		return false;
	}	
   if(document.frmbrowse.project_type.length!="1")
   {	
       if(document.frmbrowse.project_type.value=="")
        {        
            if(confirm("This organisation MAY have set up a project or projects to\n which you can make a donation.\n If you wish your payment to go to a project instead of to the general revenue please click \"cancel\" and then select the project from the list of projects given in the drop down list.\n  If not simply click \"OK\" and your payment will proceed"))
            {
             return true;
            }
            else
            {
            return false;
            }		
        }
    } 		
}



function validation()
{
    if(Trim(document.frmgetorg.current.value)=="" ) 
    {
        alert("Please Enter Your Current Password !");
        document.frmgetorg.current.focus();
        return false;        
    }
    if(Trim(document.frmgetorg.password.value)=="" || Trim(document.frmgetorg.cpassword.value)=="") 
    {
        alert("Please Enter Your Password/Confirm Password !");
        document.frmgetorg.password.focus();
        return false;        
    }
    if(document.frmgetorg.current.value!=document.frmgetorg.oldpwd.value) 
    {
        alert("Your password did not match with old password !");
        document.frmgetorg.password.focus();								
        return false;       
    }
    if(document.frmgetorg.password.value!=document.frmgetorg.cpassword.value)
    {
        alert("Your password did not match with confirm password !");
        document.frmgetorg.password.value='';
        document.frmgetorg.cpassword.value='';
        document.frmgetorg.password.focus();
        return false;        
    }		 

}



/*
function checkprice(ctrl)
{
  checkbox_flag=false;
  for (i=4; i < document.frmconf.elements.length; i++)
  {
    if(document.frmconf.elements[i].type=="checkbox" && document.frmconf.elements[i].checked)
    checkbox_flag=true;
  }
 if(!checkbox_flag)
  {
  alert('Please select ticket type');
  return false;
  }
 if(document.frmconf.total_seat_0.value=="")
 {
 alert("Please enter Required Seat ");
 document.frmconf.total_seat_0.focus();
 return false;
 } 

  return true;  
}
*/
function checkprice(ctrl)
{
  checkbox_flag=true;
  ctr=0;
  for (i=4; i < document.frmconf.elements.length; i++)
  {	 
    if(document.frmconf.elements[i].type=="checkbox" && document.frmconf.elements[i].checked)					
	  {
		if(document.frmconf.elements[i+1].value=="")
			checkbox_flag=false;
		else
			ctr++;			
	  }
  }
 if(!checkbox_flag || ctr<1)
  {
  alert('Please enter the seat Required');
  return false;
  }

  return true;  
}
function checkcontactus()
  {
   if(Trim(document.contact.name.value)=="")
	{
		alert("Please Enter the Name !");
		document.contact.name.focus();
		return false;
	}
	  if(Trim(document.contact.phone.value)=="")
	    {
	    alert("Please Enter the Phone !");
	    document.contact.phone.focus();
	    return false;
	    }
	    if(isNaN(document.contact.phone.value))
	    {
	    alert("Please Enter the Valid Phone ! \n" + PHONE_NUMBER_MESSAGE);
	    document.contact.phone.focus();
	    return false;
	    }

	    if(Trim(document.contact.email.value)=="")
	    {
	    alert("Please Enter the Email !");
	    document.contact.email.focus();
	    return false;
	    }
	if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(contact.email.value))
	   {   
	   }
    else
       {
		   alert("Please Enter the Valid email ");
		   document.contact.email.focus();
		   return (false);
	   }
  }
function formvalidate()
{	
	if(Trim(document.install.headercolor.value)=="")
	{
		alert("Please Enter Header Colour !");
		document.install.headercolor.focus();
		return false;
	}
	if(Trim(document.install.stripcolor.value)=="")
	{
		alert("Please Enter Strip Colour !");
		document.install.stripcolor.focus();
		return false;
	}	
	if(Trim(document.install.activelinkcolor.value)=="")
	{
		alert("Please Enter Active Links Colour !");
		document.install.activelinkcolor.focus();
		return false;
	}
	if(Trim(document.install.inactivelinkcolor.value)=="")
	{
		alert("Please Enter Inactive Links Colour !");
		document.install.inactivelinkcolor.focus();
		return false;
	}
	if(Trim(document.install.footercolor.value)=="")
	{
		alert("Please Enter Footer Colour !");
		document.install.footercolor.focus();
		return false;
	}

	if(Trim(document.install.pagetitle.value)=="")
	{
		alert("Please Enter Page Title  !");
		document.install.pagetitle.focus();
		return false;
	}

	
   if(Trim(document.install.charge.value)=="")
	{
		alert("Please Enter Delivery Charges !");
		document.install.charge.focus();
		return false;
	}

	if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(install.orderformemail.value))
   {   
   }
   else
   {
	   alert("Invalid E-mail Address ! Please Re-Enter ");
	   document.install.orderformemail.focus();
	   return (false);
	}

	if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(install.contactusemail.value))
   {   
   }
   else
   {
	   alert("Invalid E-mail Address ! Please Re-Enter ");
	   document.install.contactusemail.focus();
	   return (false);
	}
}
function changeColor(objectname,total)
{	
	if(eval(objectname)==0 && eval(total)==0)
	{
		document.getElementById(0).style.background='#a9a9a9';	
		document.getElementById('a'+0).style.background='#ffffff';
	}
	else
	{
		document.getElementById(0).style.background='#ffffff';	
		document.getElementById('a'+0).style.background='#a9a9a9';
	}
	for(i=1;i<=total;i++)
	{
		if(eval(objectname)==eval(i))
		{
			document.getElementById(i).style.background='#a9a9a9';	
		}
		else
		{
			document.getElementById(i).style.background='#ffffff';
		}
	}
	for(i=1;i<=total;i++)
	{
		if(eval(objectname)!=eval(i))
		{
			document.getElementById('a'+i).style.background='#a9a9a9';			
		}
		else
		{
			document.getElementById('a'+i).style.background='#ffffff';
		}
	}
}

function confirmmetodelete(ctrl)
{	
	if(confirm("This action may have some effect on your records !")) 
	{
		document.location=ctrl;
		return true;
	}
	else
	{
		return false;
	}
}

function submittodel(formObj)
{
 channel=0; 
 for (var i=1;i < formObj.length;i++) 
   {
      fldObj = formObj.elements[i];
      if (fldObj.type == 'checkbox')
      { 
		 if(fldObj.checked==true)
		 channel=1;
       }	   
   }
   if(channel==0)
	{
	   alert("Please select record to delete !");
	   return false;
	}
   else
	{  
			if(confirm("This action may have some effect on your records !")) 
			{
					 document.frmbrowse.action='index.php?inc=browse&process=delete';
					 document.frmbrowse.submit();
					 return true;
			}
			else
			{
				return false;
			}
	}
}

function submittodel_pages(formObj)
{
 channel=0; 
 for (var i=1;i < formObj.length;i++) 
   {
      fldObj = formObj.elements[i];
      if (fldObj.type == 'checkbox')
      { 
		 if(fldObj.checked==true)
		 channel=1;
       }	   
   }
   if(channel==0)
	{
	   alert("Please select record to delete !");
	   return false;
	}
   else
	{  
			if(confirm("This action may have some effect on your records !")) 
			{
					 document.servicecategory.action='index.php?inc=webpage&action=delete';
					 document.servicecategory.submit();
					 return true;
			}
			else
			{
				return false;
			}
	}
}


function submittodel_orgusers(formObj)
{
 channel=0; 
 for (var i=1;i < formObj.length;i++) 
   {
      fldObj = formObj.elements[i];
      if (fldObj.type == 'checkbox')
      { 
		 if(fldObj.checked==true)
		 channel=1;
       }	   
   }
   if(channel==0)
	{
	   alert("Please select record to delete !");
	   return false;
	}
   else
	{  
			if(confirm("This action may have some effect on your records !")) 
			{
					 document.orgusers.action='index.php?inc=orguser&action=delete';
					 document.orgusers.submit();
					 return true;
			}
			else
			{
				return false;
			}
	}
}

function confirmmetodel(ctrl,sendto)
{	
	if(sendto=="jobs") go="delalljobs";
	if(sendto=="user") go="delalluser";
	if(confirm("This action may have some effect on your records !")) 
	{
		document.location="process.php?process="+go+"&allid="+ctrl;
		return false;
	}
	else
	{
		return false;
	}
}

function formload(payment_type_id)
{
document.frmdonation.method="post";
document.frmdonation.action='index.php?var=quickdonation&payment_type_id='+payment_type_id;
document.frmdonation.submit();
return true;
}
function formloaddonation(payment_type_id)
{
document.frmdonation.method="post";
document.frmdonation.action='index.php?var=donation&payment_type_id='+payment_type_id;
document.frmdonation.submit();
return true;
}
function sendsubpageid(ctrl)
{
  document.location="index.php?inc=webpagecontent&subpagecontent="+ctrl;
}
function checkcmspage()
{
  if(document.servicecategory.subpagecontent.value=="")
	{
		alert("Please select website page !");
		document.servicecategory.subpagecontent.focus();
		return false;
	}	
}
function fieldcheck()
{
	if(Trim(document.user.username.value)=="")
	{
	  alert("Please enter user name !")
	  document.user.username.focus();
	  return false;
	}
	if(Trim(document.user.password.value)=="" || Trim(document.user.cpassword.value)=="" || document.user.password.value!=document.user.cpassword.value)
	{
	  alert("Please enter correct password !")
	  document.user.password.value='';
	  document.user.cpassword.value='';
	  document.user.password.focus();
	  return false;
	}	
	if(Trim(document.user.name.value)=="")
	{
	  alert("Please enter name !")
	  document.user.name.focus();
	  return false;
	}
	if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(user.email.value))
		   {   
		   }
		   else
		   {
			   alert("Invalid E-mail Address ! Please Re-Enter ");
			   document.user.email.focus();
			   return (false);
			}
}

function checklogin()
{
	if(Trim(document.login.user.value)=="")
	{
	  alert("Please enter user name !")
	  document.login.user.focus();
	  return false;
	}
	if(Trim(document.login.password.value)=="")
	{
	  alert("Please enter password name !")
	  document.login.password.focus();
	  return false;
	}	
}

function checkforgot()
{
	if(Trim(document.frmforgot.username.value)=="")
	{
		if(Trim(document.frmforgot.username.value)=="")
		{
		  alert("Please enter user name !")
		  document.frmforgot.username.focus();
		  return false;
		}
	}
	if(document.frmforgot.email.value!="")
	{
		if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(frmforgot.email.value))
		{   
		}
		else
		{
		   alert("Invalid E-mail Address ! Please Re-Enter ");
		   document.frmforgot.email.focus();
		   return (false);
		}
	}
}
function quickdonation(payment_type)
{
	if(Trim(document.frmdonation.donorname.value)=="")
	{
	  alert("Please enter first name !")
	  document.frmdonation.donorname.focus();
	  return false;
	}			
	if(Trim(document.frmdonation.donorlname.value)=="")
	{
	  alert("Please enter family name !")
	  document.frmdonation.donorlname.focus();
	  return false;
	}		
	if(Trim(document.frmdonation.add1.value)=="")
	{
	  alert("Please enter your building name !")
	  document.frmdonation.add1.focus();
	  return false;
	}		
	
	if(Trim(document.frmdonation.suburb.value)=="")
	{
	  alert("Please enter your street address !")
	  document.frmdonation.suburb.focus();
	  return false;
	}
	if(Trim(document.frmdonation.state.value)=="")
	{
	  alert("Please enter your state/province !")
	  document.frmdonation.state.focus();
	  return false;
	}
	if(Trim(document.frmdonation.country.value)=="")
	{
	  alert("Please enter your country !")
	  document.frmdonation.country.focus();
	  return false;
	}

	if(Trim(document.frmdonation.postcode.value)=="")
	{
	  alert("Please enter your postcode/zip !")
	  document.frmdonation.postcode.focus();
	  return false;
	}

	if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(frmdonation.email.value))
	   {   
	   }
	   else
	   {
		   alert("Invalid E-mail Address ! Please Re-Enter ");
		   document.frmdonation.email.focus();
		   return (false);
		}
	
	if(Trim(document.frmdonation.phone.value)=="")
	{
	  alert("Please enter your phone !")
	  document.frmdonation.phone.focus();
	  return false;
	}	
	if(Trim(document.frmdonation.amount.value)=="" || isNaN(document.frmdonation.amount.value) || document.frmdonation.amount.value=="0")
	{
	  alert("Please enter your donation amount !");
	  document.frmdonation.amount.focus();
	  return false;
	}
	
	if(payment_type==3)	// Validate if cc type
	    return cardvalidation()	;
	
	if(!document.frmdonation.termandcond.checked)
	   {
	      alert("Please read & agree with the terms and conditions stated below !")
	      document.frmdonation.termandcond.focus();
	      return false;
	   }
}

function cardvalidation()
{
    if(Trim(document.frmdonation.cc_card_Type_id.value)=="")
	    {
	      alert("Please select a card type !")
	      document.frmdonation.cc_card_Type_id.focus();
	      return false;
	    }
	    if(Trim(document.frmdonation.cc_nameoncard.value)=="")
	    {
	      alert("Please enter name on card !")
	      document.frmdonation.cc_nameoncard.focus();
	      return false;
	    }
	    if(Trim(document.frmdonation.cc_number.value)=="")
	    {
	      alert("Please enter a valid card no !")
	      document.frmdonation.cc_number.focus();
	      return false;
	    }
	    if(Trim(document.frmdonation.cc_number.value)=="")
	    {
	      alert("Please enter a valid card no !")
	      document.frmdonation.cc_number.focus();
	      return false;
	    }
	    return true;
}

function confirmme(ctrl)
{	
	if(confirm("This action may have some effect on your records !")) 
	{
		document.location=ctrl;
		return true;
	}
	else
	{
		return false;
	}
}

var i=0;
var count=0;
var ctrl=0;
var isInverse=0;
function selectall(formObj, isInverse) 
{
   //alert(isInverse);
   for (var i=0;i < formObj.length;i++) 
   {
      fldObj = formObj.elements[i];
      if (fldObj.type == 'checkbox')
      { 
         if(isInverse)
		  {
			 fldObj.checked = (fldObj.checked) ? false : true;
			 count=1;
		  }
         else 
		  {
			 fldObj.checked = true; 		 
			 count=0;
		  }
       }	   
   }
   if(count==0) count=1; else count=0;
   if(count==1)
	 document.jobs.allcheck.checked=true;
   else
     document.jobs.allcheck.checked=false;
}
function selectallcheck(formObj, isInverse) 
{
   ctrl=0;
   for (var i=1;i < formObj.length;i++) 
   {
      fldObj = formObj.elements[i];
      if (fldObj.type == 'checkbox')
      { 
		 if(fldObj.checked==false)
		 ctrl=1;
       }	   
   }
   if(ctrl==0)
	 document.jobs.allcheck.checked=true;
   else
     document.jobs.allcheck.checked=false;
}



function fieldcheckjobsreply()
{
	if(Trim(document.jobs.reply_title.value)=="")
	{
	  alert("Please enter reply title !")
	  document.jobs.reply_title.focus();
	  return false;
	}			
	if(Trim(document.jobs.description.value)=="")
	{
	  alert("Please enter description !")
	  document.jobs.description.focus();
	  return false;
	}
}

var i=0;
  function wait(ctrl)
  {
      document.write("<head><link rel='stylesheet' href='css/style.css' type='text/css'></head><body marginwidth=0 marginheight=0 cellpadding=0 cellspacing=0 topmargin=0 leftmargin=0><center><table border='0' cellspacing='0' cellpadding='0' class='maintable' valign='center'><tr><td colspan='2' bgcolor='#ffffff' style='line-height:1px;'>&nbsp;</td></tr><tr><td width='100%' height='30' class='adminhead'><table border='0' width='100%'   cellspacing='0' cellpadding='0'><tr bgcolor='#0096de'  style='line-height:10px;'><td colspan=2>&nbsp;</td></tr><tr  bgcolor='#EDF5F7' height='50'><td height='50' class='text' style='padding-left:10px;'><a href='http://www.egive.org.au' target=_blank class='href' style='font-size:24px;font-weight:bold;'><img src='images/logo.gif' height='35' width='130' style='border:0px;'></a></td><td class='text' align='right'><table  border='0' width='100%' height='100%' cellspacing='0' cellpadding='0'><tr><td align='right'><b><a href='index.php' class='href'>Home</a>&nbsp;|&nbsp;<a href='../index.php' target=_blank class='href'>Website</a>&nbsp;|&nbsp;<a href='process.php?process=logout' target=_blank class='href'>Log Off</a></td></tr></table></tr><tr bgcolor='#6E6E6E'  style='line-height:10px;'><td colspan=2>&nbsp;</td></tr></table></td></tr><tr><td colspan='2' bgcolor='#d0d0dd' style='line-height:1px;'>&nbsp;</td></tr><tr><td colspan='2' height=470 width='100%' valign='middle' align='center' class='text'><table border=0 align='center' bgcolor='#fcfcfc' style='width:100%;height:100%;' valign='middle'><tr><td align=center valign='middle' class='text'><div class='text' style='width:100%;font-size:14px;'><hr style='width:35%;height:1px;color:#980000'><img src='images/loading.gif' border=0 width=101 height=11><hr style='width:35%;height:1px;color:#980000'></div></td></tr></table></td></tr><tr><td colspan='2' bgcolor='#fcfcfc' style='line-height:1px;'><table height='30' width='100%' cellpadding=0 cellspacing=0 border=0><tr><td align='center' valign='middle' width='23%' class='adminhead'><div>&nbsp;Copyright &copy; 2006</div></td><td valign='middle' width='57%' class='adminhead'><div class='text' align='center'><a href='http://www.broadwayinfotech.com.au' target=_blank class='href' style='color:#ffffff;'>Designed and Developed by www.broadwayinfotech.com.au</a></div></td><td align='right' valign='bottom' class='adminhead' width='20%'><div style='padding-right:4px;'>&nbsp;</div></td></tr></table></td></tr></table></body>");
	  if(i==0)
	  {
	   setTimeout("wait('"+ctrl+"');",10);	   
	   i++;
	  }
      return document.location="index.php?inc="+ctrl;
  }

onerror = handleErrors
var msg = null
function handleErrors(errorMessage, url, line)
	{
	document.status='';
	return true
	}

function changecolor(ctrl)
{
	newImage = "url(images//submain-bg.jpg)";
	document.getElementById('changepwd').style.backgroundImage=newImage;
}



document.frmbrowse.allcheck.onclick = un_check;
function un_check(){
  for (var i = 0; i < document.shopping.elements.length; i++) {
    var e = document.shopping.elements[i];
    if ((e.name != 'allcheck') && (e.type == 'checkbox')) {
e.checked = document.shopping.allcheck.checked;
    }
  }
}

function donorupdate()
{

   if(document.frmdonorupdate.member_category.value=="0")
	{
	  alert("Please select member category !")
	  document.frmdonorupdate.member_category.focus();
	  return false;
	}
    if(Trim(document.frmdonorupdate.family_name.value)=="")
	{
	  alert("Please enter donor family name !")
	  document.frmdonorupdate.family_name.focus();
	  return false;
	}
	else
	{
	document.frmdonorupdate.donerlname.value=document.frmdonorupdate.family_name.value;
	}
	if(Trim(document.frmdonorupdate.donerfname.value)=="")
	{
	  alert("Please enter donor first name !")
	  document.frmdonorupdate.donerfname.focus();
	  return false;
	}				
	
   if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(frmdonorupdate.pemail.value))
     {   
     }
     else
     {
	   alert("Please enter a valid primary email address !");
	   document.frmdonorupdate.pemail.focus();
	   return (false);
	 }

	/*if(document.frmdonorupdate.pcontact.value=="")
	{
	  alert("Please enter your primary contact number !")
	  document.frmdonorupdate.pcontact.focus();
	  return false;
	}
	if(document.frmdonorupdate.scontact.value=="")
	{
	  alert("Please enter your secondry contact number !")
	  document.frmdonorupdate.scontact.focus();
	  return false;
	}
	if(document.frmdonorupdate.mobile.value=="")
	{
	  alert("Please enter your mobile number !")
	  document.frmdonorupdate.mobile.focus();
	  return false;
	}
	if(document.frmdonorupdate.url.value=="")
	{
	  alert("Please enter your website url !")
	  document.frmdonorupdate.url.focus();
	  return false;
	}*/


	/*if(document.frmdonorupdate.address1.value=="")
	{
	  alert("Please enter your address !")
	  document.frmdonorupdate.address1.focus();
	  return false;
	}		
	
	if(document.frmdonorupdate.suburb.value=="")
	{
	  alert("Please enter your suburb !")
	  document.frmdonorupdate.suburb.focus();
	  return false;
	}
	if(document.frmdonorupdate.state.value=="")
	{
	  alert("Please enter your state !")
	  document.frmdonorupdate.state.focus();
	  return false;
	}
	if(document.frmdonorupdate.country.value=="")
	{
	  alert("Please enter your country !")
	  document.frmdonorupdate.country.focus();
	  return false;
	}

	if(document.frmdonorupdate.postcode.value=="")
	{
	  alert("Please enter your postcode !")
	  document.frmdonorupdate.postcode.focus();
	  return false;
	}	*/
}


function hidediv()
{
	document.getElementById('donation').style.display='none';	
	document.getElementById('donation').style.position='absolute';
	flagState = 0;
}

function hidedivconference()
{
	document.getElementById('start').style.display='none';	
	document.getElementById('start').style.position='relative';
	document.getElementById('ticket').style.display='none';	
	document.getElementById('ticket').style.position='relative';
	document.getElementById('end').style.display='none';	
	document.getElementById('end').style.position='relative';
	document.getElementById('ticket').innerHTML='';
	document.getElementById('start').innerHTML='';
	document.getElementById('end').innerHTML='';
	flagState = 0;	
}


function addticket()
{	
	document.getElementById('ticket').style.visibility='visible';
	document.getElementById('ticket').style.display='block';
	document.getElementById('ticket').style.position='relative';
	document.getElementById('start').style.visibility='visible';
	document.getElementById('start').style.display='block';
	document.getElementById('start').style.position='relative';	
	document.getElementById('end').style.visibility='visible';
	document.getElementById('end').style.display='block';
	document.getElementById('end').style.position='relative';	
	document.getElementById('start').innerHTML='';
	document.getElementById('end').innerHTML='';
	msg="";	
	msgstart="<table border=0 cellpadding=0 cellspacing=0 width='100%' style='border:1px solid #f0f0ff;'><tr><td align=center valign=top colspan='4'><table bgcolor='#EDF5F7' cellpadding=0 cellspacing=0 style='height:15px;width:100%'><tr><td class='text' align='center' width='99%'><b>Add Tickets</td><td width='1%' align='right'><img src='images/cross.gif' border=0 onclick='hidedivconference();' style='float:right;'></td></tr></table></td></tr><tr><td>";
	msg="<table border=0 cellpadding=0 cellspacing=0 width='100%' style='border:1px solid #f0f0ff;'><tr bgcolor='#f2f2f2'><td class='text' style='width:20%'>&nbsp;Ticket Type</td><td class='text' style='width:25%;'><input type='text' name='ticket_type[]' class='textbox' style='width:100px;'></td><td class='text' width='15%'>Ticket Price</td><td class='text' width='40%'><input type='text' name='ticket_price[]' class='textbox' style='width:60px;'></td></tr><tr><td colspan=4 class='biglineheight' style='height:5px;'>&nbsp;</td></tr></table>";	
	msgend="</td></tr><tr><td align=center valign=top colspan='4'><div class='heading' style='width:100%;'>&nbsp;</div></td></tr><tr></table>";
	if(msg!="") document.getElementById('start').innerHTML=msgstart;
	if(msg!="") document.getElementById('ticket').innerHTML+=msg;
	if(msg!="") document.getElementById('end').innerHTML=msgend;
}

function sendquickemail()
{
    if(document.quickemail.all.checked==false)
    {
     document.quickemail.email.disabled=false;
    }
    else  if(document.quickemail.all.checked==true)
    {
     document.quickemail.email.disabled=true;
    }
}

function hidedivservices()
{
	document.getElementById('services').style.display='none';	
	document.getElementById('services').style.position='relative';
    document.getElementById('plan').style.visibility='visible';
	document.getElementById('plan').style.display='block';
	document.getElementById('plan').style.position='relative';
	flagState = 0;
}

function hidedivplan()
{
	document.getElementById('plan').style.display='none';	
	document.getElementById('plan').style.position='relative';
    document.getElementById('services').style.visibility='visible';
	document.getElementById('services').style.display='block';
	document.getElementById('services').style.position='relative';
	flagState = 0;
}
/*function adddonor()
{
alert('hello');
	   if(validate_custom_fields())
	{
	
		return false;
	}    
}
*/
function adddonor()
{
	if(!validate_custom_fields())
	{
		
			return false;
	}
	if(validate_custom_fields())
	{
	
	if(Trim(document.frmdonoradd.pwd.value)=="")
	{
		alert("Please enter your password !");
		document.frmdonoradd.pwd.focus();
		return false;
	}
	
	if(Trim(document.frmdonoradd.cpwd.value)=="" || document.frmdonoradd.cpwd.value!=document.frmdonoradd.pwd.value)
	{
		alert("Please enter correct password !");
		document.frmdonoradd.cpwd.focus();
		return false;
	}
	
	 if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(frmdonoradd.pemail.value))
     {   
     }
     else
     {
	   alert("Please enter a valid primary email address !");
	   document.frmdonoradd.pemail.focus();
	   return (false);
	 }

}   
    
	
	if(Trim(document.frmdonoradd.verify.value)=="")
	{
	    alert("Please enter the image text!");
	    document.frmdonoradd.verify.focus();
	    return false;
    }
}

///////######This function added by Vikas Mathur- Date 14 feb ######//////////////////////////

function fieldcheckfeedback()
    {
    if(Trim(document.feedback.title.value)=="")
        {
        alert("Please enter title");
        document.feedback.title.focus();
        return false;
        }
    if(document.feedback.type.value=="0")
        {
        alert("Please select feedback type");
        document.feedback.type.focus();
        return false;
        }
    if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(feedback.email.value))
     {   
     }
     else
     {
	   alert("Please enter a valid email address !");
	   document.feedback.email.focus();
	   return (false);
	 }
         
    if(Trim(document.feedback.verify.value)=="")
        {
        alert("Please verify the image code");
        document.feedback.verify.focus();
        return false;
        }
}

function rccmembership_validate()
	{

		if(document.rccmembership.cc_card_Type_id.value=="0")
		{
			alert('Please select card type');
			document.rccmembership.cc_card_Type_id.focus();
			return false;
		}
		if(Trim(document.rccmembership.cc_nameoncard.value)=="")
		{
			alert('Please enter name on card');
			document.rccmembership.cc_nameoncard.focus();
			return false;
		}
		
		cc_number = rccmembership.cc_number.value;    	
		if(cc_number=="")
	    {
		    alert("Please enter credit card no !");
		    rccmembership.cc_number.focus();
		    return false;
	    }
  
        ccflag=0;
        subfirst = cc_number.substr(0,cc_number.length-4);
        sublast = cc_number.substr(cc_number.length-4,cc_number.length);
        str = "";
        for(i=0;i<subfirst.length;i++)
        {
            str = str + "X";
        }
        
        if(((str!=subfirst) && isNaN(subfirst)) || isNaN(sublast))
        {
            alert("Please enter a valid credit card no !");
	       document.rccmembership.cc_number.focus();
	       return false;
        }
        if(cc_number.length<13 || cc_number.length>16)
        {
            alert("Please enter a valid credit card no !");
	       document.rccmembership.cc_number.focus();
	       return false;
        }
       if(!document.rccmembership.termandcond.checked)
	   {
	      alert("Please read & agree with the terms and conditions stated below !")
	      document.rccmembership.termandcond.focus();
	      return false;
	   }
	}
////////////Added By Vikas for membership RDD Validation - 13-march //////////////

function rddmember_validate()
{
    if(Trim(document.frmmemberrdd.AccountName.value)=="")
    {
	    alert("Please enter account name !");
	    frmmemberrdd.AccountName.focus();
	    return false;
    }
    if(Trim(document.frmmemberrdd.AccountNumber.value)=="")
    {
	    alert("Please enter account number !");
	    document.frmmemberrdd.AccountNumber.focus();
	    return false;
    }
    if(isNaN(document.frmmemberrdd.AccountNumber.value))
    {
	    alert("Please enter valid account number !");
	    document.frmmemberrdd.AccountNumber.focus();
	    return false;
    }
    
     if(Trim(document.frmmemberrdd.AccountBSB1.value)=="" || isNaN(document.frmmemberrdd.AccountBSB1.value) || document.frmmemberrdd.AccountBSB1.value.length<3)
	{
		alert("Please enter your correct account BSB in the format (xxx-xxx) !");
		document.frmmemberrdd.AccountBSB1.focus();
		return false;
	} 
	if(Trim(document.frmmemberrdd.AccountBSB2.value)=="" || isNaN(document.frmmemberrdd.AccountBSB2.value) || document.frmmemberrdd.AccountBSB2.value.length<3)
	{
		alert("Please enter your correct account BSB in the format (xxx-xxx) !");
		document.frmmemberrdd.AccountBSB2.focus();
		return false;
	}  
    
}	

function cancel_request()
    {
    if(Trim(document.rccmembership.reason.value)=="")
        {
        alert("Please specify reson for cancellation!");
        document.rccmembership.reason.focus();
        return false;
        }
}
function codename2()
{
    if(document.getElementById('is_amount').checked==true)
    {
        document.direct_donate.donation_amount_rdd.disabled=false;
    }
    if(document.getElementById('is_amount').checked==false)
    {
        document.direct_donate.donation_amount_rdd.disabled=true;
    }
}
function codename1()
{
//    if(document.frmbrowse.is_amount.checked)
//    {
//        document.frmbrowse.donation_amount.disabled=true;
//    }
//    else
//    {
//        document.frmbrowse.donation_amount.disabled=false;
//    }

    if(document.getElementById('is_amount').checked==true)
    {
        document.frmbrowse.donation_amount.disabled=false;
    }
    if(document.getElementById('is_amount').checked==false)
    {
        document.frmbrowse.donation_amount.disabled=true;
    }
    
}
function codename()
{
//    if(document.frmdonation.is_amount.checked)
//    {
//        document.frmdonation.donation_amount.disabled=true;
//    }
//    else
//    {
//        document.frmdonation.donation_amount.disabled=false;
//    }
//alert(document.getElementById('is_amount').checked);
    if(document.getElementById('is_amount').checked==true)
    {
        document.frmdonation.donation_amount.disabled=false;
    }
    if(document.getElementById('is_amount').checked==false)
    {
        document.frmdonation.donation_amount.disabled=true;
    }
}

function validatebilling()
{
    if(Trim(document.frmdonorupdatebill.family_name.value)=="")
    {
	    alert("Please Enter Family Name !");
	    frmdonorupdatebill.family_name.focus();
	    return false;
    }
    if(Trim(document.frmdonorupdatebill.crm_org_name.value)=="")
    {
	    alert("Please Enter Organisation Name !");
	    frmdonorupdatebill.crm_org_name.focus();
	    return false;
    }

    if(Trim(document.frmdonorupdatebill.donerfname.value)=="")
    {
	    alert("Please Enter First Name  !");
	    frmdonorupdatebill.donerfname.focus();
	    return false;
    }
    if(Trim(document.frmdonorupdatebill.pemail.value)=="")
    {
	    alert("Please Enter Primary Email !");
	    frmdonorupdatebill.pemail.focus();
	    return false;
    }
     if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(frmdonorupdatebill.pemail.value))
     {   
     }
     else
     {
	    alert("Please Enter Valid Primary Email !");
	    frmdonorupdatebill.pemail.focus();
	    return false;
	 } 
	  if(document.frmdonorupdatebill.pcontact.value=="" )
    {
	    alert("Please Enter Primary Contact  !");
	    frmdonorupdatebill.pcontact.focus();
	    return false;
    }  
     if(isNaN(document.frmdonorupdatebill.pcontact.value))
	    {
	    alert("Please Enter the Valid Phone ! \n" + PHONE_NUMBER_MESSAGE);
	    document.frmdonorupdatebill.pcontact.focus();
	    return false;
	    }
     
     if(Trim(document.frmdonorupdatebill.abn.value)=="")
    {
	    alert("Please Enter ABN No!");
	    frmdonorupdatebill.abn.focus();
	    return false;
    }
     if(isNaN(frmdonorupdatebill.abn.value))
    {
	    alert("Please Enter Valid ABN No!");
	    frmdonorupdatebill.abn.focus();
	    return false;
    }
     if(Trim(document.frmdonorupdatebill.address1.value)=="")
    {
	    alert("Please Enter Street Address #1 !");
	    frmdonorupdatebill.address1.focus();
	    return false;
    }
     if(Trim(document.frmdonorupdatebill.suburb.value)=="")
    {
	    alert("Please Enter Town/City   !");
	    frmdonorupdatebill.suburb.focus();
	    return false;
    }
     if(Trim(document.frmdonorupdatebill.state.value)=="")
    {
	    alert("Please Enter State/Province   !");
	    frmdonorupdatebill.state.focus();
	    return false;
    }
     if(Trim(document.frmdonorupdatebill.country.value)=="")
    {
	    alert("Please Enter Country !");
	    frmdonorupdatebill.country.focus();
	    return false;
	}
	if(Trim(document.frmdonorupdatebill.postcode.value)=="" )
    {
	    alert("Please Enter Postcode/Zipcode  !");
	    frmdonorupdatebill.postcode.focus();
	    return false;
    }  
    if(isNaN(frmdonorupdatebill.postcode.value))
    {
	    alert("Please Enter Valid Postcode/Zipcode  !");
	    frmdonorupdatebill.postcode.focus();
	    return false;
    }
    return true;
}	

/////////////Function is added by vikas mathur ////////////////////

function validate_login()
{
    if(Trim(document.direct_donate.user.value)=="")
        {
        alert("Please Enter User Name");
        document.direct_donate.user.focus();
        return false;
        }
    if(Trim(document.direct_donate.password.value)=="")
        {
        alert("Please Enter Password");
        document.direct_donate.password.focus();
        return false;
        }
    return true;    
}

function Validate_quick_donation()
{
   if(Trim(document.direct_donate.donerfname.value)=="")
    {
        alert("Please Enter First Name");
        document.direct_donate.donerfname.focus();
        return false;
    }
    if(Trim(document.direct_donate.lname.value)=="")
    {
        alert("Please Enter Family Name");
        document.direct_donate.lname.focus();
        return false;
    }
    if(Trim(document.direct_donate.pemail.value)=="")
        {
		   alert("Invalid E-mail Address ! Please Re-Enter ");
		   document.direct_donate.pemail.focus();
		   return (false);
        }
    if(document.direct_donate.pemail.value!="")
	{
		if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(direct_donate.pemail.value))
		{   
		}
		else
		{
		   alert("Invalid E-mail Address ! Please Re-Enter ");
		   document.direct_donate.pemail.focus();
		   return (false);
		}
	}
     if(Trim(document.direct_donate.pphone.value)=="")
	 {
	    alert("Please Enter the Phone !");
	    document.direct_donate.pphone.focus();
	    return false;
	 }
//	if(isNaN(document.direct_donate.pphone.value))
//	{
//	    alert("Please Enter the Valid Phone !");
//	    document.direct_donate.pphone.focus();
//	    return false;
//	}
//	if(isNaN(document.direct_donate.pphone.value))
//	{
//	    alert("Please Enter the Valid Phone ! \n  "+PHONE_NUMBER_MESSAGE);
//	    document.direct_donate.pphone.focus();
//	    return false;
//	}

	/*  *************************** */
	if(document.getElementById('mobile1').value=="1" ){
	
         if(document.direct_donate.mobile.value=="")
	     {
	        alert("Please Enter the Mobile !");
	        document.direct_donate.mobile.focus();
	        return false;
	     }
	     if(isNaN(document.direct_donate.mobile.value))
	     {
	        alert("Please Enter the Valid Mobile !");
	        document.direct_donate.mobile.focus();
	        return false;
	     }
	  
	 }
	 	/* *************************** */
	 
	 
     if(Trim(document.direct_donate.add1.value)=="")
	 {
	    alert("Please Enter Address !");
	    document.direct_donate.add1.focus();
	    return false;
	 }		
	 if(document.getElementById('address1').value=="1" ){
	 if(Trim(document.direct_donate.address2.value)=="")
	 {
	    alert("Please Enter Address2 !");
	    document.direct_donate.address2.focus();
	    return false;
	 }	
	  
	 }	
	
     if(Trim(document.direct_donate.city.value)=="")
	 {
	    alert("Please Enter City !");
	    document.direct_donate.city.focus();
	    return false;
	 }
	
     if(Trim(document.direct_donate.country.value)=="")
	 {
	    alert("Please Enter Country!");
	    document.direct_donate.country.focus();
	    return false;
	 }
	 if(document.getElementById('text_box').style.display=='none')
     {
         if(document.getElementById('state').value=="")
	    {
	        alert("Please Select State!");
	        document.direct_donate.state.focus();
	        return false;
    	 }
     }
     if(document.getElementById('drop_down').style.display=='none')
     {
         if(document.getElementById('state1').value=="")
	    {
	        alert("Please Enter State!");
	        document.direct_donate.state1.focus();
	        return false;
    	 }
     }	 	 
     if(Trim(document.direct_donate.postcode.value)=="")
	 {
	    alert("Please Enter PostCode !");
	    document.direct_donate.postcode.focus();
	    return false;
	 }
	if(isNaN(document.direct_donate.postcode.value))
	{
	    alert("Please Enter Valid PostCode!");
	    document.direct_donate.postcode.focus();
	    return false;
	}	 
	if(document.getElementById('abn1').value=="1" ){
     if(document.direct_donate.abn.value=="")
	 {
	    alert("Please Enter ABN no. !");
	    document.direct_donate.abn.focus();
	    return false;
	 }
	 }
	 if(document.getElementById('comment1').value=="1" ){
     if(document.direct_donate.description.value=="")
	 {
	    alert("Please Enter comment !");
	    document.direct_donate.description.focus();
	    return false;
	 }
	 }
	 if(document.getElementById('orgname1').value=="1" ){
     if(document.direct_donate.crm_org_name.value=="")
	 {
	    alert("Please Enter orgnisation name !");
	    document.direct_donate.crm_org_name.focus();
	    return false;
	 }
	 }
	 
	 
		 
     if(Trim(document.direct_donate.amount.value)=="")
	 {
	    alert("Please Enter Amount !");
	    document.direct_donate.amount.focus();
	    return false;
	 }
	if(isNaN(document.direct_donate.amount.value))
	{
	    alert("Please Enter Valid Amount!");
	    document.direct_donate.amount.focus();
	    return false;
	}
     if(Trim(document.direct_donate.cc_card_Type_id_quick.value)=="")
	 {
	    alert("Please Select Card Type!");
	    document.direct_donate.cc_card_Type_id_quick.focus();
	    return false;
	 }	
	 if(Trim(document.direct_donate.cc_nameoncard_quick.value)=="")
	 {
	    alert("Please Enter Name On Card!");
	    document.direct_donate.cc_nameoncard_quick.focus();
	    return false;
	 }	
	 if(Trim(document.direct_donate.cc_number_quick.value)=="")
	 {
	    alert("Please Enter CC Number!");
	    document.direct_donate.cc_number_quick.focus();
	    return false;
	 }
	if(isNaN(document.direct_donate.cc_number_quick.value))
	{
	    alert("Please enter a valid credit card no !");
	    document.direct_donate.cc_number_quick.focus();
	    return false;
	}		 	
	 if(document.direct_donate.cc_number_quick.length<13 || document.direct_donate.cc_number_quick.length>16)
        {
            alert("Please enter a valid credit card no !");
	       document.direct_donate.cc_number_quick.focus();
	       return false;
        }	 
        /*
    if(isNaN(document.direct_donate.card_verification_quick.value))
    {
        alert('Please enter Card verification no. in numeric value');
        document.direct_donate.card_verification_quick.focus();
        return false;
    }
    
    if(Trim(document.direct_donate.card_verification_quick.value)=="")
    {
        alert('Please enter Card verification no.');
        document.direct_donate.card_verification_quick.focus();
        return false;
    }
    if(document.direct_donate.card_verification_quick.value.length > 4)
    {
        alert('Please enter Card verification no. in 4 digit');
       document.direct_donate.card_verification_quick.focus();
        return false;
    } */
 if(!document.direct_donate.termandcond_quick.checked)
   {
      alert("Please read & agree with the terms and conditions stated below !")
      document.direct_donate.termandcond_quick.focus();
      return false;
   }
   if(document.direct_donate.project_name.length!="1")
   {
       if(document.direct_donate.project_name.value=="")
        {        
            if(confirm("To select a project and then proceed with your transaction click 'ok'. To simply proceed with your transaction click 'cancel' and your transaction will be processed."))
             {
                 return false;
             }
           else
           {
                return true;
           }		
        } 
    }
  return true;
}

function Validate_one_time_donation()
{
  if(Trim(document.direct_donate.donerfname.value)=="")
    {
        alert("Please Enter First Name");
        document.direct_donate.donerfname.focus();
        return false;
    }
  if(Trim(document.direct_donate.lname.value)=="")
    {
        alert("Please Enter Family Name");
        document.direct_donate.lname.focus();
        return false;
    }
  if(Trim(document.direct_donate.pemail.value)=="")
        {
		   alert("Invalid E-mail Address ! Please Re-Enter ");
		   document.direct_donate.pemail.focus();
		   return (false);
        }
 if(document.direct_donate.pemail.value!="")
	{
		if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(direct_donate.pemail.value))
		{   
		}
		else
		{
		   alert("Invalid E-mail Address ! Please Re-Enter ");
		   document.direct_donate.pemail.focus();
		   return (false);
		}
	}  
    if(Trim(document.direct_donate.pphone.value)=="")
	 {
	    alert("Please Enter the Phone !");
	    document.direct_donate.pphone.focus();
	    return false;
	 }
	if(isNaN(document.direct_donate.pphone.value))
	{
	    alert("Please Enter the Valid Phone !");
	    document.direct_donate.pphone.focus();
	    return false;
	}
   /*if(document.direct_donate.mobile.value=="")
	 {
	    alert("Please Enter the Mobile !");
	    document.direct_donate.mobile.focus();
	    return false;
	 }
	 if(isNaN(document.direct_donate.mobile.value))
	 {
	    alert("Please Enter the Valid Mobile !");
	    document.direct_donate.mobile.focus();
	    return false;
	 }*/
     if(Trim(document.direct_donate.add1.value)=="")
	 {
	    alert("Please Enter Address !");
	    document.direct_donate.add1.focus();
	    return false;
	 }		
     /*if(document.direct_donate.add2.value=="")
	 {
	    alert("Please Enter Address !");
	    document.direct_donate.add2.focus();
	    return false;
	 }	*/
     if(Trim(document.direct_donate.city.value)=="")
	 {
	    alert("Please Enter City !");
	    document.direct_donate.city.focus();
	    return false;
	 }
     
     if(Trim(document.direct_donate.country.value)=="")
	 {
	    alert("Please Enter Country!");
	    document.direct_donate.country.focus();
	    return false;
	 }
	 if(document.getElementById('text_box').style.display=='none')
     {
         if(document.getElementById('state').value=="")
	    {
	        alert("Please Select State!");
	        document.direct_donate.state.focus();
	        return false;
    	 }
     }
     if(document.getElementById('drop_down').style.display=='none')
     {
         if(document.getElementById('state1').value=="")
	    {
	        alert("Please Enter State!");
	        document.direct_donate.state1.focus();
	        return false;
    	 }
     }	
	 //if(document.getElementById('state1').value=="")
	 //{
	  //  alert("Please Enter State!");
	  //  document.direct_donate.state.focus();
	  //  return false;
	// }	 
     if(Trim(document.direct_donate.postcode.value)=="")
	 {
	    alert("Please Enter PostCode !");
	    document.direct_donate.postcode.focus();
	    return false;
	 }
	if(isNaN(document.direct_donate.postcode.value))
	{
	    alert("Please Enter Valid PostCode!");
	    document.direct_donate.postcode.focus();
	    return false;
	}
	    if(Trim(document.direct_donate.cc_card_Type_id_onetime.value)=="")
	 {
	    alert("Please Select Card Type!");
	    document.direct_donate.cc_card_Type_id_onetime.focus();
	    return false;
	 }	
	 if(Trim(document.direct_donate.cc_nameoncard_onetime.value)=="")
	 {
	    alert("Please Enter Name On Card!");
	    document.direct_donate.cc_nameoncard_onetime.focus();
	    return false;
	 }	
	 if(Trim(document.direct_donate.cc_number_onetime.value)=="")
	 {
	    alert("Please Enter CC Number!");
	    document.direct_donate.cc_number_onetime.focus();
	    return false;
	 }
	if(isNaN(document.direct_donate.cc_number_onetime.value))
	{
	    alert("Please enter a valid credit card no !");
	    document.direct_donate.cc_number_onetime.focus();
	    return false;
	}		 	
	 if(document.direct_donate.cc_number_onetime.length<13 || document.direct_donate.cc_number_onetime.length>16)
        {
            alert("Please enter a valid credit card no !");
	       document.direct_donate.cc_number_onetime.focus();
	       return false;
        }
    if(Trim(document.direct_donate.amount_onetime.value)=="")
	 {
	    alert("Please Enter Amount !");
	    document.direct_donate.amount_onetime.focus();
	    return false;
	 }
	if(isNaN(document.direct_donate.amount_onetime.value))
	{
	    alert("Please Enter Valid Amount!");
	    document.direct_donate.amount_onetime.focus();
	    return false;
	}		 	 
   return true;
}

function Validate_rcc_donation()
    {
  if(Trim(document.direct_donate.donerfname.value)=="")
    {
        alert("Please Enter First Name");
        document.direct_donate.donerfname.focus();
        return false;
    }
  if(Trim(document.direct_donate.lname.value)=="")
    {
        alert("Please Enter Family Name");
        document.direct_donate.lname.focus();
        return false;
    }
  if(Trim(document.direct_donate.pemail.value)=="")
        {
		   alert("Invalid E-mail Address ! Please Re-Enter ");
		   document.direct_donate.pemail.focus();
		   return false;
        }
 if(document.direct_donate.pemail.value!="")
	{
		if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(direct_donate.pemail.value))
		{   
		}
		else
		{
		   alert("Invalid E-mail Address ! Please Re-Enter ");
		   document.direct_donate.pemail.focus();
		   return false;
		}
	}  
    if(Trim(document.direct_donate.pphone.value)=="")
	 {
	    alert("Please Enter the Phone !");
	    document.direct_donate.pphone.focus();
	    return false;
	 }
//	if(isNaN(document.direct_donate.pphone.value))
//	{
//	    alert("Please Enter the Valid Phone ! \n "+ PHONE_NUMBER_MESSAGE);
//	    document.direct_donate.pphone.focus();
//	    return false;
//	}

	if(document.getElementById('mobile1').value=="1" ){
	
         if(document.direct_donate.mobile.value=="")
	     {
	        alert("Please Enter the Mobile !");
	        document.direct_donate.mobile.focus();
	        return false;
	     }
	     if(isNaN(document.direct_donate.mobile.value))
	     {
	        alert("Please Enter the Valid Mobile !");
	        document.direct_donate.mobile.focus();
	        return false;
	     }
	  
	 }

     if(Trim(document.direct_donate.add1.value)=="")
	 {
	    alert("Please Enter Address !");
	    document.direct_donate.add1.focus();
	    return false;
	 }		
	 if(document.getElementById('address1').value=="1" ){
	 if(Trim(document.direct_donate.address2.value)=="")
	 {
	    alert("Please Enter Address2 !");
	    document.direct_donate.address2.focus();
	    return false;
	 }	
	  
	 }	
     if(Trim(document.direct_donate.city.value)=="")
	 {
	    alert("Please Enter City !");
	    document.direct_donate.city.focus();
	    return false;
	 }
     
     if(Trim(document.direct_donate.country.value)=="")
	 {
	    alert("Please Enter Country!");
	    document.direct_donate.country.focus();
	    return false;
	 }
	 if(document.getElementById('text_box').style.display=='none')
     {
         if(document.getElementById('state').value=="")
	    {
	        alert("Please Select State!");
	        document.direct_donate.state.focus();
	        return false;
    	 }
     }
     if(document.getElementById('drop_down').style.display=='none')
     {
         if(document.getElementById('state1').value=="")
	    {
	        alert("Please Enter State!");
	        document.direct_donate.state1.focus();
	        return false;
    	 }
     }	
     
     if(Trim(document.direct_donate.postcode.value)=="")
	 {
	    alert("Please Enter PostCode !");
	    document.direct_donate.postcode.focus();
	    return false;
	 }
	if(isNaN(document.direct_donate.postcode.value))
	{
	    alert("Please Enter Valid PostCode!");
	    document.direct_donate.postcode.focus();
	    return false;
	}
		if(document.getElementById('abn1').value=="1" ){
     if(document.direct_donate.abn.value=="")
	 {
	    alert("Please Enter ABN no. !");
	    document.direct_donate.abn.focus();
	    return false;
	 }
	 }
	 if(document.getElementById('comment1').value=="1" ){
     if(document.direct_donate.description.value=="")
	 {
	    alert("Please Enter comment !");
	    document.direct_donate.description.focus();
	    return false;
	 }
	 }
	 if(document.getElementById('orgname1').value=="1" ){
     if(document.direct_donate.crm_org_name.value=="")
	 {
	    alert("Please Enter orgnisation name !");
	    document.direct_donate.crm_org_name.focus();
	    return false;
	 }
	 }

    if(Trim(document.direct_donate.amount_rcc.value)=="")
	 {
	    alert("Please Enter Amount !");
	    document.direct_donate.amount_rcc.focus();
	    return false;
	 }
	if(isNaN(document.direct_donate.amount_rcc.value))
	{
	    alert("Please Enter Valid Amount!");
	    document.direct_donate.amount_rcc.focus();
	    return false;
	}
//   if(Trim(document.direct_donate.RecurStartDate.value)=="")
//	 {
//	    alert("Please Enter Start Date !");
//	    document.direct_donate.RecurStartDate.focus();
//	    return false;
//	 }	
   if(Trim(document.direct_donate.RecurFrequencyInDays.value)=="")
	 {
	    alert("Please Select Frequency !");
	    document.direct_donate.RecurFrequencyInDays.focus();
	    return false;
	 }		 
   if(document.direct_donate.cc_card_Type_id_rcc.value=="0")
	 {
	    alert("Please Select Card Type!");
	    document.direct_donate.cc_card_Type_id_rcc.focus();
	    return false;
	 }	
	 if(Trim(document.direct_donate.cc_nameoncard_rcc.value)=="")
	 {
	    alert("Please Enter Name On Card!");
	    document.direct_donate.cc_nameoncard_rcc.focus();
	    return false;
	 }	
	 if(Trim(document.direct_donate.cc_number_rcc.value)=="")
	 {
	    alert("Please Enter CC Number!");
	    document.direct_donate.cc_number_rcc.focus();
	    return false;
	 }
	if(isNaN(document.direct_donate.cc_number_rcc.value))
	{
	    alert("Please enter a valid credit card no !");
	    document.direct_donate.cc_number_rcc.focus();
	    return false;
	}		 	
	 if(document.direct_donate.cc_number_rcc.length<13 || document.direct_donate.cc_number_rcc.length>16)
        {
            alert("Please enter a valid credit card no !");
	       document.direct_donate.cc_number_rcc.focus();
	       return false;
        } 
    if(!document.direct_donate.termandcond_rcc.checked)
   {
      alert("Please read & agree with the terms and conditions stated below !")
      document.direct_donate.termandcond_rcc.focus();
      return false;
   }
    if(document.direct_donate.project_name.length!="1")
    {
        if(document.direct_donate.project_type_rcc.value=="")
        {        
            if(confirm("To select a project and then proceed with your transaction click 'ok'. To simply proceed with your transaction click 'cancel' and your transaction will be processed."))
             {
                 return false;
             }
           else
           {
                return true;
           }		
        }
    } 
      return true;  
   }
function Validate_rdd_donation()
    {
  if(Trim(document.direct_donate.donerfname.value)=="")
    {
        alert("Please Enter First Name");
        document.direct_donate.donerfname.focus();
        return false;
    }
  if(Trim(document.direct_donate.lname.value)=="")
    {
        alert("Please Enter Family Name");
        document.direct_donate.lname.focus();
        return false;
    }
  if(Trim(document.direct_donate.pemail.value)=="")
        {
		   alert("Invalid E-mail Address ! Please Re-Enter ");
		   document.direct_donate.pemail.focus();
		   return (false);
        }
 if(document.direct_donate.pemail.value!="")
	{
		if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(direct_donate.pemail.value))
		{   
		}
		else
		{
		   alert("Invalid E-mail Address ! Please Re-Enter ");
		   document.direct_donate.pemail.focus();
		   return (false);
		}
	}  
    if(Trim(document.direct_donate.pphone.value)=="")
	 {
	    alert("Please Enter the Phone !");
	    document.direct_donate.pphone.focus();
	    return false;
	 }
//	if(isNaN(document.direct_donate.pphone.value))
//	{
//	    alert("Please Enter the Valid Phone !");
//	    document.direct_donate.pphone.focus();
//	    return false;
//	}
//	if(isNaN(document.direct_donate.pphone.value))
//	{
//	    alert("Please Enter the Valid Phone ! \n "+PHONE_NUMBER_MESSAGE);
//	    document.direct_donate.pphone.focus();
//	    return false;
//	}

	if(document.getElementById('mobile1').value=="1" ){
	
         if(document.direct_donate.mobile.value=="")
	     {
	        alert("Please Enter the Mobile !");
	        document.direct_donate.mobile.focus();
	        return false;
	     }
	     if(isNaN(document.direct_donate.mobile.value))
	     {
	        alert("Please Enter the Valid Mobile !");
	        document.direct_donate.mobile.focus();
	        return false;
	     }
	  
    }
     if(Trim(document.direct_donate.add1.value)=="")
	 {
	    alert("Please Enter Address !");
	    document.direct_donate.add1.focus();
	    return false;
	 }		
	 if(document.getElementById('address1').value=="1" ){
	 if(Trim(document.direct_donate.address2.value)=="")
	 {
	    alert("Please Enter Address2 !");
	    document.direct_donate.address2.focus();
	    return false;
	 }	
	  
	 }	

     if(Trim(document.direct_donate.city.value)=="")
	 {
	    alert("Please Enter City !");
	    document.direct_donate.city.focus();
	    return false;
	 }
     
     if(Trim(document.direct_donate.country.value)=="")
	 {
	    alert("Please Enter Country!");
	    document.direct_donate.country.focus();
	    return false;
	 }
	 if(document.getElementById('text_box').style.display=='none')
     {
         if(document.getElementById('state').value=="")
	    {
	        alert("Please Select State!");
	        document.direct_donate.state.focus();
	        return false;
    	 }
     }
     if(document.getElementById('drop_down').style.display=='none')
     {
         if(document.getElementById('state1').value=="")
	    {
	        alert("Please Enter State!");
	        document.direct_donate.state1.focus();
	        return false;
    	 }
     }	 
     if(Trim(document.direct_donate.postcode.value)=="")
	 {
	    alert("Please Enter PostCode !");
	    document.direct_donate.postcode.focus();
	    return false;
	 }
	if(isNaN(document.direct_donate.postcode.value))
	{
	    alert("Please Enter Valid PostCode!");
	    document.direct_donate.postcode.focus();
	    return false;
	}
			if(document.getElementById('abn1').value=="1" ){
     if(document.direct_donate.abn.value=="")
	 {
	    alert("Please Enter ABN no. !");
	    document.direct_donate.abn.focus();
	    return false;
	 }
	 }
	 if(document.getElementById('comment1').value=="1" ){
     if(document.direct_donate.description.value=="")
	 {
	    alert("Please Enter comment !");
	    document.direct_donate.description.focus();
	    return false;
	 }
	 }
	 if(document.getElementById('orgname1').value=="1" ){
     if(document.direct_donate.crm_org_name.value=="")
	 {
	    alert("Please Enter orgnisation name !");
	    document.direct_donate.crm_org_name.focus();
	    return false;
	 }
	 }
   if(Trim(document.direct_donate.family_name.value)=="")
	 {
	    alert("Please Enter Last Name !");
	    document.direct_donate.family_name.focus();
	    return false;
	 }
   if(Trim(document.direct_donate.first_name.value)=="")
	 {
	    alert("Please Enter First Name !");
	    document.direct_donate.first_name.focus();
	    return false;
	 }
   if(Trim(document.direct_donate.address1_rdd.value)=="")
	 {
	    alert("Please Enter Your Address !");
	    document.direct_donate.address1_rdd.focus();
	    return false;
	 }	
   if(Trim(document.direct_donate.suburb_rdd.value)=="")
	 {
	    alert("Please Enter Your Suburb !");
	    document.direct_donate.suburb_rdd.focus();
	    return false;
	 }
   if(Trim(document.direct_donate.state_rdd.value)=="")
	 {
	    alert("Please Enter Your State !");
	    document.direct_donate.state_rdd.focus();
	    return false;
	 }	
   if(Trim(document.direct_donate.postcode_rdd.value)=="")
	 {
	    alert("Please Enter Your Post Code !");
	    document.direct_donate.postcode_rdd.focus();
	    return false;
	 }	 	 	  
  if(isNaN(document.direct_donate.postcode_rdd.value))
	{
	    alert("Please Enter Valid PostCode!");
	    document.direct_donate.postcode_rdd.focus();
	    return false;
	}


    if(document.getElementById('is_amount').checked==false)
	{
	    var radio_choice = false;
        for (counter = 0; counter < document.direct_donate.r_donation_amount.length; counter++)
        {
            if (document.direct_donate.r_donation_amount[counter].checked) radio_choice = true; 
        }
        if (!radio_choice)
        {
            alert("Please select/enter your amount.");
            document.direct_donate.is_amount.focus();
            return false;
        }
	}
	if(document.getElementById('is_amount').checked==true)
    { 
        if(Trim(document.direct_donate.donation_amount_rdd.value)=="")
        {
            alert('Please enter amount');
            document.direct_donate.donation_amount_rdd.focus();
            return false;
        }
        else if(direct_donate.donation_amount_rdd.value=="0" || isNaN(direct_donate.donation_amount_rdd.value))
        {
            alert('Amount must be a positive no');
            direct_donate.donation_amount_rdd.focus();
            return false;
        }
  	    else if((direct_donate.donation_amount_rdd.value*1)==0)
        {
	        alert("Amount must be a positive no!");
	        direct_donate.donation_amount_rdd.focus();
	        return false;
        }
    }
    if(Trim(document.direct_donate.RecurFrequencyInDays_rdd.value)=="")
    {
	    alert("Please select RDD Frequency InDays !");
	    direct_donate.RecurFrequencyInDays_rdd.focus();
	    return false;
    }
//    if(Trim(document.direct_donate.RecurStartDate_rdd.value)=="")
//    {
//	    alert("Please select RDD start date  !");
//	    direct_donate.RecurStartDate_rdd.focus();
//	    return false;
//    }
    if(Trim(document.direct_donate.AccountName_rdd.value)=="")
    {
	    alert("Please Enter Account Name !");
	    direct_donate.AccountName_rdd.focus();
	    return false;
    }
     if(Trim(document.direct_donate.AccountBSB1_rdd.value)=="" || isNaN(document.direct_donate.AccountBSB1_rdd.value) || document.direct_donate.AccountBSB1_rdd.value.length<3)
	{
		alert("Please enter your correct account BSB in the format (xxx-xxx) !");
		document.direct_donate.AccountBSB1_rdd.focus();
		return false;
	} 
	if(Trim(document.direct_donate.AccountBSB2_rdd.value)=="" || isNaN(document.direct_donate.AccountBSB2_rdd.value) || document.direct_donate.AccountBSB2_rdd.value.length<3)
	{
		alert("Please enter your correct account BSB in the format (xxx-xxx) !");
		document.direct_donate.AccountBSB2_rdd.focus();
		return false;
	}   
     if(Trim(document.direct_donate.AccountNumber_rdd.value)=="")
    {
	    alert("Please enter account number !");
	    direct_donate.AccountNumber_rdd.focus();
	    return false;
    }
    if(isNaN(direct_donate.AccountNumber_rdd.value))
    {
	    alert("Please enter Valid account number !");
	    direct_donate.AccountNumber_rdd.focus();
	    return false;
    }
    if(Trim(document.direct_donate.BankName_rdd.value)=="")
    {
	    alert("Please enter Name of your financial institution !");
	    direct_donate.BankName_rdd.focus();
	    return false;
    }
    if(Trim(document.direct_donate.sign_name.value)=="")
    {
	    alert("Please enter your name !");
	    direct_donate.sign_name.focus();
	    return false;
    }
    if(document.direct_donate.project_name.length!="1")
    {
        if(document.direct_donate.project_type_rdd.value=="")
        {        
            if(confirm("To select a project and then proceed with your transaction click 'ok'. To simply proceed with your transaction click 'cancel' and your transaction will be processed."))
             {
                 return false;
             }
           else
           {
                return true;
           }		
        }   
    }
    
    return true;
    }  
    
    
function membership_validate()
{
 if(document.getElementById('cc_card_Type_id1').value=="0")
    {
        alert('Please select card type');
        document.getElementById('cc_card_Type_id1').focus();
        return false;
    }

 if(document.getElementById('cc_nameoncard1').value=="")
    {
        alert('Please enter Name on Card');
        document.getElementById('cc_nameoncard1').focus();
        return false;
    }
    
    
    if(document.getElementById('cc_number1').value=="")
    {
        alert('Please enter Card no.');
        document.getElementById('cc_number1').focus();
        return false;
    }  
   /* if(isNaN(document.getElementById('cc_number1').value))
    {
        alert('Please enter Card no. in numeric value');
        document.getElementById('cc_number1').focus();
        return false;
    }
    
    if(frmmember.emailtodonor.checked == false)
    {
        alert('Please check email receipt.');
        frmmember.emailtodonor.focus();
        return false;
    }*/
   
    if(frmmember.termandcondcc.checked == false)
    {
        alert('Please check terms & condition.');
        frmmember.termandcondcc.focus();
        return false;
    }
    document.getElementById('save').disabled=true;
    document.getElementById('save').value="Please Wait .....";
    return true;
}

function membership_RCC()
{

 if(document.getElementById('cc_card_Type_id2').value=="0")
    {
        alert('Please select card type');
        document.getElementById('cc_card_Type_id2').focus();
        return false;
    }

 if(document.getElementById('cc_nameoncard2').value=="")
    {
        alert('Please enter Name on Card');
        document.getElementById('cc_nameoncard2').focus();
        return false;
    }
    if(document.getElementById('cc_number2').value=="")
    {
        alert('Please enter Card no.');
        document.getElementById('cc_number2').focus();
        return false;
    }     
    if(document.getElementById('termandcond2').checked == false)
    {
        alert('Please check terms & condition.');
        document.getElementById('termandcond2').focus();
        return false;
    }
    return true;
}
 function Membership_RDD()
{
    if(Trim(document.frmmember.AccountName.value)=="")
    {
	    alert("Please enter account name !");
	    document.frmmember.AccountName.focus();
	    return false;
    }
     if(Trim(document.frmmember.AccountBSB1.value)=="" || isNaN(document.frmmember.AccountBSB1.value) || document.frmmember.AccountBSB1.value.length<3)
	{
		alert("Please enter your correct account BSB in the format (xxx-xxx) !");
		document.frmmember.AccountBSB1.focus();
		return false;
	} 
	if(Trim(document.frmmember.AccountBSB2.value)=="" || isNaN(document.frmmember.AccountBSB2.value) || document.frmmember.AccountBSB2.value.length<3)
	{
		alert("Please enter your correct account BSB in the format (xxx-xxx) !");
		document.frmmember.AccountBSB2.focus();
		return false;
	}  
    if(Trim(document.frmmember.AccountNumber.value)=="")
    {
	    alert("Please enter account number !");
	    document.frmmember.AccountNumber.focus();
	    return false;
    }
    if(isNaN(document.frmmember.AccountNumber.value))
    {
	    alert("Please enter valid account number !");
	    document.frmmember.AccountNumber.focus();
	    return false;
    }
    
    
    
}

function change_state()
{
    if(document.getElementById("country").value!="Australia")
    {
         document.getElementById('text_box').style.display='block';
         document.getElementById('drop_down').style.display='none';
         document.getElementById('state_text').disabled=false;
    }
    else
    {
         document.getElementById('text_box').style.display='none';
         document.getElementById('drop_down').style.display='block';
         document.getElementById('state_text').disabled=true;
    }
}
function change_state1()
{
    if(document.getElementById("countryy").value!="Australia")
    {
         document.getElementById('text_box1').style.display='block';
         document.getElementById('drop_down1').style.display='none';
         document.getElementById('state_text1').disabled=false;
    }
    else
    {
         document.getElementById('text_box1').style.display='none';
         document.getElementById('drop_down1').style.display='block';
         document.getElementById('state_text1').disabled=true;
    }
}

function change_state_daligate(i)
{	
        if(document.getElementById("countryy_"+i).value!="Australia")
        {
             document.getElementById('text_box1_'+i).style.display='block';
             document.getElementById('drop_down1_'+i).style.display='none';
             document.getElementById('state_text1_'+i).disabled=false;
        }
        else
        {
             document.getElementById('text_box1_'+i).style.display='none';
             document.getElementById('drop_down1_'+i).style.display='block';
             document.getElementById('state_text1_'+i).disabled=true;
        }
      return true;  
  }

function validate_payment_rdd_account()
{

    var objRegExp  = /(^\d{3}$)|(^\d{3}-\d{3}$)/;
	var objRegExpnum  = /(^-?\d\d*$)/;	
	if(document.getElementById('is_amount').checked==false)
	{
	    var radio_choice = false;
        for (counter = 0; counter < document.frmbrowse.r_payment_amount.length; counter++)
        {
            if (document.frmbrowse.r_payment_amount[counter].checked) radio_choice = true; 
        }
        if (!radio_choice)
        {
            alert("Please select/enter your payment amount.");
            document.frmbrowse.is_amount.focus();
            return false;
        }
	}
	if(document.getElementById('is_amount').checked==true)
	{
	    if(Trim(document.frmbrowse.payment_amount.value)=="")
	    {
		    alert("Please enter your payment amount !");
		    document.frmbrowse.payment_amount.focus();
		    return false;		
	    }
	    else if(isNaN(document.frmbrowse.payment_amount.value))
	    {
		    //alert("Please enter your Valid payment amount !");
			 alert("If you have entered a dollar sign please remove this. You may only enter a the actual amount of the payment (eg 5 or 5.5 or 5.55 or any similar combination of figures).");
		    document.frmbrowse.payment_amount.focus();
		    return false;
	    }  
	}
	if(document.frmbrowse.RecurFrequencyInDays.value=="--Select--")
	{
		alert("Please select frequency in days !");
		document.frmbrowse.RecurFrequencyInDays.focus();
		return false;
	} 
	if(document.frmbrowse.RecurStartDate.value=="")
	{
		alert("Please enter your RDD start date !");
		document.frmbrowse.RecurStartDate.focus();
		return false;		
	}
	if(document.getElementById('RecurEndDate').value!="")
	{
		date_arr = document.getElementById('RecurStartDate').value.split('/');
        var startDate = new Date(date_arr[0],(date_arr[1]-1),date_arr[2]);
        
        edate_arr = document.getElementById('RecurEndDate').value.split('/');
        var endDate = new Date(edate_arr[0],(edate_arr[1]-1),edate_arr[2]);
       if(startDate>endDate)
       {
       alert('RDD start date should not be greater than end date');
       document.getElementById('RecurStartDate').focus();
       return false;
       }
	}		
	
	if(Trim(document.frmbrowse.AccountName.value)=="")
	{
		alert("Please enter your account name !");
		document.frmbrowse.AccountName.focus();
		return false;
	} 	
	if(Trim(document.frmbrowse.AccountBSB1.value)=="" || isNaN(document.frmbrowse.AccountBSB1.value) || document.frmbrowse.AccountBSB1.value.length<3)
	{
		alert("Please enter your correct account BSB in the format (xxx) !");
		document.frmbrowse.AccountBSB2.focus();
		return false;
	}		
	if(Trim(document.frmbrowse.AccountBSB2.value)=="" || isNaN(document.frmbrowse.AccountBSB2.value) || document.frmbrowse.AccountBSB2.value.length<3)
	{
		alert("Please enter your correct account BSB in the format (xxx) !");
		document.frmbrowse.AccountBSB2.focus();
		return false;
	}				
    
    if(Trim(document.frmbrowse.AccountNumber.value)=="")
	{
		alert("Please enter your correct account number !");
		document.frmbrowse.AccountNumber.focus();
		return false;
	}
	if(isNaN(document.frmbrowse.AccountNumber.value))
	{
		alert("Please enter your valid account number !");
		document.frmbrowse.AccountNumber.focus();
		return false;
	}	
   if(document.frmbrowse.project_type.value=="")
    {        
        if(confirm("This organisation MAY have set up a project or projects to\n which you can make a payment.\n If you wish your payment to go to a project instead of to the general revenue please click \"cancel\" and then select the project from the list of projects given in the drop down list.\n  If not simply click \"OK\" and your payment will proceed"))
        {
         return true;
        }
        else
        {
        return false;
        }		
    } 		
}

function validate_payment_rcc_account()
{

    if(Trim(document.frmbrowse.payment_amount.value)=="")
	{
		alert("Please enter your payment amount !");
		document.frmbrowse.payment_amount.focus();
		return false;
	}
	if(document.frmbrowse.payment_amount.value=="0" || isNaN(document.frmbrowse.payment_amount.value))
	{
		alert('Payment amount must be a positive no');
		document.frmbrowse.payment_amount.focus();
		return false;
	}		
	if((document.frmbrowse.payment_amount.value*1)==0)
    {
	    alert("Payment amount must be a positive no!");
	    document.frmbrowse.payment_amount.focus();
	    return false;
    }
    if(document.frmbrowse.RecurStartDate.value=="")
	{
		alert("Please enter your Recur Start Date !");
		document.frmbrowse.RecurStartDate.focus();
		return false;
	}
		 date_arr_start = document.frmbrowse.RecurStartDate.value.split('-');
     edate_arr = document.frmbrowse.RecurEndDate.value.split('-');
     if(document.frmbrowse.RecurEndDate.value!="")
     {
	     if(parseInt(date_arr_start[2])<=parseInt(edate_arr[2]))
	        {
	            if(parseInt(date_arr_start[2])==parseInt(edate_arr[2]))
	            {
	                if(parseInt(date_arr_start[1])<=parseInt(edate_arr[1]))
	                {
	                    if(parseInt(date_arr_start[1])==parseInt(edate_arr[1]))
	                    {
	                        if(parseInt(date_arr_start[0])< parseInt(edate_arr[0]))
	                        {
	                        }
	                        else
	                        {
	                            alert('RCC start date should not be greater than end date');
                                document.frmbrowse.RecurStartDate.focus();
                                return false;  
	                        }
	                    }
	                    else
	                    {
	                    }
	                } 
	                else
	                {
	                    alert('RCC start date should not be greater than end date');
                        document.frmbrowse.RecurStartDate.focus();
                        return false;  
	                }       
	            }
	        }
	     else
	        {
	            alert('RCC start date should not be greater than end date');
                document.frmbrowse.RecurStartDate.focus();
                return false;  
	        }
	   }
/*	   
	if(document.getElementById('RecurEndDate').value!="")
	{
		date_arr = document.getElementById('RecurStartDate').value.split('-');
        var startDate = new Date(date_arr[0],(date_arr[1]-1),date_arr[2]);
        
        edate_arr = document.getElementById('RecurEndDate').value.split('-');
        var endDate = new Date(edate_arr[0],(edate_arr[1]-1),edate_arr[2]);
       if(startDate>endDate)
       {
       alert('RCC start date should not be greater than end date');
       document.getElementById('RecurStartDate').focus();
       return false;
       }
	}		
	if(document.frmbrowse.RecurFrequencyInDays.value=="")
	{
		alert("Please select your Recur Frequency In Days!");
		document.frmbrowse.RecurFrequencyInDays.focus();
		return false;
	}
*/	
	if(document.frmbrowse.cc_card_Type_id.value=="0")
		{
			alert('Please select card type');
			document.frmbrowse.cc_card_Type_id.focus();
			return false;
		}
	if(Trim(document.frmbrowse.cc_nameoncard.value)=="")
	{
		alert('Please enter name on card');
		document.frmbrowse.cc_nameoncard.focus();
		return false;
	}
	
	cc_number = document.frmbrowse.cc_number.value;    	
	if(cc_number=="")
    {
	    alert("Please enter credit card no !");
	    document.frmbrowse.cc_number.focus();
	    return false;
    }

    ccflag=0;
    subfirst = cc_number.substr(0,cc_number.length-4);
    sublast = cc_number.substr(cc_number.length-4,cc_number.length);
    str = "";
    for(i=0;i<subfirst.length;i++)
    {
        str = str + "X";
    }
    
    if(((str!=subfirst) && isNaN(subfirst)) || isNaN(sublast))
    {
        alert("Please enter a valid credit card no !");
       document.frmbrowse.cc_number.focus();
       return false;
    }
    if(cc_number.length<13 || cc_number.length>16)
    {
        alert("Please enter a valid credit card no !");
       document.frmbrowse.cc_number.focus();
       return false;
    }	
   if(document.frmbrowse.project_type.value=="")
    {        
        if(confirm("This organisation MAY have set up a project or projects to\n which you can make a payment.\n If you wish your payment to go to a project instead of to the general revenue please click \"cancel\" and then select the project from the list of projects given in the drop down list.\n  If not simply click \"OK\" and your payment will proceed"))
         {
             return true;
         }
       else
       {
            return false;
       }	
    } 
   }
	
function rddpayment_validate()
{
    var objRegExp  = /(^\d{3}$)|(^\d{3}-\d{3}$)/;
	var objRegExpnum  = /(^-?\d\d*$)/;
    if(document.getElementById('is_amount').checked==false)
	{
	    var radio_choice = false;
        for (counter = 0; counter < document.frmdonation.r_donation_amount.length; counter++)
        {
            if (document.frmdonation.r_donation_amount[counter].checked) radio_choice = true; 
        }
        if (!radio_choice)
        {
            alert("Please select/enter your payment amount.");
            document.frmdonation.is_amount.focus();
            return false;
        }
	}
	if(document.getElementById('is_amount').checked==true)
	{
        if(Trim(document.frmdonation.donation_amount.value)=="")
        {
            alert('Please enter payment amount');
            frmdonation.donation_amount.focus();
            return false;
        }
        else if(frmdonation.donation_amount.value=="0" || isNaN(frmdonation.donation_amount.value))
        {
            alert('Amount must be a positive no');
            frmdonation.donation_amount.focus();
            return false;
        }
  	    else if((frmdonation.donation_amount.value*1)==0)
        {
	        alert("Amount must be a positive no!");
	        frmdonation.donation_amount.focus();
	        return false;
        }
    }
    if(Trim(document.frmdonation.RecurFrequencyInDays.value)=="")
    {
	    alert("Please select RDD Frequency InDays !");
	    frmdonation.RecurFrequencyInDays.focus();
	    return false;
    }
    if(Trim(document.frmdonation.RecurStartDate.value)=="")
    {
	    alert("Please select RDD start date  !");
	    frmdonation.RecurStartDate.focus();
	    return false;
    }
    if(document.frmdonation.RecurEndDate.value!="")
	{
        date_arr = document.frmdonation.RecurStartDate.value.split('-');
        var startDate = new Date(date_arr[0],(date_arr[1]-1),date_arr[2]);

        edate_arr = document.frmdonation.RecurEndDate.value.split('-');
        var endDate = new Date(edate_arr[0],(edate_arr[1]-1),edate_arr[2]);
        if(startDate>endDate)
        {
            alert('RDD start date should not be greater than end date');
            document.frmdonation.RecurStartDate.focus();
            return false;
        }
	  }	
    if(Trim(document.frmdonation.AccountName.value)=="")
    {
	    alert("Please enter Account Name !");
	    frmdonation.AccountName.focus();
	    return false;
    }
    if(document.document.frmdonation.AccountBSB1.value=="" || isNaN(document.frmdonation.AccountBSB1.value) || document.frmdonation.AccountBSB1.value.length<3)
	{
		alert("Please enter your correct account BSB in the format (xxx-xxx) !");
		document.frmdonation.AccountBSB1.focus();
		return false;
	} 
	if(document.document.frmdonation.AccountBSB2.value=="" || isNaN(document.frmdonation.AccountBSB2.value) || document.frmdonation.AccountBSB2.value.length<3)
	{
		alert("Please enter your correct account BSB in the format (xxx-xxx) !");
		document.frmdonation.AccountBSB2.focus();
		return false;
	}   
    if(Trim(document.frmdonation.AccountNumber.value)=="")
    {
	    alert("Please enter account number !");
	    frmdonation.AccountNumber.focus();
	    return false;
    }
    if(isNaN(frmdonation.AccountNumber.value))
    {
	    alert("Please enter Valid account number !");
	    frmdonation.AccountNumber.focus();
	    return false;
    }


    if(Trim(document.frmdonation.AccountName.value)=="")
    {
	    alert("Please enter account name !");
	    frmdonation.AccountName.focus();
	    return false;
    }
    if(Trim(document.frmdonation.AccountBSB.value)=="")
    {
	    alert("Please enter account BSB !");
	    frmdonation.AccountBSB.focus();
	    return false;
    }


       if(document.getElementById("project_type").value=="")
    {        
        if(confirm("To select a project and then proceed with your transaction click 'ok'. To simply proceed with your transaction click 'cancel' and your transaction will be processed."))
         {
             return false;
         }
       else
       {
            return true;
       }		
    } 	
}
function rccpayment_validate()
	{
		if(Trim(document.rccdonation.donation_amount.value)=="")
		{
			alert('Please enter payment amount');
			rccdonation.donation_amount.focus();
			return false;
		}
		if(rccdonation.donation_amount.value=="0" || isNaN(rccdonation.donation_amount.value))
		{
			alert('Amount must be a positive no');
			rccdonation.donation_amount.focus();
			return false;
		}		
		if((rccdonation.donation_amount.value*1)==0)
	    {
		    alert("Amount must be a positive no!");
		    rccdonation.donation_amount.focus();
		    return false;
	    }
	    if(Trim(document.rccdonation.RecurStartDate.value)=="")
		{
			alert('Please enter RCC Start Date');
			rccdonation.RecurStartDate.focus();
			return false;
		}	
	    if(document.rccdonation.RecurEndDate.value!="")
	    {
	 date_arr_start = document.rccdonation.RecurStartDate.value.split('-');
     edate_arr = document.rccdonation.RecurEndDate.value.split('-');
     if(document.rccdonation.RecurEndDate.value!="")
     {
	     if(parseInt(date_arr_start[2])<=parseInt(edate_arr[2]))
	        {
	            if(parseInt(date_arr_start[2])==parseInt(edate_arr[2]))
	            {
	                if(parseInt(date_arr_start[1])<=parseInt(edate_arr[1]))
	                {
	                    if(parseInt(date_arr_start[1])==parseInt(edate_arr[1]))
	                    {
	                        if(parseInt(date_arr_start[0])< parseInt(edate_arr[0]))
	                        {
	                        }
	                        else
	                        {
	                            alert('RCC start date should not be greater than end date');
                                document.rccdonation.RecurStartDate.focus();
                                return false;  
	                        }
	                    }
	                    else
	                    {
	                    }
	                } 
	                else
	                {
	                    alert('RCC start date should not be greater than end date');
                        document.rccdonation.RecurStartDate.focus();
                        return false;  
	                }       
	            }
	        }
	     else
	        {
	            alert('RCC start date should not be greater than end date');
                document.rccdonation.RecurStartDate.focus();
                return false;  
	        }
	   }	    }	
		if(Trim(document.rccdonation.RecurFrequencyInDays.value)=="")
		{
			alert('Please enter RCC Frequency In Days');
			rccdonation.RecurFrequencyInDays.focus();
			return false;
		}
		if(rccdonation.cc_card_Type_id.value=="0")
		{
			alert('Please select card type');
			rccdonation.cc_card_Type_id.focus();
			return false;
		}
		if(Trim(document.rccdonation.cc_nameoncard.value)=="")
		{
			alert('Please enter name on card');
			rccdonation.cc_nameoncard.focus();
			return false;
		}
		
		cc_number = rccdonation.cc_number.value;    	
		if(cc_number=="")
	    {
		    alert("Please enter credit card no !");
		    rccdonation.cc_number.focus();
		    return false;
	    }
  
        ccflag=0;
        subfirst = cc_number.substr(0,cc_number.length-4);
        sublast = cc_number.substr(cc_number.length-4,cc_number.length);
        str = "";
        for(i=0;i<subfirst.length;i++)
        {
            str = str + "X";
        }
        
        if(((str!=subfirst) && isNaN(subfirst)) || isNaN(sublast))
        {
            alert("Please enter a valid credit card no !");
	       rccdonation.cc_number.focus();
	       return false;
        }
        if(cc_number.length<13 || cc_number.length>16)
        {
            alert("Please enter a valid credit card no !");
	       rccdonation.cc_number.focus();
	       return false;
        }
	    if(document.getElementById("project_type").value=="")
        {        
            if(confirm("To select a project and then proceed with your transaction click 'ok'. To simply proceed with your transaction click 'cancel' and your transaction will be processed."))
             {
                 return false;
             }
           else
           {
                return true;
           }		
        } 
	}
	function onetimecc_payment_validate()
	{
		if(frmdonation.cc_card_Type_id.value=="0")
		{
			alert('Please select card type');
			frmdonation.cc_card_Type_id.focus();
			return false;
		}
		if(Trim(document.frmdonation.cc_nameoncard.value)=="")
		{
			alert('Please enter name on card');
			frmdonation.cc_nameoncard.focus();
			return false;
		}
		
		cc_number = frmdonation.cc_number.value;    	
		if(cc_number=="")
	    {
		    alert("Please enter credit card no !");
		    frmdonation.cc_number.focus();
		    return false;
	    }
  
        ccflag=0;
        subfirst = cc_number.substr(0,cc_number.length-4);
        sublast = cc_number.substr(cc_number.length-4,cc_number.length);
        str = "";
        for(i=0;i<subfirst.length;i++)
        {
            str = str + "X";
        }
        
        if(((str!=subfirst) && isNaN(subfirst)) || isNaN(sublast))
        {
            alert("Please enter a valid credit card no !");
	       frmdonation.cc_number.focus();
	       return false;
        }
        if(cc_number.length<13 || cc_number.length>16)
        {
            alert("Please enter a valid credit card no !");
	       frmdonation.cc_number.focus();
	       return false;
        }
				
		if(Trim(document.frmdonation.amount.value)=="")
		{
			alert('Please enter payment amount');
			frmdonation.amount.focus();
			return false;
		}
		if(frmdonation.amount.value=="0" || isNaN(frmdonation.amount.value))
		{
			alert('Payment amount must be a positive no');
			frmdonation.amount.focus();
			return false;
		}		
		if((frmdonation.amount.value*1)==0)
	    {
		    alert("Donation amount must be a positive no!");
		    frmdonation.amount.focus();
		    return false;
	    }
	   document.getElementById('donate_button').disabled=true;
       document.getElementById('donate_button').value="Please Wait .....";

}

function addexpintrest_validate()
	{
	    if(Trim(document.myform.fname.value)=="")
		{
			alert('Please enter first name');
			document.myform.fname.focus();
			return false;
		}
		if(Trim(document.myform.lname.value)=="")
		{
			alert('Please enter last name');
			document.myform.lname.focus();
			return false;
		}
		if(Trim(document.myform.email.value)=="")
		{
			alert('Please enter email');
			document.myform.email.focus();
			return false;
		}
		/*if(Trim(document.myform.organisation.value)=="")
		{
			alert('Please enter organisation name');
			document.myform.organisation.focus();
			return false;
		}*/
		if(Trim(document.myform.address1.value)=="")
		{
			alert('Please enter address1 ');
			document.myform.address1.focus();
			return false;
		}
		/*if(Trim(document.myform.address2.value)=="")
		{
			alert('Please enter address2');
			document.myform.address2.focus();
			return false;
		}*/
		if(Trim(document.myform.city.value)=="")
		{
			alert('Please enter city name');
			document.myform.city.focus();
			return false;
		}
		if(Trim(document.myform.zip.value)=="")
		{
			alert('Please enter post code');
			document.myform.zip.focus();
			return false;
		}
		/*if(Trim(document.myform.phone.value)=="")
		{
			alert('Please enter phone');
			document.myform.phone.focus();
			return false;
		}*/
		if(Trim(document.myform.mobile.value)=="")
		{
			alert('Please enter mobile');
			document.myform.mobile.focus();
			return false;
		}
		/*if(Trim(document.myform.fax.value)=="")
		{
			alert('Please enter fax  no');
			document.myform.fax.focus();
			return false;
		}*/
		if(Trim(document.getElementById('seat_total').value) =="" || document.getElementById('seat_total').value=="0")
		{
			alert('Please check the checkbox and enter no of seat');
			//document.myform.sub_total.focus();
			return false;
		}
		if(Trim(document.getElementById('seat_total').value) !="" || document.getElementById('seat_total').value!="0")
		{
		    var seatbook=document.getElementById('seat_total').value;
		    var min_seatbook=document.getElementById('min_seat').value;
		   
			if(parseInt(seatbook) > parseInt(min_seatbook))
			{
			alert('Your booked seats are greater than minimum number of seats');
			//document.myform.sub_total.focus();
			
			return false;
			}
		}
	
		if(document.myform.cc_card_Type_id.value=="0")
		{
			alert('Please select card type');
			document.myform.cc_card_Type_id.focus();
			return false;
		}
		if(Trim(document.myform.cc_nameoncard.value)=="")
		{
			alert('Please enter name on card');
			document.myform.cc_nameoncard.focus();
			return false;
		}
		
		cc_number = myform.cc_number.value;    	
		if(cc_number=="")
	    {
		    alert("Please enter credit card no !");
		    myform.cc_number.focus();
		    return false;
	    }
  
        ccflag=0;
        subfirst = cc_number.substr(0,cc_number.length-4);
        sublast = cc_number.substr(cc_number.length-4,cc_number.length);
        str = "";
        for(i=0;i<subfirst.length;i++)
        {
            str = str + "X";
        }
        
        if(((str!=subfirst) && isNaN(subfirst)) || isNaN(sublast))
        {
            alert("Please enter a valid credit card no !");
	       myform.cc_number.focus();
	       return false;
        }
        if(cc_number.length<13 || cc_number.length>16)
        {
            alert("Please enter a valid credit card no !");
	       myform.cc_number.focus();
	       return false;
        }

}
function getprice(id,total_loop)
{
	var sub_tortal=0;
	var seat_tortal=0;
	var taxtotal =0;
	for(i=0;i<total_loop;i++)
	{
		if(document.getElementById('price_id_'+i).checked==true)
		{
		
			if(document.getElementById('total_seat_'+i).value!="")
			{
				var Qty=document.getElementById('total_seat_'+i).value;
				var price=parseFloat(document.getElementById('price_'+i).value); 
				sub_tortal+= eval(Qty) * parseFloat(price);
				seat_tortal+=eval(Qty);
			}
		}
				
	}
	document.getElementById('sub_total').value = 'Price $'+sub_tortal.toFixed(2); 	
	document.getElementById('seat_total').value =seat_tortal ;
	//document.getElementById('tax').value =((sub_tortal.toFixed(2)* document.getElementById('tax_rate').value)/100) ;
	taxtotal =((sub_tortal.toFixed(2)* document.getElementById('tax_rate').value)/100);
		
		if(taxtotal=="0")
		{
		document.getElementById('tax').value ="0" ;
		}
		else
		{
		document.getElementById('tax').value =((sub_tortal.toFixed(2)* document.getElementById('tax_rate').value)/100) ;
		}
	
	
}
function remove_zero_seat(myfield, e,i)
{
    var key;
    var keychar;
   if (window.event)
           key = window.event.keyCode;
        else if (e)
           key = e.which;
        else
           return true;
        keychar = String.fromCharCode(key); 
        var length = document.getElementById('total_seat_'+i).value.length;
        if(length>0)
            {
               
                if ((key==null) || (key==0) || (key==8) || 
                (key==9) || (key==13) || (key==27) )
                        return true;
                // numbers
                else if ((("0123456789").indexOf(keychar) > -1))
                       return true;
                // decimal point jump     
                else if (key==46)
                        return false;

                else
                   return false;
            }
        else
            {
            // alert("Cant enter 0 first position in seat");
               if ((key==null) || (key==0) || (key==8) || 
                    (key==9) || (key==13) || (key==27) )
                   return true;
                 // numbers
                else if ((("123456789").indexOf(keychar) > -1))
                   return true;
                  // decimal point jump     
                else if (key==46)
                    return false;
                
                else
                   return false;

            }        

}

function validate_adddatigate()
{
  
  /* if(document.add_daligate.title.value=="")
    {
        alert("Please Select Title");
        document.add_daligate.title.focus();
        return false;
    }*/
    if(RTrim(document.add_daligate.fname.value)=="")
    {
        alert("Please Enter First Name ");
        document.add_daligate.fname.focus();
        return false;
    }    
 if(RTrim(document.add_daligate.email.value)=="")
    {
        alert("Please enter the e-mail address");
        document.add_daligate.email.focus();       
       return false;
    }    	
  if (document.add_daligate.email.value != "")
    {
            re=/\w{1,}/;
            emailExp= /^\w+(\-\w+)*(\.\w+(\-\w+)*)*@\w+(\-\w+)*(\.\w+(\-\w+)*)+$/ ; 
            if(!(emailExp.test(document.add_daligate.email.value)))
            {
            alert("Please enter the valid e-mail address");
            document.add_daligate.email.focus();
            return false;
            }
    }  
   if(RTrim(document.add_daligate.confirm_email.value)=="")
    {
        alert("Please enter the confirm e-mail address");
        document.add_daligate.confirm_email.focus();       
       return false;
    } 
    if (document.add_daligate.confirm_email.value != "")
    {
            re=/\w{1,}/;
            emailExp= /^\w+(\-\w+)*(\.\w+(\-\w+)*)*@\w+(\-\w+)*(\.\w+(\-\w+)*)+$/ ; 
            if(!(emailExp.test(document.add_daligate.confirm_email.value)))
            {
            alert("Please enter the valid confirm e-mail address");
            document.add_daligate.confirm_email.focus();
            return false;
            }
    }	
  	if(document.add_daligate.email.value!=document.add_daligate.confirm_email.value)
    {
        alert("Confirm  E-mail And Email not match ! Please Re-Enter Confirm  E-mail");
        document.add_daligate.confirm_email.focus();
        return false;
    } 
   /* if(document.add_daligate.organisation.value=="")
    {
        alert("Please Enter Organisation ");
        document.add_daligate.organisation.focus();
        return false;
    }
    if(document.add_daligate.department.value=="")
    {
        alert("Please Enter Department ");
        document.add_daligate.department.focus();
        return false;
    }    
    */
    if(document.add_daligate.address1.value=="")
    {
        alert("Please Enter Address Line 1 ");
        document.add_daligate.address1.focus();
        return false;
    }    
   
    if(document.add_daligate.city.value=="")
    {
        alert("Please Enter City ");
        document.add_daligate.city.focus();
        return false;
    }  
    if(document.add_daligate.post_code.value=="")
    {
        alert("Please Enter Post Code ");
        document.add_daligate.post_code.focus();
        return false;
    } 
    if(document.add_daligate.phone.value=="")
    {
        alert("Please Enter Telephone ");
        document.add_daligate.phone.focus();
        return false;
    } 
//    if(isNaN(document.add_daligate.phone.value))
 //   {
//    alert("Please Enter the Valid Phone ! \n" + PHONE_NUMBER_MESSAGE);
//    document.add_daligate.phone.focus();
 //   return false;
 //   }
   var loop,i;
	loop = document.getElementById("total_loop").value;
	//alert(loop);	
	for(i=0;i<loop;i++)
    {
        if(document.getElementById('add_companions_'+i).checked==true)
        {
    
            if(document.getElementById('c_fname_'+i).value=="")
			    {
				    alert("Please Enter Companions First Name ");
				    document.getElementById('c_fname_'+i).focus();
				    return false;
			    }
		    if(document.getElementById('c_lname_'+i).value=="")
			    {
				    alert("Please Enter Companions Last Name");
				    document.getElementById('c_lname_'+i).focus();
				    return false;
			    }
		}
		
   }
   /* if(document.add_daligate.add_companions.checked==true)
    {
     
        if(RTrim(document.add_daligate.c_fname.value)=="")
        {
            alert("Please Enter Companions First Name ");
            document.add_daligate.c_fname.focus();
            return false;
        }
        if(RTrim(document.add_daligate.c_lname.value)=="")
        {
            alert("Please Enter Companions Last Name ");
            document.add_daligate.c_lname.focus();
            return false;
        }        
        if(RTrim(document.add_daligate.c_email.value)=="")
        {
            alert("Please Enter the Companions e-mail address");
            document.add_daligate.c_email.focus();       
            return false;
        }    	
        if (document.add_daligate.c_email.value != "")
        {
            re=/\w{1,}/;
            emailExp= /^\w+(\-\w+)*(\.\w+(\-\w+)*)*@\w+(\-\w+)*(\.\w+(\-\w+)*)+$/ ; 
            if(!(emailExp.test(document.add_daligate.c_email.value)))
            {
            alert("Please enter the valid Companions e-mail address");
            document.add_daligate.c_email.focus();
            return false;
            }
        }  

    }*/
  return true;
}

function validate_sendfax()
{
     if(document.sendfax.fname.value=="")
    {
        alert("Please enter first name ");
        document.sendfax.fname.focus();
        return false;
    }
    if(document.sendfax.lname.value=="")
    {
        alert("Please enter last name ");
        document.sendfax.lname.focus();
        return false;
    }
    if(document.sendfax.email.value=="")
    {
        alert("Please enter email address");
        document.sendfax.email.focus();
        return false;
    }
    if (document.sendfax.email.value != "")
    {
            re=/\w{1,}/;
            emailExp= /^\w+(\-\w+)*(\.\w+(\-\w+)*)*@\w+(\-\w+)*(\.\w+(\-\w+)*)+$/ ; 
            if(!(emailExp.test(document.sendfax.email.value)))
            {
            alert("Please enter the valid  e-mail address");
            document.sendfax.email.focus();
            return false;
            }
    }	
    if(document.sendfax.phone.value=="")
    {
        alert("Please enter phone number ");
        document.sendfax.phone.focus();
        return false;
    }
    if(document.sendfax.fax_body.value=="")
    {
        alert("Please enter fax body ");
        document.sendfax.fax_body.focus();
        return false;
    }
    
    return true;
}


function Validate_quick_payment()
{

   if(Trim(document.direct_donate.donerfname.value)=="")
    {
        alert("PSSSSSSSSSSlease Enter First Name");
        document.direct_donate.donerfname.focus();
        return false;
    }
    if(Trim(document.direct_donate.lname.value)=="")
    {
        alert("Please Enter Family Name");
        document.direct_donate.lname.focus();
        return false;
    }
    if(Trim(document.direct_donate.pemail.value)=="")
        {
		   alert("Invalid E-mail Address ! Please Re-Enter ");
		   document.direct_donate.pemail.focus();
		   return (false);
        }
    if(document.direct_donate.pemail.value!="")
	{
		if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(direct_donate.pemail.value))
		{   
		}
		else
		{
		   alert("Invalid E-mail Address ! Please Re-Enter ");
		   document.direct_donate.pemail.focus();
		   return (false);
		}
	}
     if(Trim(document.direct_donate.pphone.value)=="")
	 {
	    alert("AAPlease Enter the Phone !");
	    document.direct_donate.pphone.focus();
	    return false;
	 }
//	if(isNaN(document.direct_donate.pphone.value))
//	{
//	    alert("Please Enter the Valid Phone !");
//	    document.direct_donate.pphone.focus();
//	    return false;
//	} 
//	if(isNaN(document.direct_donate.pphone.value))
//	{
//	    alert("Please Enter the Valid Phone !\n "+PHONE_NUMBER_MESSAGE);
//	    document.direct_donate.pphone.focus();
//	    return false;
//	} 

     if(Trim(document.direct_donate.add1.value)=="")
	 {
	    alert("Please Enter Address !");
	    document.direct_donate.add1.focus();
	    return false;
	 }		
	  if(Trim(document.direct_donate.city.value)=="")
	 {
	    alert("Please Enter City !");
	    document.direct_donate.city.focus();
	    return false;
	 }
	
     if(Trim(document.direct_donate.country.value)=="")
	 {
	    alert("Please Enter Country!");
	    document.direct_donate.country.focus();
	    return false;
	 }
	 if(document.getElementById('text_box').style.display=='none')
     {
         if(document.getElementById('state').value=="")
	    {
	        alert("Please Select State!");
	        document.direct_donate.state.focus();
	        return false;
    	 }
     }
     if(document.getElementById('drop_down').style.display=='none')
     {
         if(document.getElementById('state1').value=="")
	    {
	        alert("Please Enter State!");
	        document.direct_donate.state1.focus();
	        return false;
    	 }
     }	 	 
     if(Trim(document.direct_donate.postcode.value)=="")
	 {
	    alert("Please Enter PostCode !");
	    document.direct_donate.postcode.focus();
	    return false;
	 }
	if(isNaN(document.direct_donate.postcode.value))
	{
	    alert("Please Enter Valid PostCode!");
	    document.direct_donate.postcode.focus();
	    return false;
	}	 
	 
     if(Trim(document.direct_donate.amount.value)=="")
	 {
	    alert("Please Enter Amount !");
	    document.direct_donate.amount.focus();
	    return false;
	 }
	if(isNaN(document.direct_donate.amount.value))
	{
	    alert("Please Enter Valid Amount!");
	    document.direct_donate.amount.focus();
	    return false;
	}
     if(Trim(document.direct_donate.cc_card_Type_id_quick.value)=="")
	 {
	    alert("Please Select Card Type!");
	    document.direct_donate.cc_card_Type_id_quick.focus();
	    return false;
	 }	
	 if(Trim(document.direct_donate.cc_nameoncard_quick.value)=="")
	 {
	    alert("Please Enter Name On Card!");
	    document.direct_donate.cc_nameoncard_quick.focus();
	    return false;
	 }	
	 if(Trim(document.direct_donate.cc_number_quick.value)=="")
	 {
	    alert("Please Enter CC Number!");
	    document.direct_donate.cc_number_quick.focus();
	    return false;
	 }
	if(isNaN(document.direct_donate.cc_number_quick.value))
	{
	    alert("Please enter a valid credit card no !");
	    document.direct_donate.cc_number_quick.focus();
	    return false;
	}		 	
	 if(document.direct_donate.cc_number_quick.length<13 || document.direct_donate.cc_number_quick.length>16)
        {
            alert("Please enter a valid credit card no !");
	       document.direct_donate.cc_number_quick.focus();
	       return false;
        }	 
        /*
    if(isNaN(document.direct_donate.card_verification_quick.value))
    {
        alert('Please enter Card verification no. in numeric value');
        document.direct_donate.card_verification_quick.focus();
        return false;
    }
    
    if(Trim(document.direct_donate.card_verification_quick.value)=="")
    {
        alert('Please enter Card verification no.');
        document.direct_donate.card_verification_quick.focus();
        return false;
    }
    if(document.direct_donate.card_verification_quick.value.length > 4)
    {
        alert('Please enter Card verification no. in 4 digit');
       document.direct_donate.card_verification_quick.focus();
        return false;
    } */
 if(!document.direct_donate.termandcond_quick.checked)
   {
      alert("Please read & agree with the terms and conditions stated below !")
      document.direct_donate.termandcond_quick.focus();
      return false;
   }
   if(document.direct_donate.project_name.length!="1")
   {
       if(document.direct_donate.project_name.value=="")
        {        
            if(confirm("To select a project and then proceed with your transaction click 'ok'. To simply proceed with your transaction click 'cancel' and your transaction will be processed."))
             {
                 return false;
             }
           else
           {
                return true;
           }		
        } 
    }
  return true;
}

function dietary_validate()
{
     if(document.frm.meals_required[0].checked==true)
        {
           alert("Please select Catering on all Companion !");          
           return false;           
        }
	 return true;	
}

function accommodation_validate()
{
all_campaign_id = document.getElementById("all_campain_id").value;
campaign_new = all_campaign_id.split("~");	
			for(k=0;k<campaign_new.length;k++)
			{
			   // alert(campaign_new[k]);
			    if(document.getElementById('accommodation_id_'+campaign_new[k]).checked==true)
			    {
//			        alert("Checked");
			    }
			    else
			    {
			        var pack_id = document.getElementById('all_pack_id').value;
			     // alert(pack_id);
			      
			        packid_new = pack_id.split("~");	
		            for(j=0;j<packid_new.length;j++)
		            {
		               // alert(document.getElementById("loop_"+packid_new[j]).value);
		                all_loop = document.getElementById("loop_"+packid_new[j]).value;
		                all_loop = all_loop.split("~");	

		                for(r=0;r<all_loop.length;r++)
		                {
		                    if(document.getElementById('room_type_'+packid_new[j]+'_'+campaign_new[k]+'_'+all_loop[r]).checked==true)
		                    {
    		                    
		                        if(document.getElementById('start_date_'+packid_new[j]+'_'+campaign_new[k]).value=="")
		                        {
		                            alert("Please select arrival date");
		                            document.getElementById('start_date_'+packid_new[j]+'_'+campaign_new[k]).focus();
		                            return false;
		                        }
		                        if(document.getElementById('end_date_'+packid_new[j]+'_'+campaign_new[k]).value=="")
		                        {
		                            alert("Please select departure date");
		                            document.getElementById('end_date_'+packid_new[j]+'_'+campaign_new[k]).focus();
		                            return false;
		                        }

		                    }
		                }
                    }
			        
			    } 
			    
			}
return true;
	 
}
function back_submit(conf_id,txnid)
{
document.frm.method="post";
document.frm.action='index.php?var=add_daligate&conference_id='+conf_id+'&conferenceBooking_id='+txnid+'&tab=personal';
document.frm.submit();
return true;
}
	function check_no_meal1(camp_id)
{
	document.getElementById("meals_required_"+camp_id).checked=false;
}
