// START UP TRIGGERSfunction getInvolved(){	Event.observe('signup', 'submit', chForm);}// FORM VALIDATIONfunction chForm(e){	thisForm = Event.element(e);	$('mysubmit').disabled = true;	var error = 'no'	var required = $(thisForm).getElementsByClassName('required');	required.each(function(n){		myDaddy = n.up();		if (n.next('img') !== undefined) n.next('img').remove();		if ($F(n) == '' || $F(n) == null || typeof $F(n) == 'undefined'){			new Insertion.After(n,"<img src=\"images/alert.gif\" />");			error = 'yes';		}	});	if (error === 'yes'){		Event.stop(e);		$('mysubmit').disabled = false;		new Effect.ScrollTo('content');		alert("You have not completed all required fields. Please check the form for items marked with an exclamation mark.");	} else {		return error;	}}function addRider(iPoint) {	// form elements we need	insertyBit = "<div><div class=\"rider\">\r<label>First Name</label>\r<input type=\"text\" name=\"afname[]\" value=\"\" class=\"required\" />\r</div>\r<div class=\"rider\">\r<label for=\'lname\'>Last Name</label>\r<input type=\"text\" name=\"alname[]\"  value=\"\" class=\"required\"  />\r</div>\r<div>\r<label for=\'email\'>Email</label>\r<input type=\"text\" name=\"aemail[]\" value=\"\" class=\"required\" />\r</div>\r<div class=\"rider\">\r<label>Age</label>\r<input type=\"text\" name=\"aage[]\" value=\"\" class=\"required\" />\r</div>\r<div class=\"rider\">\r<label>Sex</label><select name=\"asex[]\" class=\'cat required\' >\r<option value=\"\">Select...</option><option value=\"Male\" >Male</option>\r<option value=\"Female\" >Female</option>\r</select>\r</div>\r";	new Insertion.Before(iPoint,insertyBit);	// update total riders	$curRiders = $F('fee');	$curRiders ++;	$('fee').value = $curRiders;	updateTotal();}function updateTotal(){	//alert($F('medinner'));	if ($F('medinner')=='Yes'){		$('dinner').value = parseInt($F('dinner')) + 1;	}	rf = $F('fee') * rideFee;	df = $F('dinner') * dinnerFee;	cf = $F('cocktail') * cocktailFee;	rt = rf + df + cf;	rt = rt.toFixed(2);	$('total').value = rt;}function sponsorTotal(){	amount = $F('amount');	if($F('unit') !='' && $F('unit') !='undefined' && $F('unit')!=null){		unit=$F('unit')			} else {		unit='1';	}	total = amount * unit;	total=total.toFixed(2);	$('total').value = total;}function addMe(tid,vid,act){	target='addme_'+tid;		var url = 'includes/ajax_volunteer.php';	var pars = "cmd="+act+"&tid="+tid+"&vid="+vid;		var myProcess = new Ajax.Updater (	target,	url,		{		method: 'post',		parameters: pars,		evalScripts: true		}	);}function updateProfile(e){	thisForm = Event.element(e);	var error = 'no';	var required = $(thisForm).getElementsByClassName('required');		required.each(function(n){		myDaddy = n.up();		if (n.next('img') !== undefined) n.next('img').remove();		if ($F(n) == '' || $F(n) == null || typeof $F(n) == 'undefined'){			new Insertion.After(n,"<img src=\"images/alert.gif\" />");			error = 'yes';		}	});	Event.stop(e);	if (error === 'no') {	var pars=Form.serialize(thisForm);	var url = 'includes/ajax_profile.php';	var myProcess = new Ajax.Updater (	'profile',	url,		{		method: 'post',		parameters: pars,		evalScripts: true		}	);	}	}function updatePassword(e){	thisForm = Event.element(e);	var error = 'no';	var required = $(thisForm).getElementsByClassName('required');		required.each(function(n){		myDaddy = n.up();		if (n.next('img') !== undefined) n.next('img').remove();		if ($F(n) == '' || $F(n) == null || typeof $F(n) == 'undefined'){			new Insertion.After(n,"<img src=\"images/alert.gif\" />");			error = 'yes';		}	});	Event.stop(e);	if (error === 'no') {	var pars=Form.serialize(thisForm);	var url = 'includes/ajax_password.php';	var myProcess = new Ajax.Updater (	'profile',	url,		{		method: 'post',		parameters: pars,		evalScripts: true		}	);	}}// Admin Switch Stats Yearfunction switchYear(){	var pars=Form.serialize('statYear');	var url = '../includes/ad_stats.php';	var myProcess = new Ajax.Updater (	'yearStats',	url,		{		method: 'post',		parameters: pars,		evalScripts: true		}	);}// Admin Mark Rider Paidfunction markPaid(id){	var pars='id='+id;	var url = '../includes/ajax_paid.php';	var myProcess = new Ajax.Updater (	'payment',	url,		{		method: 'post',		parameters: pars,		evalScripts: true		}	);}function markPaidDonor(id){	var pars='id='+id;	var url = '../includes/ajax_paid_donor.php';	var myProcess = new Ajax.Updater (	'payment',	url,		{		method: 'post',		parameters: pars,		evalScripts: true		}	);}function outLinks(){	exlinks = document.getElementsByClassName('external');	exlinks.each(function(s) {  	s.setAttribute('target','_blank');	});}// SIFr Functionsfunction homeSifr(){if(typeof sIFR == "function"){    sIFR.replaceElement("h1 #s1", named({sFlashSrc: "./swf/mybc.swf", sColor: "#330066", sCase: "upper"}));    sIFR.replaceElement("h1 #s1c", named({sFlashSrc: "./swf/mybc.swf", sColor: "#330066", sCase: "upper", sFlashVars:"textalign=center"}));    sIFR.replaceElement("h2 #s2", named({sFlashSrc: "./swf/myc.swf", sColor: "#330066", sCase: "upper"}));    sIFR.replaceElement("h2 #s2n", named({sFlashSrc: "./swf/myc.swf", sColor: "#330066", sCase: "upper"}));    sIFR.replaceElement("h1 #s1li", named({sFlashSrc: "./swf/mylci.swf", sColor: "#330066", sCase: "upper"}));    sIFR.replaceElement("p#sTag", named({sFlashSrc: "./swf/mylci.swf", sColor: "#009933"}));    sIFR.replaceElement("#s3", named({sFlashSrc: "./swf/mybc.swf", sColor: "#6633CC", sCase: "upper", sFlashVars:"textalign=center", sWmode:"transparent"}));    sIFR.replaceElement("#s4", named({sFlashSrc: "./swf/mybc.swf", sColor: "#ffffff", sCase: "upper", sFlashVars:"textalign=center", sWmode:"transparent"}));};}function inSifr(){if(typeof sIFR == "function"){    sIFR.replaceElement("#content h1", named({sFlashSrc: "./swf/myc.swf", sColor: "#330066", sCase: "upper", sWmode:"transparent"}));    sIFR.replaceElement("#spcontent h1", named({sFlashSrc: "./swf/myc.swf", sColor: "#330066", sCase: "upper", sWmode:"transparent"}));    sIFR.replaceElement("#content h2", named({sFlashSrc: "./swf/myc.swf", sColor: "#330066", sWmode:"transparent"}));    sIFR.replaceElement("#spcontent h2", named({sFlashSrc: "./swf/myc.swf", sColor: "#330066", sWmode:"transparent"}));    sIFR.replaceElement("#content h3", named({sFlashSrc: "./swf/mylci.swf", sColor: "#009933", sWmode:"transparent"}));    sIFR.replaceElement("#spcontent h3", named({sFlashSrc: "./swf/mylci.swf", sColor: "#009933", sWmode:"transparent"}));     sIFR.replaceElement("#local h2", named({sFlashSrc: "./swf/mylci.swf", sColor: "#009933", sWmode:"transparent"}));    sIFR.replaceElement("#local h3", named({sFlashSrc: "./swf/mylci.swf", sColor: "#009933", sWmode:"transparent"}));        sIFR.replaceElement("p#sTag", named({sFlashSrc: "./swf/mylci.swf", sColor: "#009933", sCase: "upper", sFlashVars:"textalign=center", sWmode:"transparent"}));     sIFR.replaceElement("#content blockquote", named({sFlashSrc: "./swf/mylci.swf", sColor: "#009933", sCase: "upper", sFlashVars:"textalign=left", sWmode:"transparent"}));          sIFR.replaceElement("#s3", named({sFlashSrc: "./swf/mybc.swf", sColor: "#6633CC", sCase: "upper", sFlashVars:"textalign=center", sWmode:"transparent"}));    sIFR.replaceElement("#s4", named({sFlashSrc: "./swf/mybc.swf", sColor: "#ffffff", sCase: "upper", sFlashVars:"textalign=center", sWmode:"transparent"}));};}/* Google Map Loader */function mapper() { 	GMapLoad(); 	inSifr();}function relative_time(time_value) { 	var values = time_value.split(" "); 		time_value = values[1] + " " + values[2] + ", " + values[5] + " " + values[3]; 		var parsed_date = Date.parse(time_value); 		var relative_to = (arguments.length > 1) ? arguments[1] : new Date(); 		var delta = parseInt((relative_to.getTime() - parsed_date) / 1000); 		delta = delta + (relative_to.getTimezoneOffset() * 60);		if (delta < 60) { 		return 'less than a minute ago'; 	} else if(delta < 120) { 		return 'about a minute ago'; 	} else if(delta < (45*60)) { 		return (parseInt(delta / 60)).toString() + ' minutes ago'; 	} else if(delta < (90*60)) { 		return 'about an hour ago'; 	} else if(delta < (24*60*60)) { 		return 'about ' + (parseInt(delta / 3600)).toString() + ' hours ago';	} else if(delta < (48*60*60)) { 		return '1 day ago'; 	} else { 		return (parseInt(delta / 86400)).toString() + ' days ago'; 	}}function twitterCallback(obj) { 	var id = obj[0].user.id; 	document.getElementById('my_twitter_status').innerHTML = obj[0].text; 	//document.getElementById('my_twitter_status_time').innerHTML = relative_time(obj[0].created_at); } 