// Rollover Function 

function swapImage(imageID, imagePath) {
	var imgID;
	imgID = document.getElementById(imageID);
	imgID.src = imagePath;
}

// Hide/Show Content

function revealPubs(showdiv, hidediv) {
	var shown;
	var hide;
	shown = document.getElementById(showdiv);
	hide = document.getElementById(hidediv);
	shown.style.display = "block";
	hide.style.display = "none";
}

function revealPrac(showdiv, hidediv) {
	var shown;
	var hide;
	shown = document.getElementById(showdiv);
	hide = document.getElementById(hidediv);
	shown.style.display = "block";
	hide.style.display = "none";
}

function openWindow(url) {
	windowpage = window.open (url,'newwindow','height=510,width=630,scrollbars=1,resizeable=0,toolbar=0,location=0');
}

function openCareers(file) {
	opencareers = window.open (file,'Careers','height=420,width=770,scrollbars=0,resizable=0,toolbar=1,location=0,status=0,menubar=1');
}
function writeHpFlash(){
	document.write( '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="760" height="202"><param name="movie" value="flash/McGeorgeNew.swf" /><param name="bgcolor" value="#000000" /><param name="quality" value="high" /><embed src="flash/McGeorgeNew.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" bgcolor="#000000" width="760" height="202"><\/embed><\/object>' );
}

// Preload Images
var image0 = new Image(); image0.src = "images/move2.gif";
var image1 = new Image(); image1.src = "images/admissions_financial_aid/photo_julia_tsai-r.gif";
var image2 = new Image(); image2.src = "images/admissions_financial_aid/learn_about_student_arrow-r.gif";


// Tab The Career AND Alum in the Career

var divs = Array('the_career_switch', 'alum_in_the_career_switch');

function hideAll() {
	if (document.getElementById) {
		for (i=0; i<divs.length; i++) {
			document.getElementById(divs[i]).style.display = 'none';
		}
	}
}

function show(div) {
	hideAll();
	if (document.getElementById) {
		document.getElementById(div).style.display = '';
		return false;
	} else {
		return true;
	}
}

window.onload = function() {
	if (location.hash.substring(1).length > 1) {
		show(location.hash.substring(1));
	} else {
		show('the_career_switch');
	}
}

// Tab Explore Module

var divs = Array('explore_module_open', 'explore_module_closed');

function hideAll() {
	if (document.getElementById) {
		for (i=0; i<divs.length; i++) {
			document.getElementById(divs[i]).style.display = 'none';
		}
	}
}

function show(div) {
	hideAll();
	if (document.getElementById) {
		document.getElementById(div).style.display = '';
		return false;
	} else {
		return true;
	}
}

window.onload = function() {
	if (location.hash.substring(1).length > 1) {
		show(location.hash.substring(1));
	} else {
		show('explore_module_closed');
	}
}

// Spam-proof email by deanq.com
// Copyright © 2003. deanq.com
function email(who,domain,subject) {
  if (!domain) var domain = "pacific.edu";
  if (!subject) var subject = " ";
  var attrib = "width=1,height=1,resizable=1,toolbar=0,menubar=0,left=2000,top=2000,screenX=2000,screenY=2000,scrollbars=0";
  MyWindow=window.open('', "email", attrib);
  MyWindow.document.write("<HTML><HEAD><TITLE> <\/TITLE><META HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=iso-8859-1'><\/HEAD><BODY leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 onLoad=\"javascript:location.href='mailto:" + who + "@" + domain + "?subject=" + subject + "'\" onBlur='window.close()' onFocus='window.close()'><\/BODY><\/HTML>");
  MyWindow.window.resizeTo(1, 1);
  MyWindow.document.title = " ";
  MyWindow.document.close();
}	
