
/* ====================================================
General Site variables script
==================================================== */

pagelink		= document.location
pagename		= document.title
developer		= 'Peaknet Limited'
developerurl		= 'www.service-call.net'
defaultStatus		= developerurl
menuname		= 'Service-Call'
mainname		= 'Good morning and welcome to Service-Call.net'
sidename		= 'Useful Pages'


/* ====================================================
Detect Browser and pick style sheet
==================================================== */

// LOCAL or LIVE, ROOT or INNER page ?

if ((location.protocol=="file:") && (pagetype==0))

{ root_path = "./"	} else if (location.protocol=="file:" && pagetype==1)
{ root_path = "../"	} else
{ root_path = "/"	}

gfx_path = root_path + "gfx/"


if (navigator.appName == "Netscape") { document.write('<LINK REL="STYLESHEET" HREF="' + root_path + 'nn.css">') }

else { }



/* ====================================================
Left menu rollover script
==================================================== */

function mON(slot)	{ slot.className='slotON';	}
function mOFF(slot)	{ slot.className='slot';	}

/* ====================================================
SUB menu rollover script
==================================================== */

function sON(slot)	{ slot.className='subslotON';	}
function sOFF(slot)	{ slot.className='subslot';	}


/* ====================================================
Bookmark / Add to Favorites script
==================================================== */

function bookmark()

{ 
if (window.external) { external.AddFavorite(pagelink,pagename) }
	
else if (navigator.appName == "Netscape") 	{ alert('press control and D now to bookmark this page') }
else if (navigator.appName == "Opera") 		{ alert('press control and T now to bookmark this page') }
}


/* ====================================================
Send page to friend
==================================================== */

function sendlink() { window.location='mailto:?subject=service-call.net&body=' + pagename + ' : ' + pagelink }

/* ====================================================
Previous Page
==================================================== */

function previous() { history.go(-1); }

/* ====================================================
Display Page Title
==================================================== */

function title() { document.write(document.title); }


/* ====================================================
Pulldown MENU functions
==================================================== */

function channel_select()

{
  	selected=document.channels.channel_list.value;
	loc='http://dev100.peaknet.ltd.uk' + selected;
	window.open(loc, '_self')
}

function feature_select() {
  	selected=document.features.feature_list.value;
	loc='http://dev100.peaknet.ltd.uk' + selected;
	window.open(loc, '_self')
}


/* ====================================================
Print Today's DATE function - Y2K + Netscape friendly
==================================================== */

var months=new Array(13);

months[1]	= "January";
months[2]	= "February";
months[3]	= "March";
months[4]	= "April";
months[5]	= "May";
months[6]	= "June";
months[7]	= "July";
months[8]	= "August";
months[9]	= "September";
months[10]	= "October";
months[11]	= "November";
months[12]	= "December";

var time=new Date();
var lmonth=months[time.getMonth() + 1];
var date=time.getDate();
var year=time.getYear();
if (year < 2000)
year = year + 1900;

function today() { document.write(lmonth + " " + date); }

rightmenuname		= lmonth + " " + date


/* ====================================================
StatusText function
==================================================== */

function say(something)

{
self.status=(something);
}


/* ====================================================
Roll Over F/X
==================================================== */

function hi(gfx)

{
orig = gfx.src
gfx.src = root_path + "gfx/hi/" + gfx.name + ".gif"
}

function lo(gfx)

{
gfx.src = orig
}

function go(gfx)

{
gfx.src = root_path + "gfx/go/" + gfx.name + ".gif"
}


/* ====================================================
Alert if NO title set
==================================================== */

if (document.title == 'page title')

{
alert('NO proper title set!');
}

/* ====================================================
Print HOME icon + link
==================================================== */

function home()

{
document.write('<A HREF="' + root_path + 'service-call.html"><IMG SRC="' + root_path + 'gfx/core/home.gif" BORDER="0"></A>')
}

/* ====================================================
DARK functions
==================================================== */

function dark_left()	{ document.write('<P ALIGN="center" STYLE="color: #FFFFFF;">Left!</P>'); }
function dark_head()	{ document.write('<P ALIGN="center" STYLE="color: #FFFFFF;">middle!</P>'); }
function dark_right()	{ document.write('<P ALIGN="center" STYLE="color: #FFFFFF;">Right!</P>'); }

/* ====================================================
Hi-Lite FORM FIELDS
==================================================== */

function hi(field)	{ field.className = 'hilite'; }
function lo(field)	{ field.className = 'lolite'; }


function ID(bar)	{ self.status=bar; }


/* ====================================================
ShowCart
==================================================== */

function showcart()
{
//var cart_window = window.open ("psShowCart.htm","shopping_cart","toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=0,height=400,width=550");
//var cart_window = window.open ("psShowCart.htm","shopping_cart","toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=0,height=400,width=550");
}



/* ====================================================
Sign up form checker
==================================================== */

function signUp()
{
if (document.subscribe.email.value != '' && document.subscribe.email.value != ' ' && document.subscribe.email.value != 'Enter an email address...')
	{
	alert('Click OK to add: ' +document.subscribe.email.value+ ' to our database.');
	document.subscribe.submit()
	}

else alert('Please enter a valid email address..'); document.subscribe.email.className='signUpEmailError'; document.subscribe.email.focus();
}



/* ====================================================
Check for location info on siteDetail.htm
==================================================== */

function checkLoc()
{
var siteLocation = document.getElementById('siteLoc').innerText

if (siteLocation == '')
	{
	document.getElementById('noPosition').className='visible';
	}
}
