var clockID 	= 0;
var images 	= new Array();
			
function UpdateClock() {
   	if(clockID) {
      		clearTimeout(clockID);
      		clockID  = 0;
   	}
   				
   	document.getElementById("timespent").value = parseInt(document.getElementById("timespent").value) + 1;
   				
   	clockID = setTimeout("UpdateClock()", 1000);
}
			
function StartClock() {
   	clockID = setTimeout("UpdateClock()", 500);
}

function KillClock() {
   	if(clockID) {
      		clearTimeout(clockID);
      		clockID  = 0;
   	}
   				
   	var httpObject = null;

	if (window.ActiveXObject)
		httpObject = new ActiveXObject("Microsoft.XMLHTTP");
	else if (window.XMLHttpRequest)
		httpObject = new XMLHttpRequest();
   	else {
		alert("Your browser does not support Ajax applications.");
	}
	
	if (httpObject != null) {
		httpObject.open("GET", "http://www.insidespectrum.com/SpectrumWebJobs/MyViewbook/Scripts/serverutilities.php?cmd=updatetime&time="+document.getElementById("timespent").value+"&purl=<?= $purlname ?>", true);
		httpObject.send(null);
		httpObject.onreadystatechange = (function redirect() { if(httpObject.readyState == 4) {} });
	}
}
	
function ChangeChoiceContent(id, firstname) {
	if (id == "majorchange") {
		var major = document.getElementById(id).value;
		var text; 
		var background;
		
		if (major == "Chemistry") {
			text = "<span class='name'><b>"+firstname+"</b>, nice choice.</span><br /><br />Maybe you dream about discovering a new element or advancing the study of DNA. Or maybe you want to be part of a scientific team that discovers a new source of energy to fuel our cars and light our homes.<br /><br />As a Chemistry major at Relevance U, you&#8217;ll get a broad perspective of the practices that constitute modern chemistry and <b>develop a strong background in chemistry, biology, physics, and mathematics</b>.<br /><br />Your chemistry education will occur in a friendly, open atmosphere. You&#8217;ll receive the personal attention of highly qualified faculty, all of whom currently hold doctorate degrees from distinguished universities.<br /><br />Spectrum U Chemistry students enjoy learning in an intimate atmosphere. Our average class size is 14 students. <b>The student-to-faculty ratio in the major is approximately 9:1</b>.<br /><br />Relevance U will provide you with the resources that will guide you in your career choice. <br /><br />See yourself as a future chemist with your education from Relevance University!";
			background = "url('images/Major_Chemistry.jpg')";
		}
		else if (major == "History") {
			text = "<span class='name'><b>"+firstname+"</b>, nice choice.</span><br /><br />History is more than a collection of dry-as-dust facts&#8212;it&#8217;s the study of human life! <b>Our History program combines the study of history with the study of political science</b> to help our students understand the structure, organization and theory of past and present cultures and governments.<br /><br />The History program at Relevance U is designed to acquaint you with different ages, societies and cultures, and to develop your strengths in writing and thinking. While you&#8217;re here, you&#8217;ll develop your analytical skills and research techniques.<br /><br />Your appetite for history will be satisfied at the Relevance U not only because it&#8217;s a great place to learn, but also because <b>our faculty are some of the best scholars in the country</b> who bring years of study and experience to the classroom.<br /><br />With a degree in history, <b>you&#8217;ll be well prepared for graduate studies or a career in education, law, business or government service</b>.<br /><br />Join us at Relevance University and discover who you are and who you will become.";
			background = "url('images/Major_History.jpg')";
		}
		else if (major == "Nursing") {
			text = "<span class='name'><b>"+firstname+"</b>, nice choice.</span> <br /><br />A recent national survey ranked nursing as the <b>most respected profession</b>. And we agree. Nursing is not only a great career choice, it&#8217;s in high demand because of the current critical nursing shortage. <br /><br /><b>There&#8217;s no better place to earn your nursing degree</b> than at Relevance U. Our staff of exceptionally well-qualified professors are devoted to helping you tie classroom theory to the real world of professional nursing practice. <br /><br />The combination of our excellent faculty and motivated students is evidenced by our 100% passing rate on the National Nursing Examination (NCLEX). In addition, Relevance U has received <b>national accreditation by The Commission on Collegiate Nursing Education (CCNE)</b>. <br /><br />Our focus on clinical decision-making and hands-on skills will make you an <b>aggressively recruited asset</b> by leading hospitals and health care agencies in our region and beyond. Upon graduation you&#8217;ll join the growing ranks of Relevance U students who are making a difference in the world of health care. <br /><br />See yourself as a future nurse with your degree from Relevance University!";
			background = "url('images/Major_Nursing.jpg')";
		}
		else if (major == "Media Studies") {
			text = "<span class='name'><b>"+firstname+"</b>, nice choice.</span> <br /><br />As a Media Studies major you will be entering the digital world. Our program will help you focus your creativity and talents so that you can <b>thrive in the exploding world of media</b>.<br /><br />At Relevance U, we remain dedicated to the principle that all communication must be based on solid thinking, writing, and speaking skills. <b>Our faculty is dedicated</b> to engaging you in developing these skills in ways that will allow you to contribute to various media outlets like print news, magazines, television, radio, and online media.<br /><br />Internships at places like MTV, Nickelodeon, ABC, WABC-AM, Random House, The New York Times, and Newsweek <b>will help you secure your first position in the field after graduation</b>. Our Office of Internship and Co-Op Education will assist you in finding the right internship.<br /><br />Your liberal arts education from Relevance U will prepare you with the knowledge and skills to be an outstanding contributor to any field of media.";
			background = "url('images/Major_MediaStudies.jpg')";
		}
		else {
			text = "<span class='name'><b>"+firstname+"</b>, you&#8217;ve got amazing career choices!</span> <br /><br />Relevance U has a lot of different majors for you to choose from, but if you&#8217;re not quite sure what you want to do, thats fine. You&#8217;re not alone. At Relevance U, if you&#8217;re not sure what you want to major in, <b>you&#8217;re not &quot;undecided&quot;&#8212;just deciding</b>.<br /><br />While you&#8217;re deciding, you can use a variety of support tools we offer. <b>You&#8217;ll get one-on-one time with a dedicated faculty mentor</b> who can advise you about possible majors and career directions. You&#8217;ll even have access to our Career Services professionals, on- and off-campus career fairs, our career library, and free online assessments.<br /><br />So don&#8217;t sweat it. When you enter Relevance U, you&#8217;ll start with liberal arts classes that are required for all majors. Through those classes, you&#8217;ll be able to <b>explore your interests as you build the critical thinking, effective speaking, and clear writing skills</b> that will help you succeed no matter what career you decide to pursue.<br /><br />However you see yourself using your college degree, we&#8217;re confident that your Relevance U education will equip you with the knowledge and experience you need to thrive.";
			background = "url('images/Major_Undecided.jpg')";
		}
	
		document.getElementById("majortext_jsfill").innerHTML = text;
		document.getElementById("majorbackground_jsfill").style.backgroundImage = background;
	}
	else if (id == "campuschange") {
		var status = document.getElementById(id).value;
		var text;
		var background;
		
		if (status == "oncampus") {
			text = "<b>Our home is your home!</b><br /><br />Living on campus has long been a college tradition. What&#8217;s not so traditional is on-campus life at Relevance U&#8212;our residence halls are modern facilities with all the comforts of home. Whether you reside in Dartmouth or Speedwell Halls or in one of our recently renovated College Bay Townhouses, you&#8217;ll appreciate all the state-of-the-art amenities.";
			background = "url('images/Live_Resident_4.5x8.5.jpg')";
		}
		else {
			text = "<b>Relevance U is easy to get to!</b><br /><br />Commuting&#8212;it&#8217;s what you want. Sometimes it&#8217;s all about the benefits. You can maintain your lifestyle, keep your part-time job, continue to participate in community events, or have one of a dozen other good reasons commuting is right for you. Best of all, you&#8217;ll get a quality college education close to home.";
			background = "url('images/Live_Commute_4.5X8.5.jpg')";
		}
		
		document.getElementById("campustext_jsfill").innerHTML = text;
		document.getElementById("campusbackground_jsfill").style.backgroundImage = background;
	}
	else if (id == "sportchange") {
		var sport = document.getElementById(id).value;
		var text;
		var background;
		
		if (sport == "Mens Baseball") {
			text = "<b>So whether you see yourself on the course or in the stands, superfan or casual supporter, you&#8217;re always part of the action!</b><br /><br />The Relevance U baseball program has an incredible history of success and is primed to add to the record books in 2009.  The Relevancies own five Northeast Conference Championships, the most recent title coming in 2008 when the team finished the season 35-5 and advanced to the NCAA Tournament for the fifth time.  The Relevancies play their home games at One-to-One Stadium, just a short distance away from campus.";
			background = "url('images/Involv_Baseball_6.5x8.5.jpg')";
		}
		else if (sport == "Womens Softball") {
			text = "<b>So whether you see yourself on the course or in the stands, superfan or casual supporter, you&#8217;re always part of the action!</b> <br /><br /> The Relevance U softball program is consistently among the best in the Northeast Conference, winning 7 of the last 10 conference title games. The Relevancies last advanced to the NCAA Tournament in 2006. In 2007, Relevance U was 10-5 in conference play and tied for second in the final standings. The Relevancies play their home games on Relevance Field, right in the center of campus.";
			background = "url('images/Involv_Soft_6.5x8.5.jpg')";
		}
		else if (sport == "Mens Cross Country") {
			text = "<b>So whether you see yourself on the course or in the stands, superfan or casual supporter, you&#8217;re always part of the action!</b> <br /><br /> Relevance runners have the luxury of training on our challenging 10K course that&#8217;s located just a few minutes from campus. And all that training pays off. The Relevance U men&#8217;s and women&#8217;s cross country programs have thrown the hammer down in recent years&#8212;the women claimed the Northeast Conference title in 2007 and 2008, and the men clinched a second place finish at nationals in 2008.";
			background = "url('images/Involv_M_XC_6.5x8.5.jpg')";
		}
		else if (sport == "Womens Cross Country") {
			text = "<b>So whether you see yourself on the course or in the stands, superfan or casual supporter, you&#8217;re always part of the action!</b> <br /><br /> Relevance runners have the luxury of training on our challenging 10K course that&#8217;s located just a few minutes from campus. And all that training pays off. The Relevance U men&#8217;s and women&#8217;s cross country programs have thrown the hammer down in recent years&#8212;the women claimed the Northeast Conference title in 2007 and 2008, and the men clinched a second place finish at nationals in 2008.";
			background = "url('images/Involv_W_XC_6.5X8.5.jpg')";
		}
		else if (sport == "Womens Swimming") {
			text = "<b>So whether you see yourself on the course or in the stands, superfan or casual supporter, you&#8217;re always part of the action!</b> <br /><br /> The Relevance U women&#8217;s swimming program has a long tradition of incredibly talented swimmers.  In 2007, the Relevancies won the Northeast Conference Championship Meet, the third title in program history. At the same meet, Relevance U had six individual event winners and set a number of school records. The Relevancies compete at the pool inside the ROI Center.";
			background = "url('images/Involv_W_Swimming_6.5x8.5.jpg')";
		}
		else if (sport == "Mens Swimming") {
			text = "<b>So whether you see yourself on the course or in the stands, superfan or casual supporter, you&#8217;re always part of the action!</b> <br /><br /> The Relevance U men&#8217;s swimming program has a long tradition of incredibly talented swimmers. In 2007, the Relevancies posted the best record in program history with a successful 8-4 season.  Relevance U also had four individual event-winners at the Northeast Conference Championships in 2007. The Relevancies compete at the pool inside the ROI Center.";
			background = "url('images/Involv_M_Simming_6.5x8.5.jpg')";
		}
		
		document.getElementById("sporttext_jsfill").innerHTML = text;
		document.getElementById("sportbackground_jsfill").style.backgroundImage = background;
	}
	else if (id == "clubchange") {
		var club = document.getElementById(id).value;
		var text;
		var background;
		
		if (club == "Lacrosse Club") {
			text = "<b>The Lacrosse Club at Relevance U promotes sportsmanship, teamwork, and fun.</b> <br /><br /> Open to all skill levels, the Lacrosse Club gives athletically motivated students a chance to play a sport without the commitment of the varsity level. Scrimmages against other college club teams provide the intensity of competition without the stress of a full-time schedule.";
			background = "url('images/Involv_Lacross_4.5x8.5.jpg')";
		}
		else if (club == "Big Brothers/Big Sisters") {
			text = "<b>Buddy up with local youth in the community by joining Big Brothers/Big Sisters.</b> <br /><br /> This volunteer mentor program is both rewarding and heart-warming as our students invest their time with underprivileged children. Serving as mentors and role models, members experience the power of friendship that stems from the connection they make with remarkable children.";
			background = "url('images/Involv_Bigbrosbigsis_4.5x8.5.jpg')";
		}
		else if (club == "Student Senate") {
			text = "<b>Be heard! The Student Senate gives Relevance U&#8217;s student body a voice.</b> <br /><br /> Senate advocates for students and makes sure that they are are informed about administrative decisions. Student Senate deals with a broad range of issues from community and world events to relationships between students.";
			background = "url('images/Involv_StudGov_4.5x8.5.jpg')";
		}
		else if (club == "Black Student Union") {
			text = "<b>Spread culture and awareness of black history by joining the Black Student Union.</b> <br /><br /> BSU encourages unity on the Relevance U campus by keeping their meetings open to all races. The organization spreads an appreciation for black history by sponsoring Black History Month as well as by contributing speakers, dancers, and other events to campus life.";
			background = "url('images/Involv_BlackStudentUnion_4.5x8.5.jpg')";
		}
		else if (club == "Relevance Radio") {
			text = "<b>Relevance Radio is a student-run radio station that broadcasts news, sports, and music to the campus and surrounding community.</b> <br /><br /> In addition, we&#8217;ve just added a streaming broadcast online. If you&#8217;re interested in being a DJ, broadcaster or programmer, look us up. Relevance Radio provides the chance for you to express yourself and your taste in music!";
			background = "url('images/Involv_Radio_4.5x8.5.jpg')";
		}
		
		document.getElementById("clubtext_jsfill").innerHTML = text;
		document.getElementById("clubbackground_jsfill").style.backgroundImage = background;
	}
	else if (id == "activitychange") {
		var activity = addslashes(document.getElementById(id).value);
		var text;
		var background;
		
		if (activity == "Flag Football") {
			text = "<b>Serious fun.</b><br /><br />Relevance U offers several intramurals, but our Flag Football league is by far the student favorite. Last year, over 800 students showed to watch the combined Men&#8217;s and Women&#8217;s championship games. Students who play flag football at Relevance U say that participating in the league is exciting, fun, and a great way to make new friends.";
			background = "url('images/Live_Football_6.5x8.5.jpg')";
		}
		else if (activity == "Fitness Classes") {
			text = "<b>Get FIT.</b><br /><br />If you want to get in shape (or stay in shape!), Relevance U has everything you&#8217;ll need. As a student, you&#8217;ll get an all-access pass to our gym, racquetball courts, weight room, and swimming pool. Facilities open early in the morning and stay open late at night, so you make working out work into your class schedule. You can even sign up for free fitness classes lead by senior Exercise Science majors!";
			background = "url('images/Live_Fitness_6.5x8.5.jpg')";
		}
		else if (activity == "Ski Trips") {
			text = "<b>Ski. Board. FUN!</b><br /><br />Maybe you know the feeling&#8212;powder flying, trees wizzing by as you ski or board down a mountain. Whether you&#8217;re an expert who can do moguls in your sleep, or a novice who&#8217;s never set foot on the slope,  just flash your Relevance U student ID, and you&#8217;ll get discounts on lift tickets, equipment rental, and lessons at three local ski resorts.";
			background = "url('images/Live_Ski_6.5x8.5.jpg')";
		}
		else if (activity == addslashes("TV/Movie Parties")) {
			text = "<b>TV...Only Bigger.</b><br /><br />At Relevance U, we host a TV or movie party once a month. But it&#8217;s not your typical, crowd in a room and squint at a tiny screen movie party. During the summer, we project video outside on a 2-story screen that&#8217;s hung from the top of the admission building. And whether its the season premier of <i>Family Guy</i> or a screening of <i>Tommy Boy</i>, there&#8217;s always free popcorn and soft drinks!";
			background = "url('images/Live_Tv_6.5x8.5.jpg')";
		}
		else if (activity == "Arts and Theater Outings") {
			text = "<b>Art. Theater. LIFE.</b><br /><br />Relevance U is located just an hour and half from Manhattan. With Broadway, the Metropolitan Museum of Art, the Museum of Modern Art, and the Guggenheim in our back yard, Relevance U Art & Theater outings are always a fresh experience. Best of all&#8212;your Spectrum U student ID gives you free or reduced admission to many museums and shows.";
			background = "url('images/Live_Outings_6.5X8.5.jpg')";
		}
		
		document.getElementById("activitytext_jsfill").innerHTML = text;
		document.getElementById("activitybackground_jsfill").style.backgroundImage = background;
	}
}	
			
function PreloadImages() {
	if (document.images) {
		//side bar images
	 	images[0] = new Image(157,129);
     		images[1] = "images/applyNow_mouseOver.jpg";
     		
     		images[2] = new Image(157,123);
     		images[3] = "images/joinUs_mouseOver.jpg";
     		
     		images[4] = new Image(157,82);
     		images[5] = "images/scholarships_mouseOver.jpg";
     		
     		images[6] = new Image(157,50);
     		images[7] = "images/shareThis_mouseOver.jpg";
     		
     		images[8] = new Image(157,82);
     		images[9] = "images/youBelongHere_mouseOver.jpg";
     		//**********************
     					
     		//tab images
     		images[10] = new Image(90,47);
     		images[11] = "images/Chosen_Welcome.jpg";
     		
     		images[12] = new Image(90,47);
     		images[13] = "images/Chosen_Major.jpg";
     		
     		images[14] = new Image(90,47);
     		images[15] = "images/Chosen_Life.jpg";
     		
     		images[16] = new Image(90,47);
     		images[17] = "images/Chosen_Book.jpg";
     		
     		images[18] = new Image(90,47);
     		images[19] = "images/Chosen_Involvement.jpg";
     		//**********************
   	}
}

function ChangeImage(imgid, newimg) {
	var imgloaded = false;
	
	if (document.images) { 
		for (i = 0; i < images.length; i++) {
			if (newimg == images[i]) {
				document.getElementById(imgid).src = images[i];
				imgloaded = true;
			}
		}
	}
	
	if (imgloaded == false) {
		document.getElementById(imgid).src = newimg;
	}
}

function Trim(s) {
	while((s.indexOf(' ',0) == 0) && (s.length> 1)) {
		s = s.substring(1,s.length);
	}

	while((s.lastIndexOf(' ') == (s.length - 1)) && (s.length> 1)) {
		s = s.substring(0,(s.length - 1));
	}

	if((s.indexOf(' ',0) == 0) && (s.length == 1)) {
		s = '';
	}

	return s;
}

function addslashes(str) {
	str = str.replace(/\'/g,'\\\'');
	str = str.replace(/\"/g,'\\"');
	str = str.replace(/\\/g,'\\\\');
	str = str.replace(/\0/g,'\\0');
	return str;
}

function getKeyCode(e) {
	if (window.event) {
		return window.event.keyCode;
	}
	else if (e) {
		return e.which;
	}
	else {
		return null;
	}
}

function keyRestrict(e, validchars) {
	var key='', keychar='';
	key = getKeyCode(e);
		
	if (key == null) {
		return true;
	}
	keychar = String.fromCharCode(key);
	keychar = keychar.toLowerCase();
	validchars = validchars.toLowerCase();
		
	if (validchars.indexOf(keychar) != -1) {
		return true;
	}
		
	if (key==null || key==0 || key==8 || key==9 || key==13 || key==27) {
		return true;
	}
	return false;
}

function ClearSelectedField(objectid) {
	document.getElementById(objectid).value = "";
}

function StripPhoneSyntax(objectid) {
	document.getElementById(objectid).value = document.getElementById(objectid).value.replace(/[\(\)\.\-\ ]/g, '');
}

function ChangeColor(objectid, color) {
	document.getElementById(objectid).style.background = color;
}

function CheckValidEmail() {
	var RegExp = /^((([a-z]|[A-Z]|[0-9]|!|#|$|%|&|'|\*|\+|\-|\/|=|\?|\^|_|`|\{|\||\}|~)+(\.([a-z]|[A-Z]|[0-9]|!|#|$|%|&|'|\*|\+|\-|\/|=|\?|\^|_|`|\{|\||\}|~)+)*)@((((([a-z]|[A-Z]|[0-9])([a-z]|[0-9]|\-){0,61}([a-z]|[A-Z]|[0-9])\.))*([a-z]|[A-Z]|[0-9])([a-z]|[A-Z]|[0-9]|\-){0,61}([a-z]|[A-Z]|[0-9])\.)[\w]{2,4}|(((([0-9]){1,3}\.){3}([0-9]){1,3}))|(\[((([0-9]){1,3}\.){3}([0-9]){1,3})\])))$/
    	
    	if (RegExp.test(document.getElementById("email").value)) {
        	return true;
    	}
    	else {
        	return false;
    	}
}

function CheckValidPhone() {
	var stripped = document.getElementById("phone").value.replace(/[\(\)\.\-\ ]/g, '');

	if (isNaN(parseInt(stripped))) {
		return false;
	}
	else if (Trim(stripped).length == 0) {
		return false;
	}
	else {
		document.getElementById("phone").value = stripped;
		return true;
	}
}

function LinkUpdate(link, purlname) {
	var httpObject = null;

	if (window.ActiveXObject)
		httpObject = new ActiveXObject("Microsoft.XMLHTTP");
	else if (window.XMLHttpRequest)
		httpObject = new XMLHttpRequest();
   	else {
		alert("Your browser does not support Ajax applications.");
	}
	if (httpObject != null) {
		httpObject.open("GET", "http://www.insidespectrum.com/SpectrumWebJobs/MyViewbook/Scripts/serverutilities.php?cmd=updatelink&link="+link+"&purl="+purlname, true);
		httpObject.send(null);
		httpObject.onreadystatechange = (function redirect() { if(httpObject.readyState == 4) {} });
	}
}

function ValidateFields(formid) {
	if (formid == "myinfoform") {
		var RequiredFields = "firstname,lastname,organization,address1,city,state,zip,phone,email,gender";
		var FieldList = RequiredFields.split(",");
		var BadList = new Array();

		for(var i = 0; i < FieldList.length; i++) {
		
			if(FieldList[i] == "email") {
				if (CheckValidEmail() == false) {
					BadList.push("emailinvalid");
				}
			}
			else if(FieldList[i] == "phone") {
				if (CheckValidPhone() == false) {
					BadList.push("phoneinvalid");
				}
			}
			else if(FieldList[i] == "zip") {
				if (!(document.getElementById("zip").value.length == 5)) {
					BadList.push(FieldList[i]);
				}
			}
			else {
				var s = document.getElementById(FieldList[i]).value;
				s = Trim(s);

				if (s.length < 1 || s == "Select Choice") {
					BadList.push(FieldList[i]);
				}
			}
		}

		if(BadList.length < 1) {
			StripPhoneSyntax('textnumber');
			document.getElementById(formid).submit();
		}
		else {
			document.getElementById("myinfo_valid").innerHTML 	= "";
			
			document.getElementById("firstname_valid").innerHTML 	= "";
			document.getElementById("lastname_valid").innerHTML 	= "";
			document.getElementById("organization_valid").innerHTML = "";
			document.getElementById("address1_valid").innerHTML 	= "";
			document.getElementById("city_valid").innerHTML		= "";
			document.getElementById("state_valid").innerHTML 	= "";
			document.getElementById("zip_valid").innerHTML 		= "";
			document.getElementById("phone_valid").innerHTML 	= "";
			document.getElementById("email_valid").innerHTML 	= "";
			document.getElementById("gender_valid").innerHTML 	= "";
	
			for(var i = 0; i < BadList.length; i++) {
				document.getElementById("myinfo_valid").innerHTML 						= "The following fields are required";
				
				if(BadList[i] == "firstname") { 	document.getElementById("firstname_valid").innerHTML 	= "*"; }
				if(BadList[i] == "lastname") {	 	document.getElementById("lastname_valid").innerHTML 	= "*"; }
				if(BadList[i] == "organization") { 	document.getElementById("organization_valid").innerHTML = "*"; }
				if(BadList[i] == "address1") { 		document.getElementById("address1_valid").innerHTML 	= "*"; }
				if(BadList[i] == "city") { 		document.getElementById("city_valid").innerHTML		= "*"; }
				if(BadList[i] == "state") { 		document.getElementById("state_valid").innerHTML 	= "*"; }
				if(BadList[i] == "zip") { 		document.getElementById("zip_valid").innerHTML 		= "*"; }
				if(BadList[i] == "phone") { 		document.getElementById("phone_valid").innerHTML 	= "*"; }
				if(BadList[i] == "phoneinvalid") { 	document.getElementById("phone_valid").innerHTML 	= "*"; }
				if(BadList[i] == "email") { 		document.getElementById("email_valid").innerHTML 	= "*"; }
				if(BadList[i] == "emailinvalid") { 	document.getElementById("email_valid").innerHTML 	= "*"; }
				if(BadList[i] == "gender") { 		document.getElementById("gender_valid").innerHTML 	= "*"; }
			}
		}
	}
	else if (formid == "mymajorform") {
		var RequiredFields = "major,studyabroad,internship,residence";
		var FieldList = RequiredFields.split(",");
		var BadList = new Array();

		for(var i = 0; i < FieldList.length; i++) {
		
			if(FieldList[i] == "studyabroad") {
				if(!document.getElementById("studyabroad_yes").checked && !document.getElementById("studyabroad_no").checked) {
					BadList.push(FieldList[i]);
				}
			}
			else if(FieldList[i] == "residence") {
				if(!document.getElementById("residence_campus").checked && !document.getElementById("residence_commute").checked) {
					BadList.push(FieldList[i]);
				}
			}
			else {
				var s = document.getElementById(FieldList[i]).value;
				s = Trim(s);

				if(s.length < 1 || s == "Select Choice") {
					BadList.push(FieldList[i]);
				}
			}
		}

		if(BadList.length < 1) {
			document.getElementById(formid).submit();
		}
		else {
			document.getElementById("mymajor_valid").innerHTML 	= "";
			
			document.getElementById("major_valid").innerHTML 	= "";
			document.getElementById("studyabroad_valid").innerHTML	= "";
			document.getElementById("internship_valid").innerHTML 	= "";
			document.getElementById("residence_valid").innerHTML	= "";
	
			for(var i = 0; i < BadList.length; i++) {
				document.getElementById("mymajor_valid").innerHTML 						= "The following fields are required";
				
				if(BadList[i] == "major") { 		document.getElementById("major_valid").innerHTML	= "*"; }
				if(BadList[i] == "studyabroad") { 	document.getElementById("studyabroad_valid").innerHTML	= "*"; }
				if(BadList[i] == "internship") { 	document.getElementById("internship_valid").innerHTML	= "*"; }
				if(BadList[i] == "residence") { 	document.getElementById("residence_valid").innerHTML	= "*"; }
			}
		}
	}
	else if (formid == "mylifeform") {
		var RequiredFields = "sportinterest,sportparticipate,activity,club,mybookinterest";
		var FieldList = RequiredFields.split(",");
		var BadList = new Array();

		for(var i = 0; i < FieldList.length; i++) {
		
			if(FieldList[i] == "sportparticipate") {
				if(!document.getElementById("sportparticipate_yes").checked && !document.getElementById("sportparticipate_no").checked) {
					BadList.push(FieldList[i]);
				}
			}
			else {
				var s = document.getElementById(FieldList[i]).value;
				s = Trim(s);

				if(s.length < 1 || s == "Select Choice") {
					BadList.push(FieldList[i]);
				}
			}
		}

		if(BadList.length < 1) {
			document.getElementById(formid).submit();
		}
		else {
			document.getElementById("mylife_valid").innerHTML 		= "";
			
			document.getElementById("sportinterest_valid").innerHTML 	= "";
			document.getElementById("sportparticipate_valid").innerHTML	= "";
			document.getElementById("activity_valid").innerHTML 		= "";
			document.getElementById("club_valid").innerHTML 		= "";
			document.getElementById("mybookinterest_valid").innerHTML	= "";
		
			for(var i = 0; i < BadList.length; i++) {
				document.getElementById("mylife_valid").innerHTML 							= "The following fields are required";
			
				if(BadList[i] == "sportinterest") { 	document.getElementById("sportinterest_valid").innerHTML 	= "*"; }
				if(BadList[i] == "sportparticipate") { 	document.getElementById("sportparticipate_valid").innerHTML	= "*"; }
				if(BadList[i] == "activity") { 		document.getElementById("activity_valid").innerHTML 		= "*"; }
				if(BadList[i] == "club") { 		document.getElementById("club_valid").innerHTML 		= "*"; }
				if(BadList[i] == "mybookinterest") { 	document.getElementById("mybookinterest_valid").innerHTML	= "*"; }
			}
		}
	}
}