//javasript Ver 2 Global.js ver1
var URLpix =""
var popWin=""
var offsetxpoint=-3//Customize x offset of tooltip
var offsetypoint=15 //Customize y offset of tooltip
var ie=document.all
var ns6=document.getElementById && !document.all
var enabletip=false
var menuobj=""
var tipobj=""
var blinkoff=""
var flashoff=""
var x = navigator;
var CodeName = x.appCodeName
var MinorVersion =x.appMinorVersion
var Name=x.appName
var Version=x.appVersion
var CookieEnabled=x.cookieEnabled
//var CPUClass=x.cpuClass
//var OnLine=x.onLine
//var Platform=x.platform
//var UA=x.userAgent
//var BrowserLanguage=x.browserLanguage
//var SystemLanguage=x.systemLanguage
//var UserLanguage=x.userLanguage
var frontpageXSL="../MWW_Style/FrontPageStyle.xsl"
var frontpageXML="../MWRG_content/Front_Page.xml"
var videoXSL="../MWW_Style/Front_PageVideo.xsl"
var alreadyrunflag=0 //flag to indicate whether target function has already been run
var BrowserHeight=0 
var DisclaimerStatement=""
//  ****************************************************Load Website Browser portion **********************************
//document.write('<div id="slotpix" style="visibility:hidden"></div>')
document.write('<div id="MenuLink" style="visibility:hidden" ></div>')//
document.write('<div id="dhtmltooltip" style="visibility:visible"></div>')
document.write('<div id="MainContent" style="visibility:hidden"></div>')
document.write('<div id="FlowMessage" style="visibility:hidden"></div>')
document.write('<div id="subNavBlock" style="visibility:hidden"></div>')
document.write('<div id="Statement" style="visibility:hidden"></div>')
	if( typeof( window.innerHeight ) == 'number' ) {
  BrowserHeight = window.innerHeight}
else { BrowserHeight = document.documentElement.clientHeight
	}
if
 (document.addEventListener)
  document.addEventListener("DOMContentLoaded", function(){alreadyrunflag=1; Ststup(frontpageXSL,frontpageXML)}, false)
else if (document.all && !window.opera){
  		document.write('<script type="text/javascript" id="contentloadtag" defer="defer" src="javascript:void(0)"><\/script>')
  		var contentloadtag=document.getElementById("contentloadtag")
  		contentloadtag.onreadystatechange=function(){
    if (this.readyState=="complete"){
      	alreadyrunflag=1
    	Ststup(frontpageXSL,frontpageXML)
    }
  }
}

window.onload=function(){
  setTimeout("if (!alreadyrunflag){Ststup(frontpageXSL,frontpageXML)}", 0)
}

if(/Safari/i.test(navigator.userAgent)){ //Test for Safari
  var _timer=setInterval(function(){
  if(/loaded|complete/.test(document.readyState)){
    clearInterval(_timer)
     Ststup(frontpageXSL,frontpageXML) // call target function
  }}, 10)
}

document.onmousemove=positiontip
if (ie||ns6){
tipobj=document.all? document.all['dhtmltooltip'] : document.getElementById? document.getElementById('dhtmltooltip') : ""
}

// $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ Website  startup portion End $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

//  **************************************************** Home page portion **********************************

function Ststup(frontpageXSL,frontpageXML){
preloadImages('../MWW_images/blueblank2.gif','../MWW_images/backdrop.jpg','../MWW_images/navblue.jpg','../MWW_images/bluepickx.jpg','../MWW_images/Swansimage.jpg','../MWW_images/sixdux.gif','../MWW_images/vidbutton.jpg','../MWW_images/MWWlogo.jpg')

InitialFetch("../MWW_Style/Disclaimer_Style.xsl","../MRWG_content/Disclaimer_Text.xml",'Statement')
	
InitialFetch("../MWW_Style/NavigatorMenu.xsl","../MRWG_content/MenuLine_Text.xml",'subNavBlock')
CheckBrowser('Statement')
	DisclaimerStatement=menuobj.innerHTML
alertSize('Statement',50)

FetchPage(0)
//setTimeout('makeQuery(frontpageXML,"FlowMessage")',2000)
//	Fix_Cookie('Global', "Quincy "+CodeName+Name, 6, '/', '', '' )
//flashoff=setTimeout('DivHide("MenuLink")',12000)
//DivHide("MenuLink")

};

// $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ Home Page startup portion  End$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

function Fix_Cookie( name, value, expires, path, domain, secure )
{
// set time, it's in milliseconds
var today = new Date();
today.setTime( today.getTime() );

/*
if the expires variable is set, make the correct
expires time, the current script below will set
it for x number of days, to make it for hours,
delete * 24, for minutes, delete * 60 * 24
*/
if ( expires )
{
expires = expires * 1000 * 60 ;//* 60 * 24;
}
var expires_date = new Date( today.getTime() + (expires) );

document.cookie = name + "=" +escape( value ) +
( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) +
( ( path ) ? ";path=" + path : "" ) +
( ( domain ) ? ";domain=" + domain : "" ) +
( ( secure ) ? ";secure" : "" );
}
		
// ************************************** Div control portion ******************************
function CheckBrowser(seance){
if (ie||ns6){
 menuobj=document.all? document.all[seance] : document.getElementById? document.getElementById(seance) : ""
};
}

function checkDiv(seance){
	if( typeof( window.innerHeight ) == 'number' ) {
  BrowserHeight = window.innerHeight}
else { BrowserHeight = document.documentElement.clientHeight
	}
	};
function DivReveal(seance,which){
CheckBrowser(seance)
menuobj.innerHTML=which
menuobj.style.visibility='visible'
};
function DivHide(seance){
CheckBrowser(seance)
menuobj.style.visibility='hidden'
};
function DivAddon(seance,which){
CheckBrowser(seance)
var oldHTML=menuobj.innerHTML
menuobj.innerHTML=oldHTML +which
menuobj.style.visibility='visible'
};
function DivOn(seance){
CheckBrowser(seance)
menuobj.style.visibility='visible'
};

function DivResize(seance,cap,wide,hi){
document.getElementById(seance).style.top=cap+'px'
document.getElementById(seance).style.width=wide+'px'
document.getElementById(seance).style.width=hi+'px'
};

function DivVid(increment){
//makeRequest('../MWRG_content/Chronicle/Video_Blank.xml','FlowMessage')
document.getElementById('FlowMessage').style.visibility='hidden'
FetchPage(increment)

};
function alertSize(seance,height) {
 CheckBrowser(seance)
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
   myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
 myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
 }
 menuobj.style.top=(myHeight-height)+'px'
};

// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Div control portion  End $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
function CloseDownPopWindow(){
if (popWin && !popWin.closed){
popWin.close()}
};

function openAWindow(pageToLoad){
//CloseDownPopWindow()
width=600
height=500
center=100
    xposition=30; yposition=50;
    if ((parseInt(navigator.appVersion) >= 4 ) && (center)){
        xposition = (screen.width - width) / 2;
        yposition = (screen.height - height) / 2;
    }
    var args = "";
    	args += "width=" + width + "," + "height=" + height + ","
		+ "location=0,"
		+ "menubar=0,"
		+ "resizable=1,"
		+ "scrollbars=1,"
		+ "statusbar=false,dependent,alwaysraised,"
		+ "status=false,"
		+ "titlebar=no,"
		+ "toolbar=0,"
		+ "hotkeys=0,"
     popWin= window.open(pageToLoad,'linkupWin',args)
}
 // ************************************** Screen Display  portion *****************************************  

function preloadImages(){
  if(document.images)  {
    if(!document.imageArray) document.imageArray = new Array()
    var i,j = document.imageArray.length, args = preloadImages.arguments;
    for(i=0; i<args.length; i++)   {
      if (args[i].indexOf("#")!=0)
      {  document.imageArray[j] = new Image;
        document.imageArray[j++].src = args[i]
      }
    }
  };}

function InitialFetch(Presentational,xmlDoc,seance){
document.getElementById(seance).innerHTML = " "
if(document.implementation.createDocument) {
var xsltProcessor = new XSLTProcessor()
 var myXMLHTTPRequest = new XMLHttpRequest()
  myXMLHTTPRequest.open("GET", Presentational, false)
  myXMLHTTPRequest.send(null)
  Presentational = myXMLHTTPRequest.responseXML
  xsltProcessor.importStylesheet(Presentational)
  myXMLHTTPRequest = new XMLHttpRequest()
  myXMLHTTPRequest.open("GET", xmlDoc, false)
  myXMLHTTPRequest.send(null)
  xmlDoc = myXMLHTTPRequest.responseXML
  var fragment = xsltProcessor.transformToFragment(xmlDoc, document)
  document.getElementById(seance).innerHTML = ""
  document.getElementById(seance).appendChild(fragment)
} else  {
	var xmlDOM=new ActiveXObject("Msxml2.DOMDocument.3.0")
	var essform= new ActiveXObject("Msxml2.DOMDocument.3.0")
	var srcTree = xmlDOM
        srcTree.async=false
        srcTree.load(xmlDoc)
		 var xsltTree=essform
        xsltTree.async = false
        xsltTree.load(Presentational);
 document.getElementById(seance).innerHTML = ""
 document.getElementById(seance).innerHTML =srcTree.transformNode(xsltTree)
}
menuobj=document.getElementById(seance)
menuobj.style.visibility='visible'
};

function makeRequest(URLpix,target) {
if (window.ActiveXObject) {
  		link = new ActiveXObject("Microsoft.XMLHTTP");
 	} else if (window.XMLHttpRequest) {
  		link = new XMLHttpRequest()
 	}
 	if (link == undefined) {return false}
link.onreadystatechange =function() { response(target)}
link.open("GET",URLpix, true)
link.send(null)
}
function checkReadyState(link){
 if(link.readyState == 4)  {
    if(link.status == 200)  {
      return true;  }
    else { alert("Problem retrieving data link.readyState "+link.readyState +" link.status "+link.status + " "+URLpix )
    }
  }
}
function response(target) {
if(checkReadyState(link)) {
document.getElementById(target).innerHTML = link.responseText
document.getElementById(target).style.visibility='visible'
};}

// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Screen display portion End $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

function AlbumGallery(){
	InitialFetch('../MWW_Style/googlie_01.xsl','../MWRG_album/Gallery1/pix_bouncers/yorker.xml','slotpix')
//	InitialFetch("../MWW_Style/Links_style.xsl","MWRG_content/Websites.xml",'slotpix')
	}

function Album_2(bouncer){
	var SubB='../MWRG_album/Gallery2/pix_bouncers/bouncer'+bouncer
 makeRequest(SubB+".xml",'pix_frame')
};

function splitter(yorker){
	var SubB='../MWRG_album/Gallery2/pix_bouncers/yorker'+yorker
 makeRequest(SubB+".xml",'pix_frame')
};


function PictureBouncer(bouncer){
	
	var SubB= '../MWRG_album/Gallery1/pix_bouncers/bouncer'+bouncer
if (bouncer>0){
 makeRequest(SubB+".xml",'pix_frame')
}
};

//Used to set the disclaimer to the bottom of the screen
function ChexDisclaimer(seance){
var seanceHTML
var statementHTML
var divHeight
var seanceobj
alertSize('Statement',50)
CheckBrowser('Statement')
statementHTML=menuobj.innerHTML
seanceobj = document.getElementById(seance)
seanceHTML=seanceobj.innerHTML
	if(seanceobj.offsetHeight){divHeight=seanceobj.offsetHeight;}
	else if(seanceobj.style.pixelHeight){divHeight=seanceobj.style.pixelHeight;}
	if (ie){ 
	if ( (divHeight+50) > (BrowserHeight-50)) { DivHide('Statement') ;seanceobj.innerHTML=seanceHTML+DisclaimerStatement
	}
	else { setTimeout('DivOn("Statement")',200)
		CheckBrowser("Statement"); menuobj.style.top=(BrowserHeight-45)
		}
		}
	if (ns6)	{
			if ( (divHeight+50) > (BrowserHeight-45) ) { seanceobj.innerHTML=seanceHTML+DisclaimerStatement;DivHide('Statement') ;
	}
	else { setTimeout('DivOn("Statement")',200)
		CheckBrowser("Statement"); menuobj.style.top=(screen.availHeight)
		}
		}
};
	//******************************************
function PageOpener(filename) {
	if (Name == "Netscape")
	window.open(filename, '_Tab')
  else {window.open(filename, '_self') }              
};

//******************************************
function FieldCard(filename){window.open(filename, '_Tab') 
}
function NewPage(filename){window.open(filename, '_self') 
}

//User to select choice of browswer page to display 
function FetchPage(increment){
switch (increment){
case 0: //Main Menu item #1 HOME
		InitialFetch(frontpageXSL,frontpageXML,'MainContent')
		ChexDisclaimer('MainContent')
	break;	
case 127: //Main Menu Item #2 VIDEO LIBRARY
		InitialFetch("../MWW_Style/Video_LibraryListing.xsl","../MWRG_content/video_library_page.xml",'MainContent')
	ChexDisclaimer('MainContent')
	break;
case 10: //Maim Menu Item #3 EVENTS GALLERY
		InitialFetch("../MWW_Style/PictureGallery.xsl","../MWRG_content/PictureGallery_Text.xml",'MainContent')
		
		makeRequest('../MWRG_album/Gallery1/pix_bouncers/bouncer99.xml','pix_frame')
		//PictureBouncer(99)//',100)//PictureBouncer(99)
ChexDisclaimer('MainContent')
break;

case 110: //Maim Menu Item #3 EVENTS GALLERY
		InitialFetch("../MWW_Style/EventsOpener.xsl","../MWRG_content/EventsOpener_text.xml",'MainContent')
		
		//DivAddon('MainContent','../MWRG_album/Bowler.xsl')
		makeRequest( '../MWRG_album/Bowler.xsl','FlowMessage')
ChexDisclaimer('MainContent')

break;


case 911: // Main Menu Item #4 THE ROUTE
		//	preloadImages('../MWW_images/NorthTownStream.jpg','../MWW_images/Paged_Images/TownMoor.jpg','../MWW_images/YorkRoadBridge.jpg')
			InitialFetch('../MWW_Style/TheRoute_Style.xsl',"../MWRG_content/TheRoute_Text.xml",'MainContent')
			ChexDisclaimer('MainContent')
	break;
case 912: // Main Menu Item #5 As It Is Today
			InitialFetch("../MWW_Style/AsitIsNow_Style.xsl","MWRG_content/AsitIsNow_Text.xml",'MainContent')
			ChexDisclaimer('MainContent')
	break;
case 920://Main Menu Item #6 Project Phase 1
		InitialFetch('MWW_Style/ProjectPhase1_Style.xsl','MRWG_content/ProjectPhase1_Text.xml','MainContent')
		ChexDisclaimer('MainContent')
	break;
case 921: //Main Menu Item #7 Project Phase 2
		InitialFetch('MWW_Style/ProjectPhase2_Style.xsl','MRWG_content/ProjectPhase2_Text.xml','MainContent')
		ChexDisclaimer('MainContent')
	break;
case 913: //Main Menu Item #8 History
	//	preloadImages('../MWW_images/StIvesPlace.jpg','../MWW_images/Chapel_Arches.jpg','../MWW_images/GracesYard.jpg','../MWW_images/Chapelarchway.jpg')
		InitialFetch("../MWW_Style/History_Style.xsl","MWRG_content/History_Text.xml",'MainContent')
		ChexDisclaimer('MainContent')
	break;
case 914://Main Menu Item #9 Habitat
		InitialFetch('MWW_Style/Habitat_Style.xsl','MWRG_content/Habitat_Text.xml','MainContent')
		ChexDisclaimer('MainContent')
	break;
case 915: //Main Menu Item #10 Design Criteria
		preloadImages('../MWW_images/CrossSection.jpg','../MWW_images/LevelSurvey.jpg','../MWW_images/LevelSurvey2.jpg')
		InitialFetch("../MWW_Style/Design_Style.xsl","MWRG_content/Design_Text.xml",'MainContent')
		ChexDisclaimer('MainContent')
	break;
case 916: //Main Menu Item #11 Testing
		InitialFetch("../MWW_Style/Testing_Style.xsl","MWRG_content/Testing_Text.xml",'MainContent')
		ChexDisclaimer('MainContent')
break;
case 922: //Main Menu Item #12 Groundwater/Stream Data
		InitialFetch('MWW_Style/Stream_metrics_Style.xsl','MWRG_content/Stream_metrics_Text.xml','MainContent')
		ChexDisclaimer('MainContent')
	break;
case 917: //Main Menu Item #13 Trustees & Officers
		InitialFetch("../MWW_Style/Trustees_Style.xsl","MWRG_content/Trustees_Text.xml",'MainContent')
		ChexDisclaimer('MainContent')
	break;
case 918:  //Main Menu Item #14 Patrons & Sponsors
		InitialFetch("../MWW_Style/Sponsors_Style.xsl","MWRG_content/Sponsors_Text.xml",'MainContent')
		ChexDisclaimer('MainContent')
	break;
case 330:  //Main Menu Item #15 Useful Links
		InitialFetch("../MWW_Style/Links_style.xsl","MWRG_content/Websites.xml",'MainContent')
		ChexDisclaimer('MainContent')
	break;
case 919: //Main Menu Item #18 Poets Corner
		InitialFetch("../MWW_Style/PoetsCorner.xsl","MWRG_content/PoetsCorner_text.xml",'MainContent')
		ChexDisclaimer('MainContent')
	break;
case 111:
		InitialFetch("../MWW_Style/PictureGallery_2.xsl","../MWRG_content/PictureGallery_2.xml",'MainContent')
		ChexDisclaimer('MainContent')
		Album_2(111)
		break;
case 12:
	DivResize('FlowMessage',55,425,570)
		makeRequest('../MWRG_content/Chronicle/Video_FrontPage.xsl','FlowMessage')
	break;

case 123:
			DivResize('FlowMessage',55,460,620)
		makeRequest('../MWRG_content/Chronicle/Video_HistoryPage.xsl','FlowMessage')
	break;
case 125:
		DivResize('FlowMessage',47,420,570)
		makeRequest('../MWRG_content/Chronicle/Video_AsItIsNowPage.xml','FlowMessage')
	break;
case 126:
		DivResize('FlowMessage',55,450,580)
		makeRequest('../MWRG_content/Chronicle/Video_TrusteesPage.xml','FlowMessage')
	break;
case 925:
	
	
	//makeRequest('../MWW_Style/TermsOfUse_Style.xml','MainContent')
	InitialFetch('../MWW_Style/TermsOfUse_Style.xsl','../MWRG_content/TermsOfUse_Text.xml','MainContent')
		ChexDisclaimer('MainContent')
	break;
case 927:
	
	
	//makeRequest('../MWW_Style/TermsOfUse_Style.xml','MainContent')
	InitialFetch('../MWW_Style/TermsOfUse_Style.xsl','../MWRG_content/TermsOfUse_Text.xml','MainContent')
		ChexDisclaimer('MainContent')
	break;
case 1000:
	
NewPage('http://www.maidenheadwaterways.org/UserAuthority/protectionFMJ.php')	
	break;


default :NewPage('http://www.maidenheadwaterways.org/index.html')
}
};

function ddrivetip(thetext ){//if (PostMail==1){thetext=1000}
clearTimeout(blinkoff)
switch (thetext){
case 6:
var pix='&nbsp; Associate with The&nbsp; IWA '
var getphrase='&nbsp; Campaigning for the conservation   &nbsp;'
var secondphrase=' &nbsp; use, maintenance, restoration and  &nbsp;'
var thirdphrase=' &nbsp; development of inland waterways &nbsp;'
break;
case 7:
var pix='&nbsp; &nbsp; Kennet &amp; Avon, Reading way'
var getphrase='&nbsp; Major restoration completed in 2003 funded &nbsp;'
var secondphrase=' &nbsp;  by Heritage Lottery Fund - 25 million  &nbsp;'
var thirdphrase=''
break;
case 8:
pix=' &nbsp; Socially, Our River &nbsp; &nbsp;'
var getphrase='&nbsp; Caring for your river. &nbsp;'
var secondphrase=' &nbsp;   &nbsp;'
var thirdphrase=''
break;
case 9:
pix=' &nbsp; The IWAC adviseth us'
var getphrase='&nbsp; Advises Government, navigation authorities <br>and others on the use and'
var secondphrase='  development of the inland waterways.'
var thirdphrase=''
break;
case 10:
pix='&nbsp; Go glide with BW and see the countryside &nbsp;'
var getphrase='&nbsp;  Maintaining 2,000 miles (3,220km) of inland waterways &nbsp;'
var secondphrase=' &nbsp; for use in a range of leisure activities.  &nbsp;'
var thirdphrase=''
break;
case 11:
pix= " &nbsp; It's Official, Visit the Thames &nbsp;"
var getphrase="&nbsp;  Discover the River Thames &nbsp;"
var secondphrase='&nbsp; The Environmental Agencys Official&nbsp;'
var thirdphrase=' &nbsp; guide to enjoying the river'
break;
case 12:
pix=' &nbsp; Our Civil Society.'
var getphrase='&nbsp;  Improving the local environment  &nbsp;'
var secondphrase='&nbsp; and facilities in Maidenhead. &nbsp;'
var thirdphrase=' &nbsp; '
break;
case 13:
pix=' &nbsp; Take a Trip Down Memory Lane &nbsp;'
var getphrase='&nbsp;Celebrating the past and  understanding &nbsp;'
var secondphrase='&nbsp;Maidenhead and its surroundings.&nbsp;'
var thirdphrase=' &nbsp; '
break;
case 14:
pix=" &nbsp; The Rowers' Hangout &nbsp;"
var getphrase='&nbsp;The Rowing Club was established  &nbsp;'
var secondphrase='&nbsp;in 1876 and supports rowing for all.&nbsp;'
var thirdphrase=' &nbsp;'
break;
case 15:
pix=" &nbsp; The Sailers'  Hangout &nbsp;"
var getphrase='&nbsp;51 acres of sailing for 52 weeks  &nbsp;'
var secondphrase='&nbsp;of the year at their lake  in &nbsp;'
var thirdphrase=' &nbsp; Summerleaze Road, Maidenhead.'
break;
case 16:
pix=' &nbsp; Unofficially, Vist the Thames &nbsp;'
var getphrase='&nbsp;A guide to what the Thames and &nbsp;'
var secondphrase='&nbsp;surrounding areas have to offer &nbsp;'
var thirdphrase=' &nbsp;'
break;
case 17:
pix=' &nbsp; Muse Over the Old Times &nbsp;'
var getphrase='&nbsp;At Henley riverside it includes &nbsp;'
var secondphrase='&nbsp;Wind in the Willows Exhibition&nbsp;'
var thirdphrase=' &nbsp;'
break;
case 18:
pix=' &nbsp; Walking on water ?'
var getphrase='&nbsp;Thames riverside walks. &nbsp;'
var secondphrase='&nbsp;&nbsp;'
var thirdphrase=' &nbsp;'
break;
case 19:
pix=' &nbsp; RBWM &nbsp;The Council &nbsp;'
var getphrase="&nbsp; Royal  Borough's guide to services &nbsp;"
var secondphrase='&nbsp;&nbsp;'
var thirdphrase=' &nbsp;'
break;
case 20:
pix=' &nbsp;Take the dog to&nbsp;Braywick Park &nbsp;'
var getphrase='&nbsp; Maidenhead nature centre &nbsp; <br>&nbsp;by the Green Walk at Bray'
var secondphrase='&nbsp;&nbsp;'
var thirdphrase=' &nbsp;'
break;
case 21:
pix=' &nbsp;The Thames Flows Smoothly&nbsp;'
var getphrase='&nbsp; A historic walkthrough and <br>A history of the Maidenhead bridge'
var secondphrase='&nbsp;&nbsp;'
var thirdphrase=' &nbsp;'
break;
default: 
var getphrase="whow! maybe we made a mistake here"
var secondphrase='&nbsp; '
var thirdphrase=' &nbsp; '
}
var tbs='<table cellpadding="1" cellspacing="1" style="border-top: 1px solid #CCCCCC; border-right: 1px solid #999999;border-bottom: 1px solid #999999;border-left: 1px solid #CCCCCC;"><tr><td class="horizontalRule"><img src="../MWW_images/spacer.gif" width="1" height="1" alt="" border="0"></td></tr><tr><td height="20" style="background-color: #ACDBE3" class="soustitre">'+pix+'</td ></tr><tr><td bgcolor="lightyellow" class="CallBar">'+getphrase+'</td></tr><tr><td bgcolor="lightyellow" class="CallBar">'+secondphrase+'</td></tr><td bgcolor="lightyellow" class="CallBar">'+thirdphrase+'</td></tr><tr><td class="horizontalRule"><img src="../MWW_images/spacer.gif" width="1" height="1" alt="" border="0"></td></tr></table>'
tipobj=document.getElementById('dhtmltooltip') 
tipobj.innerHTML=tbs
enabletip=true
blinkoff=setTimeout(' hideddrivetip()',5000)
}

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function positiontip(e){
if (enabletip){
var curX= (ns6) ?e.pageX : event.clientX+ietruebody().scrollLeft;
var curY= (ns6) ?e.pageY : event.clientY+ietruebody().scrollTop;
//Find out how close the mouse is to the corner of the window
var rightedge=ie&&!window.opera? ietruebody().clientWidth-event.clientX-offsetxpoint : window.innerWidth-e.clientX-offsetxpoint-20
var bottomedge=ie&&!window.opera? ietruebody().clientHeight-event.clientY-offsetypoint : window.innerHeight-e.clientY-offsetypoint-20

var leftedge=(offsetxpoint<0)? offsetxpoint*(-1) : -1000
//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<tipobj.offsetWidth)
//move the horizontal position of the menu to the left by it's width
tipobj.style.left=ie? ietruebody().scrollLeft+event.clientX-tipobj.offsetWidth+"px" : window.pageXOffset+e.clientX-tipobj.offsetWidth+"px"
else if (curX<leftedge)
tipobj.style.left="5px"
else
//position the horizontal position of the menu where the mouse is positioned
tipobj.style.left=curX+offsetxpoint+"px"

//same concept with the vertical position
if (bottomedge<tipobj.offsetHeight)
tipobj.style.top=ie? ietruebody().scrollTop+event.clientY-tipobj.offsetHeight-offsetypoint+"px" : window.pageYOffset+e.clientY-tipobj.offsetHeight-offsetypoint+"px"
else
tipobj.style.top=curY+offsetypoint+"px"
tipobj.style.visibility="visible"
}
}

function hideddrivetip(){
if (ns6||ie){
enabletip=false
tipobj.style.visibility="hidden"
tipobj.style.left="-1000px"
tipobj.style.backgroundColor=''
tipobj.style.width=''
}
}

// *********************************************  Cookie World portion **************************************//
function makeQuery(URLpix,target) {
if (window.ActiveXObject) {
  		link = new ActiveXObject("Microsoft.XMLHTTP");
 	} else if (window.XMLHttpRequest) {
  		link = new XMLHttpRequest()
 	}
 	if (link == undefined) {return false}
link.onreadystatechange =function() { Flowresponse(target)}
link.open("GET",URLpix, true)
link.send(null)
}
function checkReadyState(link){
 if(link.readyState == 4)  {
    if(link.status == 200)  {
      return true;  }
    else { alert("Problem retrieving data link.readyState "+link.readyState +" link.status "+link.status + " "+URLpix );
    }
  }
}
function Flowresponse(target) {
if(checkReadyState(link)) {
AnounceNews(target)	
	
//document.getElementById(target).innerHTML = link.responseText
//document.getElementById(target).style.visibility='visible'
};}

function AnounceNews(target){
TriggerDate=link.responseText.slice(link.responseText.indexOf("<LowerMargin_right>")+19,link.responseText.indexOf("</LowerMargin_right>"))
var announce="<img src='../MWW_images/Flow.jpg' width='287' height='160' align='middle'><BR><a class='topline' 	onMouseDown=PageOpener('../MWW_PDF/CurrentFlow.pdf') href='javascript:void(0)'>"+TriggerDate+" Flow newsletter on menu now as Current Flow Letter</a>" 
if (navigator.cookieEnabled) { 
if (Get_Cookie('MWRG') )
		if (document.cookie.length>0){
			if (TriggerDate!=Get_Cookie('MWRG')){
			document.getElementById(target).innerHTML  =announce
			DivOn("FlowMessage")
			flashoff=setTimeout('DivHide("FlowMessage")',10000)
			Set_Cookie('MWRG', TriggerDate, 60, '/', '', '' )
			}else {
					Set_Cookie( 'MWRG', TriggerDate, 60, '/', '', '' )
			}

	}else {Set_Cookie( 'MWRG', "1Jan2009", 60, '/', '', '' )  }
}


};


// createCookie("MWRGgroup",1,1)name="MWRGgroup",value=1,days=1
/*function Set_Cookie( name, value, expires, path, domain, secure ) {
	// set time, it's in milliseconds
	
	var today = new Date();
	today.setTime( today.getTime() );
	// if the expires variable is set, make the correct expires time, the
	// current script below will set it for x number of days, to make it
	// for hours, delete * 24, for minutes, delete * 60 * 24
	if ( expires )
	{
		expires = expires * 1000 * 60 * 60 * 24;
	}
	//alert( 'today ' + today.toGMTString() );// this is for testing purpose only
	var expires_date = new Date( today.getTime() + (expires) );
	//alert('expires ' + expires_date.toGMTString());// this is for testing purposes only

	document.cookie = name + "=" +escape( value ) +
		( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + //expires.toGMTString()
		( ( path ) ? ";path=" + path : "" ) + 
		( ( domain ) ? ";domain=" + domain : "" ) +
		( ( secure ) ? ";secure" : "" );
}

// this deletes the cookie when called
function Delete_Cookie( name) {
	if ( Get_Cookie( name ) ) document.cookie = name + "=" +
			( ( path ) ? ";path=" + path : "") +
			( ( domain ) ? ";domain=" + domain : "" ) +
			";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}
/*function Get_Cookie( check_name ) {
	// first we'll split this cookie up into name/value pairs
	// note: document.cookie only returns name=value, not the other components
	var a_all_cookies = document.cookie.split( ';' );
	var a_temp_cookie = '';
	var cookie_name = '';
	var cookie_value = '';
	var b_cookie_found = false; // set boolean t/f default f
	
	for ( i = 0; i < a_all_cookies.length; i++ )
	{
		// now we'll split apart each name=value pair
		a_temp_cookie = a_all_cookies[i].split( '=' );
		
		
		// and trim left/right whitespace while we're at it
		cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');
	
		// if the extracted name matches passed check_name
		if ( cookie_name == check_name )
		{
			b_cookie_found = true;
			// we need to handle case where cookie has no value but exists (no = sign, that is):
			if ( a_temp_cookie.length > 1 )
			{
				cookie_value = unescape( a_temp_cookie[1].replace(/^\s+|\s+$/g, '') );
			}
			// note that in cases where cookie is initialized but no value, null is returned
			
			return cookie_value;
			break;
		}
		a_temp_cookie = null;
		cookie_name = '';
	}
	if ( !b_cookie_found )
	{
		return null;
	}
}				
// this deletes the cookie when called
// remember, these are the possible parameters for Set_Cookie:
// name, value, expires, path, domain, secure

var visits = 0;

//function extractCookieValue(val) {
//  if ((endOfCookie = document.cookie.indexOf(";", val)) == -1) {
 //    endOfCookie = document.cookie.length;
 // }
 // return unescape(document.cookie.substring(val,endOfCookie));
//}


//function ReadCookie(cookiename) {
//  var numOfCookies = document.cookie.length;
 // var nameOfCookie = cookiename + "=";
//  var cookieLen = nameOfCookie.length;
//  var x = 0;
//  while (x <= numOfCookies) {
 //       var y = (x + cookieLen);
 //       if (document.cookie.substring(x, y) == nameOfCookie)
  //         return (extractCookieValue(y));
   //        x = document.cookie.indexOf(" ", x) + 1;
   //        if (x == 0){
    //          break;
      //     }
  //

//function createCookie(name, value, expiredays) {
//  var todayDate = new Date();
//  todayDate.setDate(todayDate.getDate() + expiredays);
//  document.cookie = name + "=" + value + "; expires=" +todayDate.toGMTString() + ";"
//}


/*
Script Name: Javascript Cookie Script
Author: Public Domain, with some modifications
Script Source URI: http://techpatterns.com/downloads/javascript_cookies.php
Version 1.1.1
Last Update: 4 October 2007

Changes:
1.1.1 fixes a problem with Get_Cookie that did not correctly handle case
where cookie is initialized but it has no "=" and thus no value, the 
Get_Cookie function generates a NULL exception. This was pointed out by olivier, thanks

1.1.0 fixes a problem with Get_Cookie that did not correctly handle
cases where multiple cookies might test as the same, like: site1, site

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
*/

// this fixes an issue with the old method, ambiguous values 
// with this test document.cookie.indexOf( name + "=" );

// To use, simple do: Get_Cookie('cookie_name'); 
// replace cookie_name with the real cookie name, '' are required
function Get_Cookie( check_name ) {
	// first we'll split this cookie up into name/value pairs
	// note: document.cookie only returns name=value, not the other components
	var a_all_cookies = document.cookie.split( ';' );
	var a_temp_cookie = '';
	var cookie_name = '';
	var cookie_value = '';
	var b_cookie_found = false; // set boolean t/f default f
	
	for ( i = 0; i < a_all_cookies.length; i++ )
	{
		// now we'll split apart each name=value pair
		a_temp_cookie = a_all_cookies[i].split( '=' );
		
		
		// and trim left/right whitespace while we're at it
		cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');
	
		// if the extracted name matches passed check_name
		if ( cookie_name == check_name )
		{
			b_cookie_found = true;
			// we need to handle case where cookie has no value but exists (no = sign, that is):
			if ( a_temp_cookie.length > 1 )
			{
				cookie_value = unescape( a_temp_cookie[1].replace(/^\s+|\s+$/g, '') );
			}
			// note that in cases where cookie is initialized but no value, null is returned
			return cookie_value;
			break;
		}
		a_temp_cookie = null;
		cookie_name = '';
	}
	if ( !b_cookie_found ) 
	{
		return null;
	}
}

/*
only the first 2 parameters are required, the cookie name, the cookie
value. Cookie time is in milliseconds, so the below expires will make the 
number you pass in the Set_Cookie function call the number of days the cookie
lasts, if you want it to be hours or minutes, just get rid of 24 and 60.

Generally you don't need to worry about domain, path or secure for most applications
so unless you need that, leave those parameters blank in the function call.
*/
function Set_Cookie( name, value, expires, path, domain, secure ) {
	// set time, it's in milliseconds
	var today = new Date();
	today.setTime( today.getTime() );
	// if the expires variable is set, make the correct expires time, the
	// current script below will set it for x number of days, to make it
	// for hours, delete * 24, for minutes, delete * 60 * 24
	if ( expires )
	{
		expires = expires * 1000 * 60 * 60 * 24;
	}
	//alert( 'today ' + today.toGMTString() );// this is for testing purpose only
	var expires_date = new Date( today.getTime() + (expires) );
	//alert('expires ' + expires_date.toGMTString());// this is for testing purposes only

	document.cookie = name + "=" +escape( value ) +
		( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + //expires.toGMTString()
		( ( path ) ? ";path=" + path : "" ) + 
		( ( domain ) ? ";domain=" + domain : "" ) +
		( ( secure ) ? ";secure" : "" );
}

// this deletes the cookie when called
function Delete_Cookie( name, path, domain ) {
	if ( Get_Cookie( name ) ) document.cookie = name + "=" +
			( ( path ) ? ";path=" + path : "") +
			( ( domain ) ? ";domain=" + domain : "" ) +
			";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}
