//<!-- 

// Contents of this js file
// Determine Browser and set Vars ms34 & ms44
// get current page location name & store = store last character
// Set window focus
// Start Music window
// 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 & ms_iex
var browser = ""; var version = 0;
var ms_iex = false; 
var ms34 = false; 
var ms44 = false;

if (navigator.appName.lastIndexOf('Netscape') != -1) browser = "netscape";
if (navigator.appName.lastIndexOf('Explorer') != -1) browser = "explorer";
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;

if ((browser == "netscape" && version > 3) ||(browser == "explorer" && version > 3)) ms44 = true;

if (browser == "explorer") ms_iex = true;

//------------------------------------------------------------------------------------------
//get current page location name & store last character
var pap_loc = "" + parent.location;
var pap_loc = pap_loc.toLowerCase();
var pap_loclast=pap_loc.charAt(pap_loc.length-1);

//------------------------------------------------------------------------------------------
// Set focus to current window (if not music window)
if ((ms34) && (pap_loc.indexOf('site_music.htm') ==-1))
{
	window.focus();
}

//------------------------------------------------------------------------------------------
//Functions (Open window 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 openwinhwltd(url,name,ht,wd) 
{
	window.open(url,name,"height=" + ht + ",width="+wd);
}


function gopage(pgname) 
{
	window.location = pgname;
}

//------------------------------------------------------------------------------------------
//special functions (which call open window functions for Secretary, Chat, BT Enquiries, Music)

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 openwinmusic()
// open musc window & then set focus back to calling window
{
	openwinhwltd('site_music.htm','musicplay',300,125)
	if (ms34) {window.focus();}
}
//------------------------------------------------------------------------------------------
// 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 sl_scroll=true;
function ScrollMessage()
{
	currmsg = msg.substring(sl_pos, msg.length) + msg.substring(0, sl_pos);
	if (sl_scroll) window.status = currmsg;
	else
	window.status = msg;
	sl_pos++;
	if (sl_pos > msg.length) sl_pos = 0;
	if (sl_scroll) window.setTimeout("ScrollMessage()",sl_speed);
}

function ScrollOver(linkname)
{
	tempmsg=currmsg;
	sl_pos=0;
	msg=linkname;
	sl_scroll=false;
}

function ScrollOut()
{
	msg=tempmsg;
	sl_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 background music text if internet explorer
// only write mouseover/mouseout text if page = root

function music_text()
{
	if (ms_iex)
	{
		document.write('<a href="javascript:openwinmusic()"');
		if ((pap_loc.indexOf('index.htm') >-1) || (pap_loclast.indexOf('/') >-1) || (pap_loc.indexOf('#guest') >-1))
		{ 
			document.write('onmouseover="javascript:ScrollOver(this.href);return true"');
			document.write('onmouseout="javascript:ScrollOut();return true"');
		}
		document.write('>Background music </a>');
		document.write('<img src="images/anim_new.gif" width="32" height="24" alt="new">');
	}
}
//------------------------------------------------------------------------------------------
// 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-2006 The Northern and Eastern Counties Papillon Club
//-->