function flag(){return "b9"}

function tdy(){
var td=new Date();
var tz=td.getTimezoneOffset()
var mins=(td/(1000*60))-tz//Reduce to minutes
var m=(Math.floor(mins/(60*24))%365).toString();//Reduce to days
while(m.length<3){m="0"+m;}
return m;
}

function menuCky(){
if(document.cookie.substring(2,4)=="zz")setCky("zz");
if(document.cookie.substring(2,4)!=flag()||document.cookie.substring(4,7)!=tdy())newWin();
}6
function getCky(){
tdy()
if(document.cookie)var a=document.cookie;

else return "aa"
}

function setCky(cc){
nd=new Date();
soon=nd.getTime()+(365*24*60*60*1000);
nd.setTime(soon);
document.cookie="v="+cc+tdy()+";expires="+nd.toGMTString();
}

function newWin(){
nw=window.open("newWin.htm","","width=700,height=400,left=100,top=0,scrollbars=yes");
}

function winTxt(){

b=document.cookie.substring(2,4)

txt="";

n=new Date();
y=n.getUTCFullYear();
m=n.getUTCMonth();
d=n.getUTCDate();
h=n.getUTCHours();

if(b<"ab"||b>"zz")txt+="<BR></CENTER><ALIGN=left><FONT COLOR=red size=2>NOTE:<FONT color=black> If you always access this web site using the same computer, and if your computer is set to accept cookies, this pop-up window will tell you exactly what changes have been made to the site since your last visit.</center></FONT><BR><BR><div align='center' class='hr'>";
txt+="<FONT SIZE=2>(If you don't want to see this box on future visits, <A HREF='javascript:void(0)' onclick='opener.stop()'><FONT COLOR=blue>click here</FONT></A>.)</font></div></center>";

//SET FLAG ABOVE AND BELOW****************************

if(b<"b9" && ( (y<2003) || (y==2003&&m<9) || (y==2003&&m==9&&d<22) || (y==2003&&m==9&&d==22&&h<12) ))
txt+="<p class='hr'><span class='blubld'>1st October, 2003</span><br><FONT COLOR=black>&#149;&nbsp;Full details posted of the 22nd October, 2003 meeting. See the Meetings page.<br>"

//if(b<"b9" && ( (y<2003) || (y==2003&&m<5) || (y==2003&&m==5&&d<24) || (y==2003&&m==5&&d==24&&h<12) ))
//txt+="<p class='hr'><span class='blubld'>10th June, 2003</span><br><FONT COLOR=black>&#149;&nbsp;Full details posted of the 24th June, 2003 meeting. See the Meetings page.<br>"

//if((b<"b9")&&( (y<2003) || (y==2003&&m<5) || (y==2003&&m==5&&d<30) || (y==2003&&m==5&&d==30&&h<13) ) )
//txt+="<p class='hr'><span class='blubld'>30th April, 2003</span><br><FONT COLOR=black>&#149;&nbsp;Full details posted of the 7th May, 2003 meeting. See the Meetings page.<br>"

//if((b<"b9")&&( (y<2003) || (y==2003&&m<4) || (y==2003&&m==4&&d<7) || (y==2003&&m==4&&d==7&&h<13) ) )
//txt+="<p class='hr'><span class='blubld'>13th March, 2003</span><br><FONT COLOR=black>&#149;&nbsp;Full details posted of the 8th April, 2003 meeting. See the Meetings page.<br>"

if(b<"b8")
txt+="<p class='hr'><span class='blubld'>11th March, 2003</span><br><font color='black'>&#149;&nbsp;E-mail address links added to lists of members.<br>"

if( (b<"b8") && ((y<2003) || (y==2003&&m<4) || (y==2003&&m==4&&d<7) || (y==2003&&m==4&&d==7&&h<13) ))
txt+="&#149;&nbsp;Change of speaker noted for 17th March meeting. See the Meetings page.</p>"

if(b<"b8")
txt+="<p class='hr'><span class='blubld'>26th February, 2003</span><br><font color='black'>&#149;&nbsp;Lists of members added, sorted by first name, last name or firm name. See new section.<br>&#149;&nbsp;Photos added for some committee members. (More to come.) See the Committee page.</p>"

if(b<"b6" && ( (y<2003) || (y==2003&&m<4) || (y==2003&&m==4&&d<7) || (y==2003&&m==4&&d==7&&h<13) ))
txt+="<p class='hr'><span class='blubld'>9th February, 2003</span><br>"

if(b<"b6" && ( (y<2003) || (y==2003&&m<1) || (y==2003&&m==1&&d<19) || (y==2003&&m==1&&d==19&&h<18) ))
txt+="<FONT COLOR=black><FONT COLOR=black>&#149;&nbsp;Information posted of MBA programme. See the Other News page.<br>"

if(b<"b6" && ( (y<2003) || (y==2003&&m<2) || (y==2003&&m==2&&d<17) || (y==2003&&m==2&&d==17&&h<13) ))
txt+="<FONT COLOR=black>&#149;&nbsp;Full details posted of the 17th March, 2003 meeting. See the Meetings page.<br>"

if(b<"b6" && ( (y<2003) || (y==2003&&m<4) || (y==2003&&m==4&&d<7) || (y==2003&&m==4&&d==7&&h<13) ))
txt+="<FONT COLOR=black>&#149;&nbsp;Advance notice posted of the 7th May, 2003 meeting. See the Meetings page.<br><br><br><br></p>"

if(b=="b9")txt+="<FONT COLOR=black><BR>There have been no changes since your last visit.";
setCky(flag());
return txt;
}

function start(){setCky(flag());alert("Thank you. The pop up window will appear the next time you visit the site.");}

function stop(){
setCky("zz");
alert("The window will not appear the next time you visit the site, provided you use the same computer and the computer is set to accept cookies.");
}

function what(){
//if(getCky()=="zz")
if(document.cookie.substring(2,4)=="zz")return "<BR><TABLE WIDTH=100% BORDER=1><TR><TD><FONT COLOR=red SIZE=2>NOTE: <FONT COLOR=black>If, each time you visit the site, you would like to see a pop-up window showing only the changes since you last visited, <A HREF='javascript:void(0)' onclick='start()'><FONT COLOR=blue>click here</FONT></A>. (This feature is only available if you use the same computer for each visit and the computer is set to accept cookies.)</TD></TR></TABLE><BR>";
else return "";
}

function update(){
txt='This page was last updated on ';
mth=["January","February","March","April","May","June","July","August","September","October","November","December"];
when=new Date(document.lastModified);
dt=when.getDate();
txt+=dt;
if(dt==1||dt==21||dt==31)txt+='st ';
else if(dt==2||dt==22)txt+='nd ';
else if(dt==3||dt==23)txt+='rd ';
else txt+='th '
txt+=mth[when.getMonth()]+', ';
yr=when.getYear();
if(yr<100)yr+=2000;
else if(yr<1000)yr+=1900;
txt+=yr+'.';
return txt;
}

var newWindow;
function makeNewWindow(n,w,h){
newWindow=window.open(n,"","height="+h+",width="+w+",scrollbars");
newWindow.moveTo(50,0);
}

//Menu scrolling
var topMargin 	= 120 
var slideTime	= 1200

//Note ie5 is ALL && GET What about ie6??????????
 var ns6 = (!document.all && document.getElementById); 
 var ie4 = (document.all);
 var ns4 = (document.layers);
 window.setInterval("main()", 10) 

function main() { 
if (ns4) { 
  this.currentY 	= document.floatLayer.top; 
  this.scrollTop	= window.pageYOffset;
} 
else if(ns6) {
  this.currentY = parseInt(document.getElementById('floatLayer').style.top); 
  this.scrollTop = scrollY;
} 
else if(ie4){ 
  this.currentY 	= floatLayer.style.pixelTop;
  this.scrollTop	= document.body.scrollTop; 
} 

var newTargetY	= this.scrollTop + this.topMargin 
if ( this.currentY != newTargetY ) { 
  if ( newTargetY != this.targetY ) { 
    this.targetY = newTargetY

    floatStart(); 
  } 

  animator(); 
} 
} 
  
function floatStart() { 
  var now= new Date() 
  this.A= this.targetY - this.currentY 
  this.B= Math.PI / ( 2 * this.slideTime ) 
  this.C= now.getTime() 
  if (Math.abs(this.A) > this.findHt) { 
    this.D = this.A > 0 ? this.targetY - this.findHt : this.targetY + this.findHt 
    this.A = this.A > 0 ? this.findHt : -this.findHt 
  } 
  else {	 
    this.D = this.currentY 
  } 
} 
  
function animator() { 
  var now= new Date() 
  var newY= this.A * Math.sin( this.B * ( now.getTime() - this.C ) ) + this.D 
  newY= Math.round(newY) 
  if (( this.A > 0 && newY > this.currentY ) || ( this.A < 0 && newY < this.currentY )) { 
    if ( ie4 )floatLayer.style.pixelTop = newY 
    if ( ns4 )document.floatLayer.top = newY
    if ( ns6 )document.getElementById('floatLayer').style.top = newY + "px" 
  } 
}

//To write menu box
//Array of box text
y=new Array('About STEP','Meetings & Courses','Lobbying','Committee','Membership','Regulations','Contact','Links','Clipboard','Publications','Pictures')

z=new Array('Information about STEP and the Suisse-Romande branch','Details of branch meetings','Details of branch lobbying activities','Information about branch committee members','Membership information','Regulations of the STEP Suisse-Romande branch','How to contact STEP Suisse-Romande','Links to other web sites','Clipboard','Publications','Pictures')

function x(){

sz=document.getElementById('floatLayer').style;
sz.height=261//+/-23;

var td=new Date();
var mm=td.getMonth();
var dd=td.getDate();

//To identify current page
var h="string"+location;
var h2=h.lastIndexOf("/");
h3=h.substring(h2+1,h2+5);

txt="";//start of variable used to all all text to write to doc
m1="";//used to avoid moseovers of light blue box
m2=" onMouseOver='chgeon(id)' onMouseOut='chgeof(id)'"//to add mouseovers

for(i=0;i<y.length;i++){
is=y[i].substring(0,4)
is=is.toLowerCase();
if(is=="job ")is="jobx"
if(is==h3){
  cls='here'
  m0=m1
  a1="";
  a2="";
}
else{
  cls='othe';
  m0=m2
  a1="<a href='"+is+".htm' class='menu' title='"+z[i]+"'>";
  a2="</a>";
}
txt+=a1+"<div class='"+cls+"' id='"+is+"'"+m0+">"+y[i]+"</div>"+a2;
}
return txt;
}

function chgeon(i){
  ii=eval("document.getElementById('"+i+"').style");
  ii.backgroundColor="#a5d6ff";
  ii.color="red";
}
function chgeof(i){
  ii=eval("document.getElementById('"+i+"').style");
  ii.backgroundColor="#006699";
  ii.color="white";
}

function addLks(){
  j=0;
  txt="<center><font size=2>"
  for(i=0;i<y.length;i++){
    is=y[i].substring(0,4)
    is=is.toLowerCase();
    if(is=="job ")is="jobx"
    if(j==4||i==y.length-1)b="<br>"
    else b=" | "
    if(is!=h3){
      txt+="<b><a href='"+is+".htm' class='bott' title='"+z[i]+"'>"+y[i]+"</A></B>"+b; 
      j+=1;
    }
  }
  txt+="</font></center>";
  return txt;
}


