document.writeln("<LINK REL=StyleSheet HREF=\"/styles/hmenu.css\" TYPE=\"text/css\" MEDIA=screen>")
//document.writeln("<LINK REL=StyleSheet HREF=\"file:///D:/styles/hmenu.css\" TYPE=\"text/css\" MEDIA=screen>")

//BaseHref="http://www.math.technion.ac.il/Site/"
BaseHref="/Site/"

Year=2009
CMSYear=2009
GrossmanYear=2010
EndYear=Year+1
InsideDecade=1
Cms=1
CMSLogoAndString="<img src="+BaseHref+"images/CMS-logo.jpg width=50 align=left>Center for Mathematical Sciences "

Semester="02"
current_year=Year
//current_semester="200702"
if (Semester=="01") {current_semester=Year+Semester}
else {current_semester=EndYear+Semester}
//temp_sem=current_semester
//current_semester="200802"

NoLeftSidePicture=1
NumOfPictures=32
NumOfLibraryPictures=8

//var RandomNumber1 = Math.round(NumOfPictures*Math.random())
//var RandomNumber2 = Math.round(NumOfPictures*Math.random())

//RandomPicture1=BaseHref+"images/picture"+RandomNumber1+".jpg"
//RandomPicture2=BaseHref+"images/picture"+RandomNumber2+".jpg"


//*********** Number of main (horizontal) menu topics ***********

NumOfMenus=5  
HloopEnd=NumOfMenus+1

//*********** The maximal number of (vertical) submenus ***********
MaxMenuSize=10  
VloopEnd=MaxMenuSize+1

//********* Values for the "Scope" parameter to choose between local and global menus
Local=1
Global=0

//*********** Numbering the main topics from left to right ***********

People=1
Academics=2
Research=3
Events=4
Resources=5


//*********** Personal Homepage variables - trial, to be replaced later by php+mysql *****
name=1
position=2
degree=3
email=4
office=5
phone=6
fax=7
homepageLink=8
homepageName=9
ResearchInterests=10

//**********************   Seminar Data                            ****************

SeminarDiv=new Array()


DelimiterPlace=new Array()
ColumnPlace=new Array()
SeminarParagraph=new Array()

SeminarDiv[1]="Seminar"
SeminarDiv[2]="Speaker"
SeminarDiv[3]="Title"
SeminarDiv[4]="Time"
SeminarDiv[5]="Place"
SeminarDiv[6]="Abstract"


//All menus and submenus are arranged in a 3-dimentional array. 
//First index is for the main horizontal menu.
//Second index is for the vertical menus.
//Third index is either 1 or 2: 1 for the link name and 2 for the link location
//For each i, Hmenu[i][0][0] holds a number. This is the number of that topic's submenus.


//*********** Declare arrays ***********

//*********** Personal Homepage data array - trial, to be replaced later by php+mysql ***

var PersonalData=new Array(20)

//*********************************************************************

//******* Arrays to store local data *******

var ItemNames=new Array(20)
var ItemLinks=new Array(20)

var SideLinks=new Array(20)
var SideNames=new Array(20)



//********* Array to store global data *************

var Hmenu=new Array(HloopEnd)
var Mmenu=new Array(10)

for (i=1; i <HloopEnd; i++)
{
    Hmenu[i]=new Array(VloopEnd)
}

for (i=1; i <HloopEnd; i++)
{
 for (j=0; j <VloopEnd; j++)
    {
    Hmenu[i][j]=new Array(2)
     }
}



//Fill the data


Hmenu[People][0][0]=10
Hmenu[People][1][1]="People"
Hmenu[People][1][2]=BaseHref+"people/index.html"

Hmenu[People][2][1]="Directory"
Hmenu[People][2][2]="/styles/under-construction.html"

Hmenu[People][3][1]="Faculty"
Hmenu[People][3][2]=BaseHref+"people/faculty.php"

Hmenu[People][4][1]="Researchers (Kamea)"
Hmenu[People][4][2]=BaseHref+"people/researchers.php"

Hmenu[People][5][1]="Visitors and Post-Docs"
Hmenu[People][5][2]=BaseHref+"people/guests.php"

Hmenu[People][6][1]="Administration"
Hmenu[People][6][2]=BaseHref+"people/administration/"

Hmenu[People][7][1]="Graduate Students"
Hmenu[People][7][2]=BaseHref+"people/grads.php"

Hmenu[People][8][1]="Adjuncts"
Hmenu[People][8][2]=BaseHref+"people/adjuncts.php"

Hmenu[People][9][1]="Alumni"
Hmenu[People][9][2]=BaseHref+"people/alumni/"

Hmenu[People][10][1]="In Memoriam"
Hmenu[People][10][2]=BaseHref+"people/inmemoriam/"

Hmenu[Academics][0][0]=5

Hmenu[Academics][1][1]="Academics"
Hmenu[Academics][1][2]=BaseHref+"academics/"

Hmenu[Academics][2][1]="Courses"
Hmenu[Academics][2][2]=BaseHref+"academics/courses/"

Hmenu[Academics][3][1]="Undergraduate"
Hmenu[Academics][3][2]=BaseHref+"academics/undergraduate/"

Hmenu[Academics][4][1]="Graduate"
Hmenu[Academics][4][2]=BaseHref+"academics/graduate/"

Hmenu[Academics][5][1]="Classrooms"
Hmenu[Academics][5][2]="http://mathroom.technion.ac.il/ target=_blank"

Hmenu[Research][0][0]=3

Hmenu[Research][1][1]="Research"
Hmenu[Research][1][2]=BaseHref+"research/"

Hmenu[Research][2][1]="Center for Mathematical Sciences"
Hmenu[Research][2][2]=BaseHref+"research/cms/"

Hmenu[Research][3][1]="Research Areas of Faculty Members"
Hmenu[Research][3][2]=BaseHref+"people/fields_of_research.php"


Hmenu[Events][0][0]=5

Hmenu[Events][1][1]="Events"
Hmenu[Events][1][2]=BaseHref+"events/"

Hmenu[Events][2][1]="Seminars and Colloquia"
Hmenu[Events][2][2]=BaseHref+"events/seminars-colloquia/"

Hmenu[Events][3][1]="Special lectures"
Hmenu[Events][3][2]=BaseHref+"events/special-lectures/"

Hmenu[Events][4][1]="Youth Events"
Hmenu[Events][4][2]=BaseHref+"events/youth/"

Hmenu[Events][5][1]="Calendar of Events"
Hmenu[Events][5][2]="http://www.math.technion.ac.il/~techm/today.html target=_blank"

Hmenu[Resources][0][0]=7

Hmenu[Resources][1][1]="Resources"
Hmenu[Resources][1][2]=BaseHref+"resources/"

Hmenu[Resources][2][1]="Contact Information"
Hmenu[Resources][2][2]=BaseHref+"info/contact.html"

Hmenu[Resources][3][1]="Computing Services"
Hmenu[Resources][3][2]=BaseHref+"computing/index.html"

Hmenu[Resources][4][1]="Math Library"
Hmenu[Resources][4][2]=BaseHref+"resources/library/"

Hmenu[Resources][5][1]="Mathematics"
Hmenu[Resources][5][2]=BaseHref+"mathematics/"

Hmenu[Resources][6][1]="Useful Links"
Hmenu[Resources][6][2]="/styles/under-construction.html"

Hmenu[Resources][7][1]="Photo Gallery"
Hmenu[Resources][7][2]="/styles/under-construction.html"


//*********** Draw the top menu ***********

function TopMenu(){

var TableHeader="<center><table border=1  bgcolor=FFFFFF>"+
"<tr width=750><td width=\"750\" align=center bgcolor=#0C566F >"+
"<a href=\""+BaseHref+"\"><img src=\"/styles/logo2.jpg\"  width=750  border=0></a></td></tr>"+
"<tr><td bgcolor=#0C566F><div class=\"menu\" id=\"topmenu\"><ul>"

var OpenUl="<table><tr><td><ul>"
var CloseSmallLi="</a></li>"
var IfIE="<!--[if IE 7]><!--></a><!--<![endif]-->"
var OpenLi="<li><a href="
var CloseLi="</ul></td></tr></table><!--[if lte IE 6]></a><![endif]--></li>"

document.writeln(TableHeader)
for (i=1; i <HloopEnd; i++)
{  //document.writeln(i+"<p>")
  document.writeln(OpenLi+Hmenu[i][1][2]+" style=\"font-family:Arial;\">"+Hmenu[i][1][1]+IfIE+OpenUl)
  VMenuSize=Hmenu[i][0][0]+1
  //document.writeln(VMenuSize)
 for (j=2; j <VMenuSize; j++)
    {
       //for (k=1; k <3; k++)
        {
        document.writeln(OpenLi+Hmenu[i][j][2]+" style=\"font-family:Arial;\">"+Hmenu[i][j][1]+CloseSmallLi)
        }
        
    }
    
    document.writeln(CloseLi)
}
document.writeln("</ul></div></td></tr></table>")

}



//*********** Draw the bottom menu *************

function BottomMenu(){

var Hline="<!--hr style=\"width:750px\" color=\"#000000\" /-->"
var OpenDiv="<div dir=ltr style=\"background-color:#0C566F; width:750px; text-align:right;\">"
var Hstyle="<h4 style=\"display:block; padding:4px;\">"
var OpenSpan="<span style=\"font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;\">"
var Technion="<table border=0 width=750><tr><td align=left width=245><a href=http://www.technion.ac.il style=\"color: #FFFFFF; text-decoration: none\" target=_blank>&nbsp;Technion</a>"
var Search="<td align=center width=245><a href=\""+BaseHref+"search.html\"  style=\"color:#FFFFFF; text-decoration:none;\">Search</a>"
var Home="<td align=right width=245><a href=\""+BaseHref+"index.html\"  style=\"color:#FFFFFF; text-decoration:none;\">Home &nbsp;</a>"
var CloseSpan="</table></span></h4></div>"
var Thanks1="Web interface courtecy of Robert Amodeo, Mathematics Computing Group," 
var Thanks2="UCLA Department of Mathematics</center>"

document.writeln(Hline+OpenDiv+Hstyle+OpenSpan+Technion)
//for(i=1;i<26;i++) document.write("&nbsp;")
document.writeln(Search)
//for(i=1;i<6;i++) document.writeln("&nbsp;")
document.writeln(Home+CloseSpan)
//document.writeln(Home+CloseSpan+Thanks1+Thanks2)
}

function DrawTopCorners(){
TC="<div class=\"rounded\" style=\" float:right; width:565px; background-color:#ECECEC; margin-left:5px\">"+
"<div class=\"roundheader\" style=\" background-color:#536895; height:10px\">"+
"<div class=\"roundtop\">"+
"<img src=\"/styles/tl.gif\" alt=\"\" width=\"10\" height=\"10\" class=\"newscorner\" style=\"display: none\" />"+
"</div></div>"
document.writeln(TC)
}

function DrawBottomCorners(){
BC="<div class=\"roundheader\" style=\"background-color:#536895; height:10px\">"+
"<div class=\"roundbottom\">"+
"<img src=\"/styles/bl.gif\" alt=\"\" width=\"10\" height=\"10\" class=\"newscorner\" style=\"display:none\"/>"+
"</div></div>"
document.writeln(BC)
}

//*********** Moving the mouse over a picture to change images ***********

function mouseOver(Folder) {
if(Folder==null) Folder=""
NumOfPictures1="NumOf"+Folder+"Pictures"
NumOfPictures=eval(NumOfPictures1)

if(Folder=="") Folder="."

var RandomNumber1 = Math.round((NumOfPictures-1)*Math.random()+1)
var RandomPicture1=BaseHref+"images/"+Folder+"/picture"+RandomNumber1+".jpg"

document.b1.src = RandomPicture1

//document.b1.src ="/styles/mathBldg2b.jpg"
} 

function mouseOut(Folder) { 
if(Folder==null) Folder=""
NumOfPictures1="NumOf"+Folder+"Pictures"

NumOfPictures=eval(NumOfPictures1)

if(Folder=="") Folder="."
var RandomNumber2 = Math.round((NumOfPictures-1)*Math.random()+1)
var RandomPicture2=BaseHref+"images/"+Folder+"/picture"+RandomNumber2+".jpg"
//FirstPicture=RandomPicture

document.b1.src = RandomPicture2

//document.b1.src ="/styles/MathBldg2.jpg"
}
//************* Show a "People" template  page *************

function PicLiItems(Category, Scope, Folder){

var Start
var End
var s1=" "
var s=new Array(20)

if(Folder==Cms){
    if(Year<DecadeTop && (!(Category=="Recent CMS Activities"))){
    Category=Category.substring(0,Category.length-4)+EndYear                                                      
    }
}

s[1]="<center><table width=\"757\" border=\"0\"><tr><td height=\"21\">&nbsp;</td></tr><tr>"
s[2]="<td width=\"751\" height=\"50\"><div align=\"center\">"
s[3]="<span class=\"style1\" style=\"font-size: 26px; font-family: Arial,Helvetica, sans-serif; font-weight: bold; color: #003366\">"
s[4]="<span style=\"font-size: 26px\">"

//****** Here comes Header's first letter *************
s[5]=Category.substring(0,1)

s[6]="</span>"

//****** Here comes rest of the Header  *************
s[7]=Category.substring(1,Category.length)

if (Scope==Global) Category=eval(Category)
if (Folder==null) Folder=""
if (Category=="In Memoriam") {ChangePicture=" "}
else{ 
if (Folder==Cms){ChangePicture="onmouseover\=\"mouseOver\(\)\" onmouseout\=\"mouseOut\(\)\""}
if (Folder!=Cms) {ChangePicture="onmouseover\=\"mouseOver\(\'"+Folder+"\'\)\" onmouseout\=\"mouseOut\(\'"+Folder+"\'\)\""}
}

s[8]="</span></div></td></tr><tr><td height=\"21\">&nbsp;</td></tr><tr><td height=\"10\"><hr></td>"
s[9]="</tr><tr><td height=\"163\"><table width=\"667\" border=\"0\" align=\"center\"><tr>"
s[10]="<td width=\"282\" align=left valign=\"top\"><!--a href=\"javascript:doit()\" target=\"_blank\"-->"
s[11]="<img src=\"/styles/picture1.jpg\" border=\"0\" alt=\"Math Department\"   name=\"b1\" width=\"280\" height=\"200\" "+ChangePicture+" /></a></td>"
s[12]="<td width=\"27\" align=left valign=\"middle\">&nbsp;</td>"
s[13]="<td width=\"359\" height=\"22\" align=left valign=\"middle\"><table  align=left border=\"0\">"

//******  These strings s[14]-s[17] go into Item's loop *************

s[14]="<tr><td height=\"25\" align=left><div align=\"left\">"
s[15]="<li><div class=\"orange\"><a href="

//********* Here comes Item's Link  *************

s[16]="  ><strong>"

//********* Here comes Item's Name  *************

s[17]="</strong></a></div></li></div></td></tr>"



s[18]="</table></td></tr></table></td></tr><tr><td height=\"32\"><hr></td></tr></table></center>"


if (Scope==Global) {
Start=2
End=Hmenu[Category][0][0]+1
}
if (Scope==Local) {
Start=1
End=NumItems+1
}

for(i=1;i<14;i++){s1=s1+s[i]}

for(i=Start;i<End;i++){
if (Scope==Global){s1=s1+s[14]+s[15]+Hmenu[Category][i][2]+s[16]+Hmenu[Category][i][1]+s[17]}
if (Scope==Local) {s1=s1+s[14]+s[15]+ItemLinks[i]+s[16]+ItemNames[i]+s[17]}
}

document.writeln(s1)

if(Folder==Cms) {
document.writeln("<tr><td>")
ChooseRange()

}

document.writeln(s[18])



} //end function PicLiItems


//********* NoPicLiItems - similar to previous, but without the picture ****************

function NoPicLiItems(Header){

var s="<span style=\"font-size: 26px; font-family: Arial,Helvetica, sans-serif; font-weight: bold; color: #003366\">"+Header+"</span>"

document.writeln("<center><p>"+s+"<p><hr width=750><p><table border=0><ul>")
for(i=1;i<NumItems+1;i++) document.writeln("<tr><td height=25 align=left><div align=left><li><div class=orange><a href="+ItemLinks[i]+" target=_blank>"+ItemNames[i]+"</a></div></div>")
document.writeln("</ul></table></center><hr width=750>")

} //end function NoPicLiItems



//************* FacultyHomePage() **********************
function FacultyHomePage(){

var s=new Array(13)
var s1=" "

s[1]="<p><center><table border=\"0\" width=\"750\"><tbody><tr><td align=\"center\" height=\"25\" width=\"753\">"+
"<span style=\"font-family: Arial,Helvetica,sans-serif; font-size: 30px; font-weight: bold;\">"

s[2]="</span><hr></td></tr><tr><td ><table  valign=\"top\" align=\"center\" "+
"border=\"0\" cellpadding=\"15\" cellspacing=\"15\"  width=\"623\" bgcolor=#eeeeee>"+
"<tbody><tr valign=\"top\"><td align=\"center\" height=\"220\" valign=\"top\" width=\"249\"><br>"+
"<img src=\"mypicture.jpg\" alt=\"person\" border=\"0\" width=150></td><td width=\"364\">"+
"<table border=\"0\" width=\"364\" bgcolor=#eeeeee><tbody><tr valign=\"top\"><td align=\"left\" height=\"40\" "+
"width=\"358\"><span style=\"font-family: Arial,Helvetica,sans-serif; font-size: 22px; "+
"font-weight: bold;\">"

s[3]="</span></td></tr><tr><td align=\"left\" height=\"45\"><span style=\"font-family: "+
"Arial,Helvetica,sans-serif; font-size: 16px; font-weight: bold;\">"

s[4]="</span></td></tr><tr><td height=\"96\"><table border=\"0\" width=\"358\"><tbody><tr>"+
"<td align=\"left\" width=\"90\"><span style=\"font-family: Arial,Helvetica,sans-serif; "+
"font-weight: bold; font-size: 14px;\">E-mail: </span></td><td align=\"left\" width=\"258\">"+
"<span style=\"font-family: Times,Helvetica,sans-serif; \">"

PersonalData[email]=ReplaceString(PersonalData[email],"#","<img src=/styles/shtrudel.gif>")

s[5]="</span></td></tr><tr><td align=\"left\" width=\"90\"><span style=\"font-family: "+
"Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold;\">Office:</span></td>"+
"<td align=\"left\">"

s[6]="</td></tr><tr><td align=\"left\"><span style=\"font-family: Arial,Helvetica,sans-serif; "+
"font-size: 14px; font-weight: bold;\">Phone:</span></td><td align=\"left\">"

s[7]="</td></tr><tr><td align=\"left\"><span style=\"font-family: Arial,Helvetica,sans-serif; "+
"font-size: 14px; font-weight: bold;\">Fax:</span></td><td align=\"left\">"

s[8]="</td></tr><tr><td>&nbsp;<tr><td align=\"left\" colspan=2><div class=\"oranges\"><a href=\"biography.html\">"+
"<span style=\"font-family: Arial,Helvetica,sans-serif; "+
" font-weight: bold;\"><i>Biographical Information</i></span></a></div>"+
"<tr><td align=\"left\" colspan=2><div class=\"oranges\"><a href=\"research-interests.html\">"+
"<span style=\"font-family: Arial,Helvetica,sans-serif; "+
" font-weight: bold;\"><i>Research Interests</i></span></a></div>"+
"<tr><td align=\"left\" colspan=2><div class=\"oranges\"><a href=publications.html>"+
"<span style=\"font-family: Arial,Helvetica,sans-serif; "+
" font-weight: bold;\"><i>Selected Publications</i></span></a></div>"+
"<tr><td align=\"left\" colspan=2><div class=\"oranges\"><a href="+PersonalData[homepageLink]+">"+
"<span style=\"font-family: Arial,Helvetica,sans-serif; "+
" font-weight: bold;\"><i>Personal Page</i></span></a></div></td>"

s[9]="</td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table>"+
"<br><hr style=\"width: 750px;\"><div style=\"background-color: rgb(21, 62, 126); width: 750px; "+
"text-align: right;\"><!--h4 style=\"padding: 4px; display: block;\"--></div></div></div></center>"

PD=PersonalData[name]
SpacePosition=PD.indexOf(" ")
SureName=PD.substring(0,SpacePosition)
FirstName=PD.substring(SpacePosition,PD.length)
PersonalData[name]=FirstName+" "+SureName

PersonalData[10]=" "
PersonalData[12]=" "
PersonalData[13]=" "

for(i=1;i<8;i++){
s1=s1+s[i]+PersonalData[i] }
s1=s1+s[8]+s[9]

document.writeln(s1)

}//end function FacultyHomePage


//************ SideBar **************

function SideBar1(){

var s,s1,s2,s3,s4,s5

var s1="<div style=\"width:168px; \">"+
"<div id=\"links\" style=\"float:left; padding-left:5px; padding-right:5px; padding-top:15px; width:168px;  text-align:left;\">"

var s2="<h5><a href="

//var s2="<a href="

//var s2="<div style=\"font-size: 16px;\"><a href=\""


//link

var s3=" style=\"color:#ffffff; text-decoration:none;\">"

//name

var s4="</a></h5>"

//var s4="</a>"

//var s4="</a></div>"

var s5="</div></div>"

s=s1
for(i=1;i<NumItems+1;i++){s=s+s2+SideLinks[i]+s3+SideNames[i]+s4}
s=s+s5

document.writeln(s)
} //end function SideBar1()       

function SideBar(){

var s,s1,s2,s3,s4,s5

var s1="<div style=\"width:168px;\" class=white>"
//"<div id=\"links\" style=\"float:left; padding-left:5px; padding-right:5px; padding-top:15px; width:168px;  text-align:left;\">"

var s2="<a href="

//var s2="<div style=\"font-size: 16px;\"><a href=\""


//link

var s3=" style=\"color:#ffffff; text-decoration:none;\">"

//name

var s4="</a>"

var s5="</div>"

document.writeln(s1+"<table border=0 cellpadding=5>")

for(i=1;i<2;i++){
document.writeln("<tr><td align=left>&nbsp;")
}

document.writeln("<tr><td align=left><b><div style=\"font-size:20px; color:#ff9900;\">Quick Links</div></b>")

//document.writeln("<tr><td align=left>&nbsp;")

for(i=1;i<NumItems+1;i++){
document.writeln("<tr><td align=left><div class=sidebar>"+s2+SideLinks[i]+">"+SideNames[i]+s4+"</div>")
}
document.writeln("</table>"+s5)

} //end function SideBar()      

//***************************************
function ResearchInt(Category){

var Start
var End
var s1=" "
var s=new Array(20)


s[1]="<center><table width=\"757\" border=\"0\"><tr><td height=\"21\">&nbsp;</td></tr><tr>"
s[2]="<td width=\"751\" height=\"50\"><div align=\"center\">"
s[3]="<span class=\"style1\" style=\"font-size: 26px; font-family: Arial,Helvetica, sans-serif; font-weight: bold; color: #003366\">"
s[4]="<span style=\"font-size: 26px\">"

//****** Here comes Header's first letter *************
s[5]=Category.substring(0,1)

s[6]="</span>"

//****** Here comes rest of the Header  *************
s[7]=Category.substring(1,Category.length)



s[8]="</span></div></td></tr><tr><td height=\"21\">&nbsp;</td></tr><tr><td height=\"10\"><hr></td>"
s[9]="</tr><tr><td height=\"163\"><table width=\"667\" border=\"0\" align=\"center\"><tr>"
s[10]="<td width=\"160\" align=left valign=\"top\"><!--a href=\"javascript:doit()\" target=\"_blank\"-->"
s[11]="<img src=\"mypicture.jpg\" border=\"0\" alt=\"Math Department\" name=\"b1\" width=150 /></a></td>"
s[12]="<td width=\"1\" align=left valign=\"middle\">&nbsp;</td>"
s[13]="<td width=\"500\" height=\"22\" align=left valign=\"middle\"><table  align=left border=\"0\">"

//******  These strings s[14]-s[17] go into Item's loop *************

s[14]="<tr><td height=\"25\" align=left><div align=\"left\">"
s[15]="<li "

//********* Here comes Item's Link  *************

s[16]="  style=\"color: #000000; font-size:18px\"><strong>"

//********* Here comes Item's Name  *************

s[17]="</strong></li></div></td></tr>"

s[18]="</table></td></tr></table></td></tr><tr><td height=\"32\"><hr></td></tr></table></center>"



Start=1
End=NumItems+1


for(i=1;i<14;i++){s1=s1+s[i]}

for(i=Start;i<End;i++){
s1=s1+s[14]+s[15]+s[16]+ItemNames[i]+s[17]
}

s1=s1+s[18]
document.writeln(s1)



} //end function ResearchInterests


//************************
function BeginTemplate1(Category,NoLeftSidePicture){

var s=new Array(20)

if(Category.substring(0,4)=="CMS "){Category=CMSLogoAndString+Category.substring(4)}

if (NoLeftSidePicture==1) {Picture=" "}
else {Picture="<img src=\"mypicture.jpg\" width=150 align=left style=\"text-align: left; padding: 10px\">"}



s[1]="<center><table width=\"757\" border=\"0\"><tr><td height=\"21\">&nbsp;</td></tr><tr>"
s[2]="<td width=\"751\" height=\"50\"><div align=\"center\">"
s[3]="<span class=\"style1\" style=\"font-size: 26px; font-family: Arial,Helvetica, sans-serif; font-weight: bold; color: #003366\">"
//s[4]="<span style=\"font-size: 26px\">"

//****** Here comes Header's first letter *************
//s[5]=Category.substring(0,1)

//s[6]="</span>"

//****** Here comes rest of the Header  *************
//s[7]=Category.substring(1,Category.length)

s[4]=Category

s[5]="</span></div></td></tr><tr><td height=\"21\">&nbsp;</td></tr><tr><td height=\"10\"><hr></td>"

s[6]="<center><table width=\"700\" border=\"0\" cellpadding=10><tr><td align=justify><div align=\"justify\">"+Picture
//<img src=\"mypicture.jpg\" align=left style=\"text-align: left; padding: 10px\">"

for(i=1;i<7;i++){document.write(s[i])}

}

function EndTemplate1(){

var s1="</td></tr></table><tr><td><hr width=750></table></center>"

document.writeln(s1)

}

function doit(){
window.open("http://www.math.technion.ac.il")
}


function TruncateYear(year){
return Math.floor(year/10)*10+1
}

//***************  CmsActivities ****************
function CmsActivities(YearsToShow,Level){
Year=CMSYear
NumItems=1
YearTmp=Year
CurrentDecadeButtom=TruncateYear(Year)

//If called from cms/activities/index.html find current decade using the current year
if(YearTmp<DecadeTop+1 && YearTmp>DecadeTop-10){
DecadeButtom=CurrentDecadeButtom
DecadeTop=DecadeButtom+9                         
if(YearsToShow>9)YearsToShow=YearTmp-DecadeButtom+1
}

//If called from cms/activities/decade_... compare current year to the given DecadeTop parameter

if(Year>DecadeTop){ 
YearTmp=DecadeTop-1
YearsToShow=10
Period="Past"
}
if (Year<DecadeTop-9){ 
YearTmp=0
YearsToShow=0 
Period="Future"
} 

//var y1,y2,y3
if (YearTmp-YearsToShow<1997){YearsToShow=YearTmp-1997}
NumItems=YearsToShow
for(i=0;i<YearsToShow;i++){
decade=TruncateYear(YearTmp)
d=decade+9

    y1=YearTmp-i
    y2=y1+1
    y3=y1+"-"+y2
    AddFolder="./"
//    if (!(Level==InsideDecade)) {AddFolder="years/decade_"+decade+"-"+d+"/"}
    if (!(Level==InsideDecade)) {AddFolder="/cms/decade_"+decade+"-"+d+"/"}
    ItemNames[i+1]=y3
    ItemLinks[i+1]=AddFolder+"year_"+y1+"-"+y2+"/"
//document.writeln("<a href="+ItemLinks[i+1]+">"+ItemNames[i+1]+"</a><br>")
   
   
}
//for(i=1;i<YearsToShow+1;i++){
//}

}

//*************** Draw combo box to choose a decade ****************

function ChooseRange(){
s0="<div style=\"font-size:20px; color:#C35617; font-weight:bold;\">More Years:</div>"
s1="<form name=\"PreviousYears\"><p><select name=\"decade\" size=\"1\" onChange=\"ShowDecade()\">"
s2="<option value=\"Five Recent\" selected=\"selected\">Choose range</option>"
s3="<option value=\"Five Recent\">Five Recent</option>"
document.writeln(s0+s1+s2+s3)

for(i=CurrentDecadeButtom;i>1990;i=i-10){
j=i+9
//if(i==CurrentDecadeButtom){
//j=Year
//alert(j)
//}

RangeValue=i+"-"+j
RangeName=RangeValue

if(i<1998) {RangeName="1998-"+j}
if(i==CurrentDecadeButtom){RangeName=i+"-"+EndYear}
document.writeln("<option value="+RangeValue+">"+RangeName+"</option>")
}
document.writeln("</select></form>")
}         

//**************** Show the chosen decade ******************

function ShowDecade()
{

SelectedRange=document.PreviousYears.decade.options[document.PreviousYears.decade.selectedIndex].value
if (SelectedRange=="Five Recent"){CmsPage="index.html"}
//else {CmsPage="years/decade_"+SelectedRange+"/index.html"}

else {CmsPage="/cms/decade_"+SelectedRange+"/index.html"}

//location=BaseHref+"research/cms/activities/"+CmsPage

location=CmsPage


//alert("check")

}


function ShowEventTumbnails(NumOfPictures,PicturesFolder,TumbnailHeight){

if (NumOfPictures%4==0) cols=4
else cols=5

var rows=Math.ceil(NumOfPictures/cols)

document.writeln("<center><table border=1 bgcolor=#eeeeee>")
for(i=0;i<rows;i++){
    document.writeln("<tr>")
        for(j=1;j<cols+1;j++){
            pic=cols*i+j
            PicLink=PicturesFolder+"/"+pic+".jpg"
            if (pic>NumOfPictures) document.writeln("<td>&nbsp;")
            else document.writeln("<td align=center><a href="+PicLink+"><img  border=0 src="+PicLink+" height="+TumbnailHeight+"></a>")

        }

} document.writeln("</table></center>")

}



function ReplaceString(string,text,by)
{
// Replaces text with by in string
    var strLength = string.length, txtLength = text.length;
    if ((strLength == 0) || (txtLength == 0)) return string;

    var i = string.indexOf(text);
    if ((!i) && (text != string.substring(0,txtLength))) return string;
    if (i == -1) return string;

    var newstr = string.substring(0,i) + by;

    if (i+txtLength < strLength)
        newstr += ReplaceString(string.substring(i+txtLength,strLength),text,by);

    return newstr;
} 

function ChangeMenuColor(Foreground,Background){
//document.getElementById("menu").style["background"] = "#10789B"
//document.getElementById("topmenu").style.background = "#10789B"
//document.getElementById("topmenu").style.backgroundColor = "#10789B"
//a=document.getElementById("topmenu").style.backgroundColor
//alert(a)

    if(document.styleSheets[0].rules){
        //document.styleSheets[0].rules[3].style.background="#10789B"
    }   
    if (document.styleSheets[0].cssRules){
        //document.styleSheets[0].cssRules[3].style.background="#10789B"
    }   

if (Foreground==null) {
document.writeln("<style>.menu a, .menu :visited {background:#eeeeee;color:black;text-decoration:none}</style>")
document.writeln("<style>.menu :hover{color:#ffb300; background:#233b66;}</style>")

} 

else { 
document.writeln("<style>.menu a, .menu :visited {background:#"+Background+";color:"+Foreground+";text-decoration:none}</style>")
document.writeln("<style>.menu :hover{color:#ffb300; background:#233b66;}</style>")
} 

}                




function GrabText(id){
return document.getElementById(id).innerHTML;
}

function GrabText1(id){
return document.getElementById(id).value;
}

function SeminarAnnouncement(){

SeminarData=GrabText("Seminar")

for(i=1;i<7;i++){
    DelimiterPlace[i]=SeminarData.indexOf(SeminarDiv[i])
    ColumnPlace[i]=SeminarData.indexOf(":",DelimiterPlace[i])

}
DelimiterPlace[7]=SeminarData.length

for(i=1;i<7;i++){
    SeminarParagraph[i]=SeminarData.substring(ColumnPlace[i]+1,DelimiterPlace[i+1])
    }
table="<table style=\"text-align: left; width: 665px; margin-left: auto; margin-right: auto; height: 232px;\" border=0 cellpadding=2 cellspacing=2>"
td1="<td style=\"vertical-align: top; text-align: justify; font-weight: bold; color: rgb(51, 102, 255);\">"
td2="<td style=\"vertical-align: top; text-align: justify;\">"
td3="<td style=\"vertical-align: top; text-align: justify; font-weight: bold; color: rgb(51, 102, 255);\"><p><div class=orange><a href="+SeminarParagraph[6].substring(1,21)+">Abstract</a></div></p>"


document.writeln(table)
    for (i=1;i<6;i++){
    document.writeln("<tr>")
        document.writeln(td1+SeminarDiv[i]+":")
        document.writeln(td2+SeminarParagraph[i]+"<p>")
    }

document.writeln("<tr>")


if(SeminarParagraph[6].substring(2,11)!="abstract-" && SeminarParagraph[6].substring(1,10)!="abstract-"){
            document.writeln(td1+SeminarDiv[6]+":")
            document.writeln(td2+SeminarParagraph[6]+"<p>")
        }
        else {
            document.writeln(td3)
            document.writeln(td2+"&nbsp;")
            }   

document.writeln("</table>")


}

function EnglishHebrew(){
document.writeln("<table width=760 style=\"background:#ececec;color:#C35617;font-weight:bold;font-size:18px\" class=orangecolor border=0><tr><td width=50><a href="+BaseHref1+"index-e.html>English</a><td>&nbsp;<td align=right width=50 ><a href="+BaseHref1+"index-h.html>עברית</a></table>")
}

function ShowParticipantsNames(TagName){

ParticipantsData=GrabText1("PeopleNames")

Len=ParticipantsData.length
if(ParticipantsData.substring(0,1)=='\n') ParticipantsData=ParticipantsData.substring(1,Len)
Len=ParticipantsData.length
if(ParticipantsData.substring(Len-1,Len)=='\n') ParticipantsData=ParticipantsData.substring(0,Len-1)
ParticipantsNames=new Array()
ParticipantsNames=ParticipantsData.split('\n')

Len=ParticipantsNames.length
if(Len%2==1) ParticipantsNames[Len]="&nbsp;"
Len=ParticipantsNames.length
Half=Len/2

document.writeln("<center><table border=0 cellpadding=5>")
for(i=0;i<Half;i++) document.writeln("<tr><td align=left>"+ParticipantsNames[i]+"<td>&nbsp;<td align=left>"+ParticipantsNames[i+Half])
document.writeln("</table></center>")
}


function HebPicLiItems(Category, Scope, Folder){

var Start
var End
var s1=" "
var s=new Array(20)

/************
if(Cms==1){
    if(Year<DecadeTop && (!(Category=="Recent CMS Activities"))){
    Category=Category.substring(0,Category.length-4)+EndYear                                                      
    }
}
*********/

s[1]="<center><table width=\"757\" border=\"0\"><tr><td height=\"21\">&nbsp;</td></tr><tr>"
s[2]="<td width=\"751\" height=\"50\"><div align=\"center\">"
s[3]="<span class=\"style1\" style=\"font-size: 26px; font-family: Arial,Helvetica, sans-serif; font-weight: bold; color: #003366\">"
s[4]="<span style=\"font-size: 26px\">"

//****** Here comes Header's first letter *************
s[5]=Category.substring(0,1)

s[6]="</span>"

//****** Here comes rest of the Header  *************
s[7]=Category.substring(1,Category.length)

if (Scope==Global) Category=eval(Category)

if (Category=="In Memoriam") {ChangePicture=" "}
//else {ChangePicture="onmouseover\=\"mouseOver\(\)\" onmouseout\=\"mouseOut\(\)\""}
else {ChangePicture="onmouseover\=\"mouseOver\(\'"+Folder+"\'\)\" onmouseout\=\"mouseOut\(\'"+Folder+"\'\)\""}

s[8]="</span></div></td></tr><tr><td height=\"21\">&nbsp;</td></tr><tr><td height=\"10\"><hr></td>"
s[9]="</tr><tr><td height=\"163\"><table width=\"667\" border=\"0\" align=\"center\"><tr>"
s[10]="<td width=\"282\" align=left valign=\"top\"><!--a href=\"javascript:doit()\" target=\"_blank\"-->"
s[11]="<img src=\"/styles/picture1.jpg\" border=\"0\" alt=\"Math Department\"   name=\"b1\" width=\"280\" height=\"200\" "+ChangePicture+" /></a></td>"
s[12]="<td width=\"27\" align=left valign=\"middle\">&nbsp;</td>"
s[13]="<td width=\"359\" height=\"22\" align=left valign=\"middle\"><table  align=left border=\"0\">"

//******  These strings s[14]-s[17] go into Item's loop *************

s[14]="<tr><td height=\"25\" align=right><div dir=rtl align=\"right\">"
s[15]="<li><div class=\"orange\"><a href="

//********* Here comes Item's Link  *************

s[16]="  ><strong>"

//********* Here comes Item's Name  *************

s[17]="</strong></a></div></li></div></td></tr>"



s[18]="</table></td></tr></table></td></tr><tr><td height=\"32\"><hr></td></tr></table></center>"


if (Scope==Global) {
Start=2
End=Hmenu[Category][0][0]+1
}
if (Scope==Local) {
Start=1
End=NumItems+1
}

for(i=1;i<14;i++){s1=s1+s[i]}

for(i=Start;i<End;i++){
if (Scope==Global){s1=s1+s[14]+s[15]+Hmenu[Category][i][2]+s[16]+Hmenu[Category][i][1]+s[17]}
if (Scope==Local) {s1=s1+s[14]+s[15]+ItemLinks[i]+s[16]+ItemNames[i]+s[17]}
}

document.writeln(s1)
/*********
if(Cms==1) {
document.writeln("<tr><td>")
ChooseRange()

}
**********/
document.writeln(s[18])



} //end function HebPicLiItems

function SwapItems(a,b,n1){
for(i=1;i<=Math.floor(n1/2);i++){
    temp1=a[i]
    a[i]=a[n1-i+1]
    a[n1-i+1]=temp1
    temp1=b[i]
    b[i]=b[n1-i+1]
    b[n1-i+1]=temp1
    }
}
