//Script for MacMillan Developed My Mark Cameron / McGraw-Hill Media Technology
function showExternalLink() 
{
	document.write("<td colspan=\"2\" width=\"100%\" valign=\"top\">");
	document.write("<table bgcolor=\"#FFFFFF\" border=\"0\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\">");
	document.write("<tr>");
	document.write("<td width=\"85\" valign=\"top\" background=\"/images/redesign/col_orglft_top02.gif\">");
	document.write("<img src=\"/images/redesign/col_orglft_top02.gif\" width=\"85\" height=\"1\">");
	document.write("</td>");
	document.write("<td align=\"left\" width=\"100%\" valign=\"top\">&nbsp;</td>");
	document.write("</tr>");
	document.write("</table>");
	document.write("</td>");
	document.write("<td width=\"17\" valign=\"top\" background=\"/images/redesign/col_orgrgt_rpt.gif\">&nbsp;</td>");
}

function showTeachLinks() 
{
	document.write("<td colspan=\"2\" width=\"100%\" valign=\"top\">");
	document.write("<table bgcolor=\"#FFFFFF\" border=\"0\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\">");
	document.write("<tr>");
	document.write("<td width=\"85\" valign=\"top\" background=\"/images/redesign/col_orglft_top02.gif\">");
	document.write("<img src=\"/images/redesign/col_orglft_top02.gif\" width=\"85\" height=\"1\">");
	document.write("</td>");
	document.write("<td align=\"left\" width=\"100%\" valign=\"top\">&nbsp;</td>");
	document.write("</tr>");
	document.write("</table>");
	document.write("</td>");
	document.write("<td width=\"17\" valign=\"top\" background=\"/images/redesign/col_orgrgt_rpt.gif\">&nbsp;</td>");
}

function goToPage() //Function Start: invoked when the "Enter" image button is clicked on the homepage.
{
	StateIndex=document.form1.select1.selectedIndex; //Stores the State index number
	PageIndex2=document.form1.select2.selectedIndex; //Stores the descipline index number

	var state=document.form1.select1.options[StateIndex].value; //Stores the value of the State index
	var descipline=document.form1.select2.options[PageIndex2].value; //Stores the value of the descipline index

	if (state != "") //validating if the state selection is not empty
	{
		if (descipline != "") //validating if the descipline selection is not empty
		{ 

//2011

			  if (descipline == "2011")
			  {
				  sel = document.getElementById('select1').options;
				  st = sel[sel.selectedIndex].value.toLowerCase();
				  if(st=='ca')
				  	location.href = "http://activities.macmillanmh.com/science/ca/";
				  else if(st=='sc')
				  	location.href = "/science/2011/student/sc_index.html";
				  else if(st=='md')
				  	location.href = "/science/2011/student/md_index.html";
				  else if(st=='oh')
				  	location.href = "/science/2011/student/oh_index.html";
				  else if(st=='dc')
				  	location.href = "/science/2011/student/dc_index.html";
				  else if(st=='pa')
				  	location.href = "/science/2011/student/pa_index.html";
				  else if(st=='il')
				  	location.href = "/science/2011/student/il_index.html";
				  else if(st=='nj')
				  	location.href = "/science/2011/student/nj_index.html";
				  else if(st=='co')
				  	location.href = "/science/2011/student/co_index.html";
				  else if(st=='ct')
				  	location.href = "/science/2011/student/ct_index.html";
				  else if(st=='ma')
				  	location.href = "/science/2011/student/ma_index.html";
				  else if(st=='mi')
				  	location.href = "/science/2011/student/mi_index.html";
				  else if(st=='mo')
				  	location.href = "/science/2011/student/mo_index.html";
				  else if(st=='ny')
				  	location.href = "/science/2011/student/ny_index.html";
				  else if(st=='ms')
				  	location.href = "/science/2011/student/ms_index.html";
				  else
				  	location.href = "/science/2011/student/"; //+ st + "/";
			  }
//2010

			  else if (descipline == "2010")
			  {
				  sel = document.getElementById('select1').options;
				  st = sel[sel.selectedIndex].value.toLowerCase();
				  if(st=='ca')
				  	location.href = "http://activities.macmillanmh.com/science/ca/";
				  else if(st=='sc')
				  	location.href = "/science/2010/student/sc_index.html";
				  else if(st=='md')
				  	location.href = "/science/2010/student/md_index.html";
				  else if(st=='oh')
				  	location.href = "/science/2010/student/oh_index.html";
				  else if(st=='dc')
				  	location.href = "/science/2010/student/dc_index.html";
				  else if(st=='pa')
				  	location.href = "/science/2010/student/pa_index.html";
				  else if(st=='il')
				  	location.href = "/science/2010/student/il_index.html";
				  else if(st=='nj')
				  	location.href = "/science/2010/student/nj_index.html";
				  else if(st=='co')
				  	location.href = "/science/2010/student/co_index.html";
				  else if(st=='ct')
				  	location.href = "/science/2010/student/ct_index.html";
				  else if(st=='ma')
				  	location.href = "/science/2010/student/ma_index.html";
				  else if(st=='mi')
				  	location.href = "/science/2010/student/mi_index.html";
				  else if(st=='mo')
				  	location.href = "/science/2010/student/mo_index.html";
				  else if(st=='ny')
				  	location.href = "/science/2010/student/ny_index.html";			
				  else if(st=='tn')
				  	location.href = "/science/2010/student/tn_index.html";	
				  else
				  	location.href = "/science/2010/student/"; //+ st + "/";
			  }


//2009

			else if (descipline == "2009")
			  {
				  sel = document.getElementById('select1').options;
				  st = sel[sel.selectedIndex].value.toLowerCase();
				  if(st=='ca')
				  	location.href = "http://activities.macmillanmh.com/science/ca/";
				  else if(st=='ky')
				  	location.href = "/science/2009/student/ky_index.html";
				  else if(st=='ga')
				  	location.href = "/science/2009/student/ga_index.html";
				  else
				  	location.href = "/science/2009/student/"; //+ st + "/";
			  }


//2008

			else if (descipline == "2008")
			  {
				  sel = document.getElementById('select1').options;
				  st = sel[sel.selectedIndex].value.toLowerCase();
				  if(st=='ca')
				  	location.href = "http://activities.macmillanmh.com/science/ca/";
				  else if(st=='sc')
				  	location.href = "/science/2008/student/sc_index.html";
				  else if(st=='md')
				  	location.href = "/science/2008/student/md_index.html";
				  else if(st=='oh')
				  	location.href = "/science/2008/student/oh_index.html";
				  else if(st=='dc')
				  	location.href = "/science/2008/student/dc_index.html";
				  else if(st=='pa')
				  	location.href = "/science/2008/student/pa_index.html";
				  else if(st=='il')
				  	location.href = "/science/2008/student/il_index.html";
				  else if(st=='nj')
				  	location.href = "/science/2008/student/nj_index.html";
				  else if(st=='co')
				  	location.href = "/science/2008/student/co_index.html";
				  else if(st=='ct')
				  	location.href = "/science/2008/student/ct_index.html";
				  else if(st=='ma')
				  	location.href = "/science/2008/student/ma_index.html";
				  else if(st=='mi')
				  	location.href = "/science/2008/student/mi_index.html";
				  else if(st=='mo')
				  	location.href = "/science/2008/student/mo_index.html";
				  else if(st=='ny')
				  	location.href = "/science/2008/student/ny_index.html";
				  else
				  	location.href = "/science/2008/student/"; //+ st + "/";
			  }
			  
			  else if ((descipline != "2008") && (state != "AL"))
				   location.href = "/science/"+descipline+"/student/index.html"; 
			  
			  else if (descipline == "160")
			  { 
					alert("Please select a Program");
					return;
			  }
			  else if ((descipline == "2005") && (state == "AL"))
					location.href = "/science/2005/student/state/alabama/index.html";
					
			  else if ((state =="0")||(state==""))
					window.location.reload( false ); 
					
			  else
					location.href = "/science/"+descipline+"/student/index.html"; 
		} 		
		
		if ((state == "CA")&&(descipline != "2000")) //validating if the state selection is not empty
			location.href = "http://activities.macmillanmh.com/science/ca/";
	} 
	else
	{
		alert("Please select a state");
		return;
	}
} 

