var menutexts = ["","Home","Education Unit","Program Information","Equity Studies Research Center","Teacher Certification/ Clinical Experiences/ Career Placement", "Center for the Improvement of Education", "Directory", "Frequently Asked Questions"];
var menuwidth = [2,50,100,80,120,160, 180, 60, 120];
var menubgcolors = ["", "#C3C1F2", "#F48222", "#FFDE00", "#08A844", "#0965B0", "#945C8D","#E13C28", "#F48222", "#FFDE00", "#08A844", "#0965B0"];

var subtitles = ["","Home", "Education Unit","12","Equity Studies Research Center","Teacher Certification/ Career Placement", "Center for the Improvement of Education", "Directory", "Frequently Asked Questions", "Faculty and Staff"];
var urls = ["http://www.qc.edu", "http://qcpages.qc.cuny.edu/Education/index.htm", "index.html", "http://qcpages.qc.cuny.edu/Education/program.htm", "http://qcpages.qc.cuny.edu/Education/equity_studies_research_center.htm", "http://qcpages.qc.cuny.edu/Education/Edplace",
"http://qcpages.qc.cuny.edu/Education/center_improvement.htm",
"http://qcpages.qc.cuny.edu/Education/directory.htm", "http://qcpages.qc.cuny.edu/Education/faq.htm", ""];
var titleimages = ["title.gif", "title_aboutus.gif","title_newsletter.gif","title_essay.gif","title_photography.gif","","title_guestbook.gif",
                   "title_contact.gif", "title_event.gif",
                   "title_recommend.gif", "title_autobio.gif", "title_prose.gif", "title_travel.gif", "title_novel.gif", "title_poem.gif", "title_artcriticism.gif"];
/* var titleimagewidths = [135, 108, 110, 110, 108, 0, 83,
                        109, 135,
                        109, 109, 109, 110, 110, 109, 109]; */
var sublinks = [[],  [], [], [], [], [],
                [], [],
                [], [], [ "Visitors", "Current Student", "Alumni/Donors", "Faculty/Staff", "News/Events", "The Urban Scholar", "Job Opportunities", "Web Resources"], [],["Admissions", "Bursar", "Registrar", "Student Resources (uc)" ], ["Back to The Urban Scholar"], ["Back to Frequently Asked Questions"]];
var subanchors = [[], [], [],  [], [], [],
                  [], [],
                  [], [], ["visitors.htm", "current_student.htm", "alumni.htm", "faculty.htm", "news_events.htm", "urban_scholar.htm", "job.htm", "web_resources.htm"], [], ["http://www.qc.cuny.edu/admissions/","http://www.qc.cuny.edu/bursar/","http://www.qc.cuny.edu/registrar/","underconstruction.htm"], ["urban_scholar.htm"], ["faq.htm"]];

var ESSAY_INDEX = 2;
var CATEGORY_INDEX_BEGIN = 8; // inclusive
var CATEGORY_INDEX_END = 9; // exclusive


//var id,pause=0,position=0;


//alert (subtitle);
var sub_index = subtitle;
//alert (sub_index);

var actualwidth=''
var cross_marquee, ns_marquee

function populateSublink(index) {
    var sublink = sublinks[index];
    var subanchor = subanchors[index];
    if (index != ESSAY_INDEX) {
        sublink[sublink.length] = "";
        subanchor[subanchor.length] = urls[ESSAY_INDEX];
    }
    for (var i = CATEGORY_INDEX_BEGIN; i < CATEGORY_INDEX_END; i++) {
        if (i != index) {
            sublink[sublink.length] = subtitles[i];
            subanchor[subanchor.length] = urls[i];
        }
    }
}



function Start(page) {
OpenWin = this.open(page, "CtrlWindow", "toolbar=yes,menubar=yes,location=yes,scrollbars=yes,resizable=yes");
}


function renderMainMenus() {
    populateSublink(ESSAY_INDEX);
    for (var i = CATEGORY_INDEX_BEGIN; i < CATEGORY_INDEX_END; i++) populateSublink(i);

    document.write("<table width=840 align=center border=0 cellspacing=0 cellpadding=2><tr bgcolor=#E3E0E0><td height=6 colspan=10></td></tr><tr>\n");
 document.write("<td bgcolor=#E3E0E0 colspan=10 align=center><img src=\"img/qc2.gif\" border=0 width=95 height=67 style=\"cursor:hand;\" onclick=\"window.location='" + urls[0] + "'\" alt=\"Queens College\">");
 
    document.write("<img src=\"img/t6b.gif\" border=0 valign=top width=450 height=67></td></tr><tr bgcolor=#E3E0E0><td height=10 colspan=10></td></tr>");

/*
    var index = 0;
    for (var i = 1; i < subtitles.length; i++) if (subtitles[i] == subtitle) index = i;

    document.write("<td><table width=840 height=80 border=0 cellspacing=0 cellpadding=0 bgcolor=#E3E0E0><tr>\n");
    document.write("<td><img src=\"img/nothing.gif\" width=15 height=1>");
    document.write("<img src=\"img/qc2.gif\" border=0 width=95 height=67 style=\"cursor:hand;\" onclick=\"window.location='" + urls[0] + "'\" alt=\"·µ»ØÖ÷Ò³\">");
 
    document.write("<img src=\"img/t2.gif\" border=0 valign=top width=240 height=67>");
	document.write("<img src=\"img/nothing.gif\" width=10 height=1></td>");
    if (subtitle != subtitles[0])
    {
        document.write("<td width=500 valign=bottom><a href=\"" + urls[0] + "\" class=navigation></a>");
		if (sub_index > 10)
		
		index = sub_index;
		

		
        for (var i = 0; i < sublinks[index].length; i++)
			{
			
			if (i > 0 ) document.write(" | ");
		
            document.write("<a href=\"" + subanchors[index][i] + "\" class=navigation>" + sublinks[index][i] + "</a>");
			

			}
		
        document.write("</td>\n");
    }
	else 
	{ 
	document.write("<td width=100% valign=bottom>");

	document.write('<marquee scrollAmount='+speed+' style="width:410">'+marqueecontents+'</marquee>');
	document.write("</td>");
	}

    document.write("</tr></table></td></tr><tr>\n"); */
	
	    for (var i = 1; i < menutexts.length; i++) {
        var bgcolor;
		var fcolor;
        if (subtitles[i] == subtitle) 
		/* bgcolor = menubgcolors[i]; */
		{
		bgcolor = "#AA0B0F"; 
		fcolor = "#ffffff";
		}
        else 
		{ 
		bgcolor = "#999aa8";
		fcolor = "#060A71";
		}
        document.write("<td width=" + menuwidth[i] + " align=center bgcolor=" + bgcolor);
// ########CHANGE BELOW - IF extracted

//        if (subtitles[i] != subtitle) 
	  document.write(" onclick=\"window.location='" + urls[i] + "';\"");

      /*  document.write(" onmouseover=\"this.style.background='" + menubgcolors[i] + "';\""); */
		 document.write(" onmouseover=\"this.style.background='#c3c1f2';\"");
        document.write(" onmouseout=\"this.style.background='" + bgcolor + "';\"");
       document.write(" style=\"cursor:hand;\">"); 
      /*  document.write("<img src='img/nothing.gif' width=" + menuwidth[i] + " height=2><br>");*/

		 document.write("<font color='" + fcolor +"' style=\"font-family:Arial, Helvetica; cursor:pointer;\" size=-1  >" + menutexts[i] + "</font></td>\n"); 
	}
    document.write("</tr></table>\n");
	
}

function renderColumnMenus() {
    for (var i = 0; i < menutexts.length; i++) {
        document.write("<td onclick=\"window.location='" + urls[i] + "';\"");
        document.write(" onmouseover=\"this.style.background='#CCCCCC'; this.style.color='#000000';\"");
        document.write(" onmouseout=\"this.style.background='#000000'; this.style.color='#FFFFFF';\"");
        document.write(" class=navigation>");
        document.write("" + subtitles[i] + "</td>\n");
    }
}




 
//Specify the marquee's scroll speed (larger is faster)
var speed=6
//Specify the marquee contents
var marqueecontents='<font face="Arial" color="#cc0000"><strong>Welcome to the Queens College Division of Education Website!</strong></font>'

//if (document.all)
//document.write('<marquee scrollAmount='+speed+' style="width:300">'+marqueecontents+'</marquee>')

function intializemarquee(){
if (document.layers){
document.cmarquee01.document.cmarquee02.document.write('<nobr>'+marqueecontents+'</nobr>')
document.cmarquee01.document.cmarquee02.document.close()
thelength=document.cmarquee01.document.cmarquee02.document.width
scrollit()
}
}

function scrollit(){
if (document.cmarquee01.document.cmarquee02.left>=thelength*(-1)){
document.cmarquee01.document.cmarquee02.left-=speed
setTimeout("scrollit()",600)
}
else{
document.cmarquee01.document.cmarquee02.left=800
scrollit()
}
}
//window.onload=intializemarquee

//window.onload=initialize