
/* ====================================================
General Site variables script
==================================================== */

pagelink		= document.location
pagename		= document.title
siteUrl			= 'www.outside.co.uk'
developer		= 'Peaknet Limited'
developerurl		= 'www.outside.co.uk'
defaultStatus		= siteUrl + ' - Outside LTD - Britain\'s BEST Mountain and Climbing Stores'
mailTitle		= siteUrl + ' - ' + pagename + ' : ' + pagelink

recRes			= "1024 x 768"


/* ====================================================
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()
	{
	alert('This opens a new Email message for you to send to friends ...');
	window.location='mailto:?subject=' + mailTitle
	}

/* ====================================================
Previous Page
==================================================== */

function previous() { history.go(-1); }

/* ====================================================
Rollover (generic)
==================================================== */

function roll(obj,toStyle)
{
obj.className=toStyle;
}

function classLess(obj)
{
obj.className='';
}


/* ====================================================
Display Page Title
==================================================== */

function title() { document.write(document.title); }


/* ====================================================
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); }

/* ====================================================
Hide "Loading" message
==================================================== */

function hideLoad()

{
document.getElementById('loading')
loading.style.display='none';
}

/* ====================================================
Hi-Lite FORM FIELDS
==================================================== */

function hi(field)	{ field.className = 'hilite'; }
function lo(field)	{ field.className = 'lolite'; }



function openCart()
{
document.getElementById('cart').style.display='none';
document.getElementById('cartopen').style.display='block';
}

function shutCart()
{
document.getElementById('cartopen').style.display='none';
document.getElementById('cart').style.display='block';
}


function format2dp(value)
{
	if(value == 0)
	{
		return '0.00';
	}
	var tmpValue  = String(parseInt((value + .005) * 100));
	var intLength = tmpValue.length;
	return tmpValue.substring(0, intLength-2) + '.' + tmpValue.substr(intLength-2, 2);
}


function reClass(obj,toClass)
{
obj.className=toClass;
}

/* ====================================================
Terms and Conditions checkbox checker!
==================================================== */

function checkTerms(currentChoice)
{
if (currentChoice == 'acceptedTerms')
	{
	document.getElementById('checkoutButtonFaded').style.display='none';
	document.getElementById('checkoutButton').style.display='inline';
	alert('Thank you for agreeing to our Terms and Conditions!\n\nYou may now proceed by clicking on the Go to Checkout button.\n\noutside.co.uk');
	}
	
	else if (currentChoice = 'rejectedTerms')
		{
		document.getElementById('checkoutButtonFaded').style.display='inline';
		document.getElementById('checkoutButton').style.display='none';
		alert('Sorry, but you *must* agree to our Terms and Conditions in order to complete this order.\n\noutside.co.uk');
		}
	
}