		$(function() {
			bgImageTotal=5;
			randomNumber = Math.round(Math.random()*(bgImageTotal-1))+1;
			imgPath=('graphx/bg'+randomNumber+'.jpg');
			$('body#homepage').css('background-image', ('url("'+imgPath+'")'));
			
			$('#glossary-terms dd:first').show();
			$('#glossary-terms dt').click(function () { 
      			$(this).next('dd').slideToggle().siblings('dd:visible').slideUp();
    		});
			
			///////////////// Login/Registration div switching ////////
			
			$('#displayLogin').click(function(){
				$('#login-box').css('display','');
				$('#contactForm').css('display','none');
			});
			
			$('#displayForm').click(function(){
				$('#login-box').css('display','none');
				$('#contactForm').css('display','');
			});
			
		});

		Cufon.replace('#news-updates p span', { fontFamily: 'Petita' });
		Cufon.replace('#content p span', { fontFamily: 'Petita' });
		Cufon.replace('#l2-header h1', { fontFamily: 'Petita-Bold' });
		Cufon.replace('#l3-header h1', { fontFamily: 'Petita-Bold' });
		
		//Display other div if other is selected in forms //////
		function displayMedAppOther(selectedValue) {
			if(selectedValue == "Other") {
				$(function() {$('#otherFormDiv').css('display','');});
			} else {
				$(function() {$('#otherFormDiv').css('display','none');});
			}
		}
		
		//Validate emial
		function isEmail (s) {
			var isEmail_re       = /^\s*[\w\-\+_]+(\.[\w\-\+_]+)*\@[\w\-\+_]+\.[\w\-\+_]+(\.[\w\-\+_]+)*\s*$/;
			return String(s).search (isEmail_re) != -1;
		}

		function validateRadioButton(aform,name,message) {
			myOption = -1;

			var numRadioButtons =  eval("aform."+name+".length");
				
			for (i=0;i<numRadioButtons;++i) {
				if (eval("aform."+name+"["+i+"].checked")) {
					return "";
				}
			}
			
			return message + '\n';
		}

		//Validate Form
		function validateForm(aform) {
			var el = aform.elements;
			var errorMsg = '';
			
			for(var i = 0 ; i < el.length ; ++i) {
				var googleToolbar = el[i].title;
				
				if(googleToolbar.substr(0,11) == "Your Google") {continue;}
				
				if(el[i].name == 'email') {
					if(isEmail(el[i].value) == false) {
						errorMsg += 'Invalid Email' + '\n';
					}
				} else if(el[i].type == 'checkbox') {
					if(el[i].checked == false  && el[i].title.length > 0) {
						errorMsg += el[i].title + '\n';
					}
				} else if (el[i].type == 'select-one') {
					if(el[i].selectedIndex < 1 && el[i].title.length > 0) {
						errorMsg += el[i].title + '\n';
					}
				} else if (el[i].title.length > 0) {
					if(el[i].value.length == 0) {
						errorMsg += el[i].title + '\n';
					}
				}
			}
			
			if(errorMsg.length > 0) {
				errorMsg = 'Please complete all required fields below:\n'+errorMsg;
				alert(errorMsg);
				return false;
			} else {
				return true;
			}
			
			return false;
		}