//<!-- 

// Contents of this js file
// Determine Browser and set Vars ms34 & ms44
// Set window focus and set Play if running on www and not from PC
// Various Openwin and gopage functions
// Image Changes and image pre-load
// Status Line Scrolling
// Display Directory Enquiries/Secretary links
// Display print page text if ms44
// Display reload text if ms34

//------------------------------------------------------------------------------------------
//Determine Browser and set Vars ms34 & ms44

var browser = "";
if (navigator.appName.lastIndexOf('Netscape') != -1) browser = "netscape";
if (navigator.appName.lastIndexOf('Explorer') != -1) browser = "explorer";

var version = 0;
if (browser == "netscape") version = unescape(navigator.appVersion.charAt(0));
var msie = navigator.appVersion.lastIndexOf("MSIE") + 5;
if (browser == "explorer") version = unescape(navigator.appVersion.charAt(msie));
if (browser=="")
{
	browser = "explorer";
	version="3";
}
if ((browser == "netscape" && version > 2) ||(browser == "explorer" && version > 3))
	ms34 = true;
else
	ms34 = false;

if ((browser == "netscape" && version > 3) ||(browser == "explorer" && version > 3))
	ms44 = true;
else
	ms44 = false;

//------------------------------------------------------------------------------------------
// Set var Play if running on www and not from PC
// (restricts some www links from running whilst testing off line)
// (also used to prevent some processing being repeated by passing a ? parameter when)
// (returning to home page or a previous page)

var play = false;
var u = "" + window.location;
if ((u.indexOf('?') ==-1) && (u.indexOf('file:///') !=0)) play = true;

// Set focus to current window

if (ms34) {window.focus();}

//------------------------------------------------------------------------------------------
//Functions (Openwin variants and gopage)

function openwin(url,name)
{
	window.open(url, name);
}
function openwinltd(url,name) 
{
	window.open(url, name,"scrollbars=yes,resizeable=yes,resize=yes");
}

function openwinhw(url,name,ht,wd) 
{
	window.open(url,name,"scrollbars=yes,resizeable=yes,resize=yes,height=" + ht + ",width="+wd);
}

function openwinsec()
{
	openwinhw('club_committee_sec.htm','secr',450,350);
}
function openwinchat()
{
	openwinhw('member_chat_room.htm','chatroom',675,650)
}
function openwinbt()
{
	openwin('http://www.bt.com/phonenetuk','direnq');
}
function gopage(pgname) 
{
	window.location = pgname;
}

//------------------------------------------------------------------------------------------
// Image Changes and image pre-load

function picpreload(picture)
{
	temppic= new Image();
	temppic.src = picture;
}

function picswap(picname,picsrc)
{
	if (ms34)
	{
	eval("document."+picname+".src=\""+picsrc+"\"");
	}
}

//------------------------------------------------------------------------------------------
// Status Line Scrolling

var scroll=true;
function ScrollMessage()
{
	currmsg = msg.substring(pos, msg.length) + msg.substring(0, pos);
	if (scroll) window.status = currmsg
	else
	window.status = msg;
	pos++;
	if (pos > msg.length) pos = 0;
	if (scroll) window.setTimeout("ScrollMessage()",speed);
}

function ScrollOver(linkname)
{
	tempmsg=currmsg;
	pos=0;
	msg=linkname;
	scroll=false;
}

function ScrollOut()
{
	msg=tempmsg;
	scroll=true;
	ScrollMessage();
}
//------------------------------------------------------------------------------------------
// Display BT Directory Enquiries/Secretary Links

function display_direnq()
{
	document.write('<p align="center"><font size="4"><strong>');
	document.write('For full contact details (Address/Tel no.) <br>please try ');
	document.write('<a href="javascript:openwinbt()">Directory Enquiries</a>');
	document.write(' or contact the <a href="javascript:openwinsec()">Club Secretary</a>.');
	document.write('</strong></font></p>');
}
//------------------------------------------------------------------------------------------
// Display print page text if ms44

function pageprint()
{
	if (ms44)
	{
	document.write('<a href="javascript:window.print()">');
	document.write('<strong>Click here to print</strong></a>');
	}
}
//------------------------------------------------------------------------------------------
// Display reload text if ms34

function pagereload()
{
	if (ms34)
	{
	document.write('<a href="javascript:location.reload()">');
	document.write('<strong>Click here to reload page</strong></a>');
	}
}


//This code © 1999 The Papillon (Butterfly Dog) Club
//-->