function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
var V4LvlA="v4Lvlcontent1",V4LvlT;
function V4LvlScroll(d,s,o,n){ //v1.0 4LevelWebs
 var q,x,p="",r=parseInt(n),u=parseInt(o),k=document.layers;if(!k){p="px"}if((x=MM_findObj(V4LvlA))!=null){q=(document.layers)?x:x.style}
 var c=clearTimeout(V4LvlT),j=d==5&&!k?u:0,h=k?parseInt(x.clip.height):parseInt(x.offsetHeight);
 var v=parseInt(s),f=10,y=q.top?parseInt(q.top):j;if(d==6){if(y<o){q.top=y+u+p;if(-y<o||y>=0){q.top=0}}}else
 if(d==7){if(-y<h){q.top=y-n+p;if(-y+r>h-n){q.top=-h+r+p}}}else{if(d==1&&y<r){q.top=y+v+p}if(d==2&&y>-h+u){q.top=y-v+p}
 if(d==3){q.top=0}if(d==4){q.top=-h+u+p}if(d==5){f=15;if(y>-h){q.top=y-v+p}if(y==-h){q.top=o+p}}
 if(d==8){q.top=y<0?y+v+p:y>v?y-v+p:0}if(d==10&&y>-h+u){q.top=y-v+p}
 V4LvlT=setTimeout("V4LvlScroll('"+d+"','"+s+"','"+o+"','"+n+"')",f)}
}
// START of POPUP HELP CODE -->

var hmsg = new Array();

hmsg["news"] = new helpmsg(
"Scrolling News", "fancyheader", "plain", "<BR>To use the scrolling news there are a set of 3 controls on the right hand side of the news section. To scroll the news UP move your mouse pointer over the lower arrow. To scroll DOWN move the pointer over the up arrow.<br><br>If you want to pause the scrolling simply move the mouse pointer away from the buttons. Move back to continue. To reset the news to the start click the top button.");

hmsg["delivery"] = new helpmsg(
"Prescription Deliveries", "fancyheader", "plain", "<BR>Please choose a delivery location most convenient for your repeat prescription to be collected. Deliveries to the Post Offices at Baston, Langtoft, Morton and Thurlby can ONLY be made for elderly and infirm patients as this service is a limited service. <BR><BR>If a prescription is not exempt from payment,and you live more than a mile from Bourne then please arrange for collection from the Practice dispensary. <BR>Thank you!");

var myPopup = new helpbox("myPopup", hmsg, 450,280, "#ffffff");

// 350 is the width of the popup box
// 320 is the height of the popup box
// "#ffffff" is the color of the popup box


function helpmsg(header, hstyle, mstyle, message) {
this.DEFAULTHSTYLE = "plain";
this.DEFAULTMSTYLE = "plain";

this.header = header;
if (hstyle) this.hstyle = hstyle;
else this.hstyle = this.DEFAULTHSTYLE;
this.message = message;
if (mstyle) this.mstyle = mstyle;
else this.mstyle = this.DEFAULTMSTYLE;
return this;
}
new helpmsg();
helpmsg.prototype.show = show;

function show() {
var H = "<FONT FACE='arial'>" + this.header + "</FONT>";
if (this.hstyle == "h1") H = "<H1>" + H + "</H1>";
else if (this.hstyle == "h2") H = "<H2>" + H + "</H2>";
else if (this.hstyle == "h3") H = "<H3>" + H + "</H3>";
else if (this.hstyle == "h4") H = "<H4>" + H + "</H4>";
if (this.hstyle == "fancyheader") H = "<table width='75%'>" +
"<tr><td bgcolor='#99CCFF' align='center' valign='center'>" +
"<H4><FONT COLOR='white'>" + H +
"</FONT></H4>" + "</td></tr></table>";
else if (this.hstyle == "italics")
H = "<I>" + H + "</I>";

var M = "<FONT FACE='arial' SIZE='2' text-align='justify' color='333399'>" + this.message + "</FONT>";
if (this.mstyle == "plain") {}
if (this.mstyle == "italics") M = M.italics();
else if (this.mstyle == "bold") M = M.bold();
var htmlpage = "";
if (this.hstyle.indexOf("header")>=0)
htmlpage = H + M;
else htmlpage = H + "<BR>" + M;
return htmlpage;
}

function helpbox(name, hm, width, height, bgcolor) {
this.name = name;
this.helpmessage = hm;
this.timerHandle = null;
this.windowHandle = null;
this.DEFAULTWIDTH = 250;
this.DEFAULTHEIGHT = 150;
this.DEFAULTBGCOLOR = "#ffffcc";
this.POPUPDELAY = 100;
if (width) this.width = width;
else this.width = this.DEFAULTWIDTH;
if (height) this.height = height;
else this.height = this.DEFAULTHEIGHT;
if (bgcolor) this.bgcolor = bgcolor;
else this.bgcolor = this.DEFAULTBGCOLOR;
return this;
}
function startHelp(msgindex) {
var cmdstr="top." + this.name + ".showHelp('" + msgindex + "')";
this.timerHandle = setTimeout(cmdstr, this.POPUPDELAY);
}
function showHelp(msgindex) {
if (!this.windowHandle || !this.windowHandle.name || this.windowHandle.name=="")
this.windowHandle = window.open(
"", 
"subWindow", 
"toolbar=no," +
"location=no," +
"directories=no," +
"status=no," +
"menubar=no," +
"scrollbars=no," +
"resizable=no," +
"width=" + this.width + "," +
"height=" + this.height
);
else
this.windowHandle.focus();
this.windowHandle.document.open();
var to_page =
"<HTML>\n" +
"<BODY BGCOLOR='" + this.bgcolor + "'><P>" +
this.helpmessage[msgindex].show() +
"</BODY></HTML>\n";
this.windowHandle.document.write(to_page);
this.windowHandle.document.close();
}
function clearHelp() {
clearTimeout(this.timerHandle);
if (this.windowHandle && this.windowHandle.name) {
this.windowHandle.close();
this.windowHandle=null;
   }
}
new helpbox();
helpbox.prototype.startHelp = startHelp;
helpbox.prototype.showHelp = showHelp;
helpbox.prototype.clearHelp = clearHelp;
// End of POPUP HELP CODE -->