jQuery(function($){
	/*messageviewer sharebar get message id*/
	/*if ($('#sharebar').length > 0){
		var url = location.href
		var id = url.match(/em_id=(\d*\.\d)/i)[1]
		$('.emailshare').attr('href', $('.emailshare').attr('href') + id)
	}*/
	
	/*e-card show on check*/
	//$('form [id^=e_card], form [id^=tribute_ecard]').hide();
	 $('form [id^=e_card], form [id^=tribute_ecard]').show()
	 $('input#send_ecardname').attr('checked', 'checked')
	$('input#send_ecardname').click(function(){
		if (!$(this).attr('checked'))
			$('form [id^=e_card], form [id^=tribute_ecard]').hide();
		else
			$('form [id^=e_card], form [id^=tribute_ecard]').show()
	})
	
	/*memorial hide occasion on select*/
	$('select#tribute_type').change(function(){
		if ($(this).val() == 'tribute_type_value1')
			$('form [id^=new_occasion]').hide();
		else 
			$('form [id^=new_occasion]').show();
		})
		
	/*hide imo/iho checkbox */
	$('form [id^=tribute_show_honor_fields]').hide();

	/*remove uneeded helpers*/
	$('#tribute_notify_recip_title_Row .holdsErrorMsgTable,	#tribute_notify_recip_name_Row .holdsErrorMsgTable,	#tribute_type_Row .holdsErrorMsgTable, #level_standardauto_repeat_Row .holdsErrorMsgTable').hide();
	
	/*signup page hide fields*/
	/*
	$('#cons_email_opt_in').parents('tr:first').hide();
	$('#s_rememberMe').parents('tr:first').hide();
	$('form[id^=survey]').addClass('survey');
	$('label').css('font-size','12px');
	$('input').parent('td').css('vertical-align','middle');
	*/
	
	/*change h1title*/
	var url = location.href
	if (url.search(/(ServiceCenter|ConsProfile|ConsInterests)/g) > 0){
		$('h1.top').text('Donation Service Center');
		$('a:contains("Special Interests")').hide()
	}
	
	//cleanup ecard formatting in imo/iho
var ecard = $('tbody[id^=e_card_layout_selector]')
if (ecard) {
	$('tbody[id^=e_card_layout_selector] input[id^=stationery_layout_id]:eq(3)').parents('td:first').prependTo($('input[id^=stationery_layout_id]:eq(3)').parents('td:first').parent().next())
	ecard.find('input[id^=stationery_layout_id]').hide()
	ecard.find('label[for^=stationery_layout_id] img').css({'border': '3px solid white', 'margin': '5px'})
	ecard.find('input[id^=stationery_layout_id]:checked').prevAll('img').css({'border': '3px solid #cc3300'})
	ecard.find('label[for^=stationery_layout_id]').click(function(){
		ecard.find('label[for^=stationery_layout_id] img').css({'border': '3px solid white', 'opacity': .5})
		$(this).find('img').css({'border': '3px solid #cc3300', 'opacity': 1})
	})
}

})

	/*add icons*/
/*	$('[id^=level-standard] .holdsErrorMsgTable:eq(1)').remove(); $('[id^=level-standard] .holdsErrorMsgTable:first').attr('rowspan','2').html('<div class="award_icons"><a href="http://www.charitynavigator.org/index.cfm/bay/search.summary/orgid/3269.htm" target="_blank"><img border="0" src="../images/content/pagebuilder/11333.gif"/></a><br/><a target="_blank" href="http://www.charitywatch.org/" target="_blank"><img border="0" src="../images/content/pagebuilder/11332.jpg"/></a></div>')	
	}*/
	
/* column widths for levels on donation pages
$('tbody[id^=level-standard] tr > td:first-child').attr('width','5%')
*/

/*
$('form[id^=survey] p').css('padding','0')
$('#interior2 .bodyinner form[id^=survey] td').css('padding','0')
$('#interior2 .bodyinner form[id^=survey] .bodyinner td').css('padding','0')
$('form[id^=survey] > table > tbody > tr:lt(3) > td:first-child').hide()
$('form[id^=survey] table').css('margin','0')
*/

