


// initialise plugins
jQuery(function(){
jQuery('ul.sf-menu').superfish();
});


$(document).ready(function(){ 
	$('#box3Rb').mouseover(function () {
		$(this).css("border-top","solid 1px #004b29");
	});
	$('#box3Rb').mouseout(function () {
		$(this).css("border","none");
	});
	
	$('.social').mouseover(function () {
		$(this).css("border-top","solid 1px transparent");
	});
	$('.social').mouseout(function () {
		$(this).css("border","none");
	});

 });	

$(document).ready(function(){ 
	$('.button1').mouseover(function () {
		$(this).css("border-top","solid 1px #059f59");  //light green
		$(this).css("border-bottom","solid 1px #059f59");  //light green
	});
	$('.button1').mouseout(function () {
		$(this).css("border","solid 1px transparent");
	});

	$('.button2').mouseover(function () {
		$(this).css("border-top","solid 1px #0e3825");  //dark green  #0e3825
		$(this).css("border-bottom","solid 1px #0e3825");  //dark green  #0e3825
	});
	$('.button2').mouseout(function () {
		$(this).css("border","solid 1px transparent");
	});

	$('.button3').mouseover(function () {
		$(this).css("border-top","solid 1px #059f59");  //light green
		$(this).css("border-bottom","solid 1px #059f59");  //light green
	});
	$('.button3').mouseout(function () {
		$(this).css("border","solid 1px transparent");
	});
 });	
 
 

function onSelectChange()
	{
	// change radio button if monthly selector changes
	$("input[name='p3_sel']").attr('checked', "2");
	}

function validate_frm()
	{
	// determine which radio button is checked
	var chkType = $("input[name='p3_sel']:checked").val();
	var chkItem = $("input[name='a3_sel']:checked").val();
	var other = $('#a3_other').val();
	var period = $('#rec_period').val();
	
	if ((chkItem == "0") && (other == ""))
		{
		alert("Please fill in a value for the recurring donation.");
		return false;
		} 

	if ((chkItem == "0") && (isNaN(other)==true))
		{
		alert("Please use only digits and a period when filling in the donation amount.");
		return false;
		}
	if ((chkItem == "0") && (+other <=0))
		{
		alert("Please use only positive values when filling in the donation amount.");
		return false;
		}	
	
	var amount = chkItem;
	if (chkItem == "0")
		{
		amount = other;
		}
	
	//var layML = $("#layML").attr('checked');
	//var resML = $("#resML").attr('checked');
	//var legML = $("#legML").attr('checked');


	
	var a3 = "";
	var p3 = "";
	var t3 = "";	
	//var comment = $("#donor_comment").val();
	//comment = comment.replace("|", "*");
	//item_name = ""
	
	
	if(chkType=='1')	
		{
		// single donation
		$('#amount').attr('value', amount);
		$('#item_name').attr('value', "One-time Donation");
		$('#cmd').attr('value', '_donations');
		$('#no_note').attr('value', '0');
		$('#a3').attr('value', '0');
		}
	else if(chkType=='2') 
		{
		// recurring donations
		a3 = amount;
		$('#item_name').attr('value', "Recurring Donation"); 		
		//*** EVERY MONTH *****
		if(period=='1') 
			{
			p3 = '1';
			t3 = 'M';
			}
		//*** 3 MONTHS *****
		else if(period=='2') 
			{
			p3 = '3';
			t3 = 'M';
			}
		//*** YEAR *****
		else if(period=='3') 
			{
			p3 = '1';
			t3 = 'Y';
			}
		$('#a3').attr('value', a3);
		$('#p3').attr('value', p3);
		$('#t3').attr('value', t3);
		$('#cmd').attr('value', '_xclick-subscriptions');
		$('#no_note').attr('value', '1');
		$('#amount').attr('value', '0');
		
		}	
	
	//var custom;
	//custom = amount + '|' + chkType + '|'+ p3 +'|'+ t3 + '|'+ layML+ '|'+ resML + '|'+ legML + '|' + comment;
	//$('#custom').attr('value', custom);
		

	//return false;	
	}



function validate_frm2()
	{
	alert("hi")
	}

