

/*----------------------------------
ATBBasket_live.js
Version 1.0
September 23 2002
----------------------------------
test system changes
function chkChkout()
function chkPayMethod()
function shopHelp()
-----------------------------------*/
//Remove chkOptions as it is replaced by chkOption
//Remove fspecs as it is replaced by chkOption
netscapeWarn=0
function show_shopMap1()
{}
function show_shopMap()
{
document.writeln("<table width='90' border='1' cellspacing='0' align='center'>")
document.writeln("            <tr>")
document.writeln("              <td><img src='/images/basket_nav.jpg' width='85' height='71' usemap='#shop_cart' border='0' alt='Shop Controls'>")
document.writeln("                <map name='shop_cart'>")
				if (browserOK('s'))
				{
/*
					document.writeln("<area shape='rect' coords='3,3,83,22' href=\"javascript: alert('E-commerce will be upgraded soon')\">")
					document.writeln("<area shape='rect' coords='5,28,85,48' href='javascript: chkChkout()'>")
*/
					document.writeln("<area shape='rect' coords='3,3,83,22' href='http://shop.devercycles.co.uk/index.html?Ywg+dtM0VoJ/bTFfIMqGSKpp4DmibIEnQTo1cSYFUNA='>")
					document.writeln("<area shape='rect' coords='5,28,85,48' href='http://shop.devercycles.co.uk/index.html?Ywg+dtM0VoJ/bTFfIMqGSKpp4DmibIEnQTo1cSYFUNA='>")
                    document.writeln("<area shape='rect' coords='2,54,81,70' href='javascript: shopHelp()'>")

				}else{
					document.writeln("<area shape='rect' coords='3,3,83,22' href='javascript: void browserOK()'>")
					document.writeln("<area shape='rect' coords='5,28,85,48' href='javascript: void browserOK()'>")
                	document.writeln("<area shape='rect' coords='2,54,81,70' href='javascript: void browserOK()'>")

				}
				
document.writeln("                </map>")
document.writeln("              </td>")
document.writeln("            </tr>")
document.writeln("          </table>")
}        
function pageOffset() 
{
	if (document.layers)
	{
		/*if (window.pageYOffset>120){
			document.layers['shopMenu'].pageY = window.pageYOffset -120;
    		document.layers['bikeMenu'].pageY = window.pageYOffset -120;

		}else{
			document.layers['shopMenu'].pageY = 0;
    		document.layers['bikeMenu'].pageY = 0;
			}*/
			document.layers['shopMenu'].pageY = 0;
    		document.layers['bikeMenu'].pageY = 0;
	}
	else
	{
		if (document.all)
		{
		
			if (document.body.scrollTop>120)
			{
    			document.all.shopMenu.style.top = (document.body.scrollTop-120) + 'px'
				document.all.bikeMenu.style.top = (document.body.scrollTop-120) + 'px'
			}
			else
			{
				document.all.shopMenu.style.top = '0px'
				document.all.bikeMenu.style.top = '0px'
			}
		}
		else
		{
		    if (parseInt(navigator.appVersion)>=5 && navigator.appName=="Netscape")
    		{

    		}
		}
	}
    setTimeout('pageOffset()',500);
	
}

//-----------------------------------------------------------------
function chkOptions(idx)
{

var bolS = true
var bolC = true
	if (eval("document.shop.size"+idx+".selectedIndex")==0)
	{
		alert("Please select a size")
		bolS=false
	}
	if (eval("document.shop.colour"+idx+".selectedIndex")==0)
	{
		alert("Please select a colour")
		bolC=false
	}

return (bolC && bolS)
}
//-----------------------------------------------------------------
function chkOption()
{
argc = chkOption.arguments.length;
argv = chkOption.arguments;
if (argc<2)
{
	alert('chkOption: Insufficient Parameters');
	return (false);
}
var bolOK = true

for (c=1;c<argc;c++)
{
	if (findElement(argv[0],argv[c]))
	{
		if (eval("argv[0]."+argv[c]+".type")!="select-one")
		{
			alert('chkOption: Element not a select');
			return(false);
		}

		if (eval("argv[0]."+argv[c]+".selectedIndex") == 0)
		{
			alert("Please select: "+argv[c]);
			bolOK=false;
		}
	}
}

return (bolOK)
}
//------------------------------------------------------------------------------
function findElement(sForm,ename)
{
var bolFound = false;
	for (i=0;i<sForm.elements.length;i++)
	{
		if (sForm.elements[i].name == ename)
		{
			bolFound = true;
		}
	}
return (bolFound);
}
//------------------------------------------------------------------------------
function fSpecs(sForm, iDx)
{
var sSpecs='Size: '+ eval(sForm+'.size'+iDx+'.options['+sForm+'.size'+iDx+'.selectedIndex].value')+' Colour : '+ eval(sForm+'.colour'+iDx+'.options['+sForm+'.colour'+iDx+'.selectedIndex].value')
return (sSpecs)
}
//------------------------------------------------------------------------------
function fSpec()
{
argc = fSpec.arguments.length
argv = fSpec.arguments
if (argc<2)
{
	alert('fSpec: Insufficient Parameters');
	return ("No Options");
}
var sSpec = "";
for (c=1;c<argc;c++)
{

	if (findElement(argv[0],argv[c]))
	{
		if (eval("argv[0]."+argv[c]+".type")!="select-one")
		{
			alert('fSpec: Element not a select');
			return("");
		}
		else
		{
			sSpec += argv[c]+': '+eval("argv[0]."+argv[c]+".options["+"argv[0]."+argv[c]+".selectedIndex].value")+' ';
		}	

	}
}

return (sSpec)
}
//------------------------------------------------------------------------------
function chkChkout()
{
alert('E-Commerce will be upgraded soon')
return
if(bkt.isInOrderValueRange(0) && !bkt.isEmptyBasket())
{
	location.href='https://www.devercycles.co.uk/dever_chkout_live.asp'
}else{
	alert('Minimum order value allowed: £'+bkt.minimumOrderValue)
}
}
//------------------------------------------------------------------------------
function totalOK()
{

if(bkt.isInOrderValueRange(0) && !bkt.isEmptyBasket())
{
	return(true);
}else{
	return(false);
}
}
//------------------------------------------------------------------------------
function toChkout()
{
	location.href='https://www.devercycles.co.uk/dever_chkout_live.asp'
}
//------------------------------------------------------------------------------
function browserOK (sIx)
{
var bolOK=(parseInt(navigator.appVersion)>=4)&&(cookieEnabled()!=null && navigator.appName.indexOf('Microsoft')!=-1) 
if (!bolOK && sIx!='s')
{
	alert("To buy on-line requires Microsoft IE 4 or above\n and Cookies enabled in the browser options.")
	
}
return (bolOK)
}
//------------------------------------------------------------------------------
/* Remove if unsued by 1/11/03
function chkEmail1(strEmail)
{
strEmail = strEmail+""
return(strEmail.search(/^[\w\.\-\_]+@[\w\-]+\.[\w\.\-]+$/)!=-1)
}
*/
//------------------------------------------------------------------------------
<!-- Changes:  Sandeep V. Tamhankar (stamhankar@hotmail.com) -->

/* 1.1.2: Fixed a bug where trailing . in e-mail address was passing
            (the bug is actually in the weak regexp engine of the browser; I
            simplified the regexps to make it work).
   1.1.1: Removed restriction that countries must be preceded by a domain,
            so abc@host.uk is now legal.  However, there's still the 
            restriction that an address must end in a two or three letter
            word.
     1.1: Rewrote most of the function to conform more closely to RFC 822.
     1.0: Original  */

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function chkEmail (emailStr) {
/* The following pattern is used to check if the entered e-mail address
   fits the user@domain format.  It also is used to separate the username
   from the domain. */
var emailPat=/^(.+)@(.+)$/
/* The following string represents the pattern for matching all special
   characters.  We don't want to allow special characters in the address. 
   These characters include ( ) < > @ , ; : \ " . [ ]    */
var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
/* The following string represents the range of characters allowed in a 
   username or domainname.  It really states which chars aren't allowed. */
var validChars="\[^\\s" + specialChars + "\]"
/* The following pattern applies if the "user" is a quoted string (in
   which case, there are no rules about which characters are allowed
   and which aren't; anything goes).  E.g. "jiminy cricket"@disney.com
   is a legal e-mail address. */
var quotedUser="(\"[^\"]*\")"
/* The following pattern applies for domains that are IP addresses,
   rather than symbolic names.  E.g. joe@[123.124.233.4] is a legal
   e-mail address. NOTE: The square brackets are required. */
var ipDomainPat=/^[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})]$/
/* The following string represents an atom (basically a series of
   non-special characters.) */
var atom=validChars + '+'
/* The following string represents one word in the typical username.
   For example, in john.doe@somewhere.com, john and doe are words.
   Basically, a word is either an atom or quoted string. */
var word="(" + atom + "|" + quotedUser + ")"
// The following pattern describes the structure of the user
var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
/* The following pattern describes the structure of a normal symbolic
   domain, as opposed to ipDomainPat, shown above. */
var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")


/* Finally, let's start trying to figure out if the supplied address is
   valid. */

/* Begin with the coarse pattern to simply break up user@domain into
   different pieces that are easy to analyze. */
var matchArray=emailStr.match(emailPat)
if (matchArray==null) {
  /* Too many/few @'s or something; basically, this address doesn't
     even fit the general mould of a valid e-mail address. */
	alert("Email address seems incorrect (check @ and .'s)")
	return false
}
var user=matchArray[1]
var domain=matchArray[2]

// See if "user" is valid 
if (user.match(userPat)==null) {
    // user is not valid
    alert("The E-mail username doesn't seem to be valid.")
    return false
}

/* if the e-mail address is at an IP address (as opposed to a symbolic
   host name) make sure the IP address is valid. */
var IPArray=domain.match(ipDomainPat)
if (IPArray!=null) {
    // this is an IP address
	  for (var i=1;i<=4;i++) {
	    if (IPArray[i]>255) {
	        alert("Destination IP address is invalid!")
		return false
	    }
    }
    return true
}

// Domain is symbolic name
var domainArray=domain.match(domainPat)
if (domainArray==null) {
	alert("The E-mail domain name doesn't seem to be valid.")
    return false
}

/* domain name seems valid, but now make sure that it ends in a
   three-letter word (like com, edu, gov) or a two-letter word,
   representing country (uk, nl), and that there's a hostname preceding 
   the domain or country. */

/* Now we need to break up the domain to get a count of how many atoms
   it consists of. */
var atomPat=new RegExp(atom,"g")
var domArr=domain.match(atomPat)
var len=domArr.length
if (domArr[domArr.length-1].length<2 || 
    domArr[domArr.length-1].length>3) {
   // the address must end in a two letter or three letter word.
   alert("The E-mail address must end in a three-letter domain, or two letter country.")
   return false
}

// Make sure there's a host name preceding the domain.
if (len<2) {
   var errStr="This E-mail address is missing a hostname!"
   alert(errStr)
   return false
}

// If we've gotten this far, everything's valid!
return true;
}

//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
function chkPostCode(strPostCode)
{
strTest = strPostCode+""

return(strTest.search(/^[a-zA-Z]{1,2}\d{1,2}[a-zA-Z]{0,1}\s{0,1}\d{1}[a-zA-Z]{2}$/)!=-1)
}
//------------------------------------------------------------------------------
function chkBlank(strValue)
{
strValue = strValue+""
return(strValue.search(/^\s*$/)!=-1 || strValue.search(/\w/)==-1)
}
//------------------------------------------------------------------------------
function chkScheme(f)
{
	if (f.sc.value==''){alert('Select a Credit Scheme')}
	return(f.sc.value!='')
}
//------------------------------------------------------------------------------

function setScheme()
{
	switch (document.basket.Scheme[document.basket.Scheme.selectedIndex].value)
	{
		case 'WE10':
			document.basket.sc.value = "WE10";
			break;
		case 'A4812':
			document.basket.sc.value = "A4812";
			break;
		default:
			document.basket.sc.value = "";
		break;
	}
}
//------------------------------------------------------------------------------

function chkDetails(f)
{
var bolDetails = false
var strMsg = ""

if (chkBlank(f.firstname.value)){strMsg=strMsg+"Firstname : Fill in\n"}

if (chkBlank(f.surname.value)){strMsg=strMsg+"Surname : Fill in\n"}

if (chkBlank(f.houseNumber.value)&& chkBlank(f.houseName.value)){strMsg=strMsg+"House Number or House Name : Fill in\n"}

if (chkBlank(f.postcode.value)){strMsg=strMsg+"Postcode : Fill in\n"}
if (!chkPostCode(f.postcode.value)){strMsg=strMsg+"Postcode : Correct the postcode\n"}

if (chkBlank(f.phone.value)){strMsg=strMsg+"Home Phone :Supply home number\n"}
if (chkBlank(f.email.value)){strMsg=strMsg+"Email :Fill in\n"}
if (!chkEmail(f.email.value)){strMsg=strMsg+"Email : Correct the address \n"}

if (strMsg!="")
{
	alert("The following fields must me completed\n"+strMsg )
}
return (strMsg=="")
}
//------------------------------------------------------------------------------


function chkPayMethod()
{
	if (document.basket.action=='')
	{
		alert ("Please select a payment method :"+document.basket.action)
	}
	return(document.basket.action!='')
}
function setPayMethod()
{
	switch (document.basket.payMethod[document.basket.payMethod.selectedIndex].value)
	{
		case 'ATB':
			bkt.minimumOrderValue = 250;
			bkt.maximumOrderValue = 9500;
			bkt.maxitems = 20;
			if (totalOK())
			{
				document.basket.action = "https://www.devercycles.co.uk/dever_atb_live.asp";
			}
			else
			{
				alert('ATB limits: Minimum order value allowed: £'+bkt.minimumOrderValue+'.\n Maximum order value '+bkt.maximumOrderValue)
			}
			break;
		case 'CCARD':
			bkt.minimumOrderValue = 5;
			bkt.maximumOrderValue = 9500;
			bkt.maxitems = 20;
			if (totalOK())
			{
				document.basket.action = "https://www.devercycles.co.uk/dever_ccard_live.asp";
			}
			else
			{
				alert('Credit Card limits: Minimum order value allowed: £'+bkt.minimumOrderValue+'.\n Maximum order value '+bkt.maximumOrderValue)
			}			
			
			break;
		default:
		document.basket.action = "";
		break;
	}
}
//------------------------------------------------------------------------------
function noSale()
{
alert("To buy on-line requires Microsoft IE or Netscape 4 or above\n and Cookies enabled in the browser options.")
}
//------------------------------------------------------------------------------

//-----------------------------------------------------------------------------------

function Shop(name,sOptions,sLabels)
{


		var cnt
		var aOptions = new Array()
		var aLabels = new Array()
		aOptions = sOptions.split(/,/)
		aLabels = sLabels.split(/,/)
		if (aOptions.length != aLabels.length){alert("Label/Option number mismatch "+name)}
        var cOptions = aOptions.length
		
		
		document.writeln("<select name='"+name+"'>")
		for (cnt=0;cnt<cOptions;cnt++)
		{
			document.writeln("<option value='"+aOptions[cnt]+"'>"+aLabels[cnt]+"</option>")
		}
		document.writeln("</select>")
}
//-----------------------------------------------------------------------------------

function shopHelp()
{
	argc = shopHelp.arguments.length;
	argv = shopHelp.arguments;


    var screenX    = screen.width;
    var screenY    = screen.height;
    var winWidth   = 480;
    var winHeight  = 160;
    var topX       = (screenX / 2) - (winWidth / 2);
    var topY       = (screenY / 2) - (winHeight / 2);

    newWin =  window.open("", "Wait", "width=" + winWidth + ",height=" + winHeight + ",left=" + topX + ",top=" + topY + ",scrollbars=yes");
	if (argc == 0)
	{
		newWin.location='dever_shop_help.htm'
	}
	else
	{
		newWin.location=argv[0];
	}
       
}
//==================================
function winPopUp(winWidth,winHeight,pageName)
{
    var screenX    = screen.width;
    var screenY    = screen.height;
    var topX       = (screenX / 2) - (winWidth / 2);
    var topY       = (screenY / 2) - (winHeight / 2);

    newWin =  window.open("", "Wait", "width=" + winWidth + ",height=" + winHeight + ",left=" + topX + ",top=" + topY + ",scrollbars=yes");

       newWin.location=pageName
	   
}

//=================================

function ATBbasket(name)
{
this.name = name;
this.basket = new Array('');
this.maxitems = 20;
this.shippingItems = 10;
this.minimumOrderValue = 5;
this.maximumOrderValue = 9500;
this.fieldnames = new Array('ssb','gc','pc','gd','gp','q')
this.lifetime = 1
this.saved = true
this.basketTotal = 0
this.itemsInBasket = 0
this.noOfFields = 6
ATBbasket.prototype.getATBField = getATBField 
ATBbasket.prototype.getBasketContents = getBasketContents 
ATBbasket.prototype.setBasketContents = setBasketContents 
ATBbasket.prototype.isInBasket = isInBasket
ATBbasket.prototype.isInOrderValueRange = isInOrderValueRange
ATBbasket.prototype.basketFull = basketFull
ATBbasket.prototype.basketTotals = basketTotals
ATBbasket.prototype.chgItemQty = chgItemQty
ATBbasket.prototype.removeItem = removeItem
ATBbasket.prototype.isEmptyBasket = isEmptyBasket
ATBbasket.prototype.addToBasket = addToBasket
ATBbasket.prototype.getFieldNum = getFieldNum
ATBbasket.prototype.clearBasket = clearBasket


this.getBasketContents()
if (this.basket[0]!="")
{
	this.basketTotals()
}
}

function isEmptyBasket()
{
var isEmpty
	if (this.basket[0]=="")
	{
		isEmpty = true
	}
	else
	{
		isEmpty = false
	}
return(isEmpty)	
}
function getATBField(txtField,txtRecord)
{
	//txtField = Name of field to return
	//txtRecord = Record from which field is extracted as a string
	var txtFldStart, txtFldEnd, txtFldValue
	var txtFields = new Array
	var bolFound = false
	var txtFieldValue
	txtRecord = txtRecord.substring(0,txtRecord.length-1)
	txtFields = txtRecord.split("|")
	//look for named field and extract value
	for (i=0;i<txtFields.length;i++)
	{

		if (this.fieldnames[i]==txtField)
		{	

			bolFound = true
			txtFieldValue = txtFields[i]
		}
	}
	if (!bolFound)
	{
		alert ('Field '+txtField+' not found.txtRecord='+txtRecord)
		txtFieldValue = null
	}
	else
	{
		//do nothing		
	}
	return(txtFieldValue)
}


function getBasketContents()
{
	var bktCookie = getCookieValue(this.name)
	if (bktCookie!=null)
	{
		this.basket = bktCookie.split("~")
		this.basket.length--
	}else{
		this.basket[0]=""
	}

}

function setBasketContents()
{
	var newCookie
	var dtToday = new Date()
	dtToday.setMonth(dtToday.getMonth()+this.lifetime)
	var cookieExpires = dtToday.toGMTString()
	if (!this.isEmptyBasket())
	{

		newCookie = this.basket.join("~")+"~"
		this.basketTotals()
	}
	else
	{
		dtToday.setMonth(dtToday.getMonth()-this.lifetime)
		cookieExpires = dtToday.toGMTString()	
		newCookie =""
	}
	setCookieValue(this.name, newCookie, "", cookieExpires,"","")
}


function isInOrderValueRange(newValue)
{
	return (((this.basketTotal-0)+(newValue-0))>=this.minimumOrderValue && ((this.basketTotal-0)+(newValue-0))<=this.maximumOrderValue)
}

function basketTotals()
{
	var bk = this.basket
	var intBasketTotal=0
	var intItemsInBasket = 0
	var intLoop
	if (bk[0]!="")
	{


		for (intLoop=0;intLoop<this.basket.length;intLoop++)
		{
			
			intBasketTotal = intBasketTotal + ((this.getATBField('gp',bk[intLoop])-0)*(this.getATBField('q',bk[intLoop])-0))
			intItemsInBasket = intItemsInBasket + (this.getATBField('q',bk[intLoop])-0)
	
		}
		
		this.basketTotal = toCurrency(intBasketTotal)
		this.itemsInBasket = intItemsInBasket
	}
}

function basketFull()
{
	var bolFull
	if (this.itemsInBasket>this.maxitems)
	{
		bolFull = true
	}else{
		bolFull = false
		
	}
	return (bolFull)
}

function chgItemQty(idOfItem,newQty,objQty)
{
var bolFound = false
var bolUpdated = false
var iLoop = 0
var itemRecord = new Array
var intQtyField = 0
var intOldQty = 0
var incValue = 0
	if(this.basket[0]!="")
	{
		while (!bolFound && iLoop<this.basket.length)
		{

			if (this.getATBField('pc',this.basket[iLoop])==idOfItem)
			{
				bolFound=true
				itemRecord = this.basket[iLoop].split("|")
				intQtyField = this.getFieldNum('q')
				intOldQty = itemRecord [intQtyField]
				if ((this.itemsInBasket-(intOldQty-0)+(newQty-0))>this.maxitems)
				{
					alert ("Basket full! A maximum of "+this.maxitems+" items is allowed")
					objQty.selectedIndex = (intOldQty-1)
				}
				else 
				{
					incValue = ((newQty-0)-(intOldQty-0))*itemRecord [this.getFieldNum('gp')]
					if(this.isInOrderValueRange(incValue))
					{
						itemRecord [intQtyField]= newQty
						this.basket[iLoop] = itemRecord.join("|")
						bolUpdated = true
					}
					else
					{
						alert ("Item not added. Maximum order value is £"+(this.maximumOrderValue-1)+"Current value is £"+this.basketTotal)
						objQty.selectedIndex = (intOldQty-1)
					}
				}
			}
			else
			{
				iLoop++
			}
		}
	this.setBasketContents()
	this.basketTotals()
	}
return (bolFound&&bolUpdated)
}
function clearBasket()
{
	this.basket.length = 1;
	this.basket[0] = "";
	this.setBasketContents();
	this.basketTotals();
}
function getFieldNum (strFieldName)
{
var bolFound = false
var iLoop = 0
var intFieldNumber = -1
	while (!bolFound && iLoop<this.fieldnames.length)
	{
		if (this.fieldnames[iLoop]==strFieldName)
		{
			bolFound = true
			intFieldNumber = iLoop
		}else{
			iLoop++
		}
	}
	if (!bolFound)
	{
		alert ("Invalid Field Name")
	}
return (intFieldNumber)
}

function removeItem (idOfItem)
{

var bolFound = false
var iLoop = 0

if (this.basket[0]!="")
{
	while (!bolFound && iLoop<this.basket[iLoop].length)
	{

		
		if (this.getATBField('pc',this.basket[iLoop])==idOfItem)
		{
				bolFound=true
				if (this.basket.length == 1)
				{
					this.basket[0]=""
				}
				else
				{
					this.basket.splice(iLoop,1)
				}

				this.setBasketContents()
				this.getBasketContents()


		}
		else
		{
			iLoop++
		}
	}
}
return (bolFound)
}

function setCookieValue(name,value,path,expires,domain,secure) {

    document.cookie = name + "=" +escape(value) +
        ( (expires) ? ";expires=" + expires : "") +
        ( (path) ? ";path=" + path : "") + 
        ( (domain) ? ";domain=" + domain : "") +
        ( (secure) ? ";secure" : "");
}

/*
function setCookieValue(cookieName, cookieValue, cookiePath, cookieExpires)
{
	cookieValue = escape(cookieValue);
	if  (cookieExpires == null)
	{
		//cookieExpires = nowDate.toGMTString();
		cookieExpires = nowDate.toGMTString();

	}
	cookieExpires = ";expires=" + cookieExpires 
	if (cookiePath != "")
	{
		cookiePath = ";Path=" + cookiePath
	}

	document.cookie = cookieName + "=" + cookieValue  + cookieExpires + cookiePath;
}
*/
function getCookieValue(cookieName)
{
	var cookieValue = document.cookie;
	var cookieStartsAt = cookieValue.indexOf(" "+ cookieName+"=");
	if (cookieStartsAt == -1)
	{
		cookieStartsAt = cookieValue.indexOf(cookieName+"=");
	}
	if (cookieStartsAt == -1)
	{
		cookieValue = null;
	}else {
		cookieStartsAt = cookieValue.indexOf("=", cookieStartsAt)+1;
		var cookieEndsAt = cookieValue.indexOf(";",cookieStartsAt);
		if (cookieEndsAt == -1)
		{
			cookieEndsAt = cookieValue.length;
		}
			cookieValue = unescape(cookieValue.substring(cookieStartsAt,cookieEndsAt))
		}
	return cookieValue;
}
function Delete_Cookie(name,path,domain) {
    if (getCookieValue(name)) document.cookie = name + "=" +
        ( (path) ? ";path=" + path : "") +
        ( (domain) ? ";domain=" + domain : "") +
        ";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}
function cookieEnabled()
{
	storeMasterCookie()
	return(getCookieValue('MasterCookie')=='MasterCookie')
}

function storeMasterCookie() {
    if (!getCookieValue('MasterCookie'))
        setCookieValue('MasterCookie','MasterCookie',"","","","");
}
function toCurrency(intAmount)
{
var intPounds;
var intPence;
intAmount=intAmount+"";

if (intAmount.indexOf(".")==-1)
{
	intPounds = intAmount;
	intPence ="00";
}
else
{
	if (intAmount.indexOf(".")==(intAmount.length-1))
	{
		intPounds = intAmount.substr(0,(intAmount.length-1));
		intPence ="00";
	}
	else
	{
		if (intAmount.indexOf(".")==(intAmount.length-2))
		{
			intPounds = intAmount.substr(0,(intAmount.length-2));
			intPence =intAmount.substr(intAmount.indexOf(".")+1,1)+"0";
		}
		if (intAmount.indexOf(".")<=(intAmount.length-3))
		{
			intPounds = intAmount.substr(0,intAmount.indexOf("."));
			intPence = intAmount.substr(intAmount.indexOf(".")+1,2);
		}
	}
}
	return(intPounds+"."+intPence)
}

/*function toCurrency(bktTotal)
{
var bktPounds
var bktPence
bktTotal=bktTotal+""
if (bktTotal.indexOf(".")==-1)
{
bktPounds = bktTotal
bktPence ="00"
}
else
{
bktPounds = bktTotal.substr(0,bktTotal.indexOf("."))
bktPence = bktTotal.substr(bktTotal.indexOf(".")+1,2)

}
return(bktPounds+"."+bktPence)
}
*/
function isInBasket(idOfItem)
{
var bolFound = false
var iLoop = 0
if (this.basket[0]!="")
{
	while (!bolFound && iLoop<this.basket.length)
	{
		if (this.getATBField('pc',this.basket[iLoop])==idOfItem)
		{
				bolFound=true
		}
		else
		{
			iLoop++
		}
	}
}
return (bolFound)
}



function addToBasket()
{
	argc = arguments.length;
	argv = arguments;
	if (argc>0)
	{
		strItemRecord = argv[0];
	}
	else
	{
		alert("No item sent to basket");
		return(true);
	}
	if (argc>1)
	{
		flagQuiet = argv[1];
	}
	else
	{
		flagQuiet =false;
	}
	var sr = strItemRecord.split("|")
	var intNewQty = this.getATBField('q',strItemRecord)
	var itemPrice = this.getATBField('gp',strItemRecord)
	var itemValue = intNewQty * itemPrice
	var rvalue = false;
	if (sr.length==this.noOfFields+1)
	{
			if (this.isEmptyBasket())
			{
						alert ("Added item " + this.getATBField('gd',strItemRecord)+" to basket")
				this.basket[0]=strItemRecord
			}
			else
			{

				if(this.itemsInBasket+(intNewQty-0)<=this.maxitems)
				{
					if (this.isInBasket(this.getATBField('pc',strItemRecord)))
					{
						//alert user to use show basket to change quantities
						alert ("This item is already in the basket. \n View basket to change quantities.");
						rvalue = 2;
			
					}
					else
					{
						if(this.isInOrderValueRange(itemValue))
						{
						if (!flagQuiet)
						{
							alert ("Added item " + this.getATBField('gd',strItemRecord)+" to basket");
						}
						this.basket.splice(this.basket.length,0,strItemRecord)
						rvalue = 1;
						}
						else
						{
							alert("Item not added, maximum basket value £"+this.maximumOrderValue+". Current value is £"+this.basketTotal+" Minimum Value is: "+this.MinimumOrderValue)
							rvalue = false;
						}
					}
				}
				else
				{
					alert("Item not added! There are "+this.itemsInBasket+" items in the basket.\n The maximum allowed is "+this.maxitems)
					rvalue=false;
				}
			}
		
			this.setBasketContents()
			this.getBasketContents()
	}
	else
	{
		alert("Invalid item record submitted")
		rvalue=false;
	}
return(rvalue)
}

function updateBasket(objBasket,objForm)
{

	var c
	var b = objBasket
	if (!b.isEmptyBasket())
	{
		for (c=b.basket.length-1;c>-1;c--)
		{
			if (eval(objForm+'.iRemove'+c+'.checked'))
			{
				b.removeItem(b.getATBField('pc',b.basket[c]))
			}
		}
	}

}


//--================================

function access_nav()
{
document.writeln("<div id='bikeMenu'>") 
document.writeln("<table width='92' border='1' cellspacing='0'>")
document.writeln("<tr bgcolor='#0000FF'>")
document.writeln("<td bgcolor='#663300'><a href='/bontrager.htm'><font size='2' face='Verdana, Arial, Helvetica, sans-serif'>Bontrager</font></a></td>")
document.writeln("</tr>")
document.writeln("<tr bgcolor='#0000FF'>")
document.writeln("<td bgcolor='#663300'><a href='/campagnolo.htm'><font size='2' face='Verdana, Arial, Helvetica, sans-serif'>Campag</font></a></td>")
document.writeln("</tr>")
document.writeln("<tr bgcolor='#663300' valign='top'>")
document.writeln("<td bgcolor='#663300'><a href='/shimano.htm'><font size='2' face='Verdana, Arial, Helvetica, sans-serif'>Shimano</font></a></td>")
document.writeln("</tr>")
document.writeln("<tr bgcolor='#0000FF' valign='top'> ")
document.writeln("<td bgcolor='#663300' valign='top'><a href='/camelbak.htm'><font size='2' face='Verdana, Arial, Helvetica, sans-serif'>Camelbak</font></a></td>")
document.writeln("</tr>")
document.writeln("</table>")
document.writeln("</div>")
        
}
function deals_nav()
{
	document.writeln("<div id='bikeMenu'>") 
	document.writeln("<table width='88' border='1' cellspacing='0'>")
	document.writeln("<tr bgcolor='#663300'>")
	document.writeln("<td><font size='2' face='Verdana, Arial, Helvetica, sans-serif' color='#FFFFFF'><b><a href='deals.htm'>Deals</a></b></font></td>")
	document.writeln("</tr>")
	document.writeln("</table>")
	document.writeln("</div>") 	
}
function roadbike_nav(DullOption)
{
document.writeln("<div id='bikeMenu'>") 
document.writeln("<table width='88' border='1' cellspacing='0'>")
document.writeln("<tr bgcolor='#0000FF'>")
document.writeln("<td><font size='2' face='Verdana, Arial, Helvetica, sans-serif' color='#FFFFFF'><b>Trek Bikes</b></font></td>")
document.writeln("</tr>")

document.writeln("<tr bgcolor='#663300'> ")
document.writeln("<td valign='top'><font size='2' face='Verdana, Arial, Helvetica, sans-serif'>")
if (DullOption != 1){document.writeln("<a href='bicycles-road-trek-5000_2004.htm'>5000 Range</a><br>")}else {document.writeln("<font color='#FFFFFF'>5000 Range<br>")}
if (DullOption != 10){document.writeln("<a href='bicycles-road-trek-2000_2004.htm'>2000 Range</a><br>")}else {document.writeln("<font color='#FFFFFF'>2000 Range<br>")}
if (DullOption != 2){document.writeln("<a href='bicycles-road-trek-1000_2004.htm'>1000 Range</a><br>")}else {document.writeln("<font color='#FFFFFF'>1000 Range<br>")}
if (DullOption != 11){document.writeln("<a href='bicycles-road-trek-tx00_2004.htm'>Tandems</a><br>")}else {document.writeln("<font color='#FFFFFF'>Tandems<br>")}
document.writeln("</font></td></tr>")

document.writeln("<tr bgcolor='#0000FF' valign='top'> ")
document.writeln("<td><font size='2'><font face='Verdana, Arial, Helvetica, sans-serif' color='#FFFFFF'><b>GIANT</b></font></font></td>")
document.writeln("</tr>")
document.writeln("<tr bgcolor='#663300'> ")
document.writeln("<td><font size='2'><font face='Verdana, Arial, Helvetica, sans-serif' color='#FFFFFF'> ")
if (DullOption != 3){document.writeln("<a href='bicycles-road-giant-tcr_carbon_2004.htm'>TCR Carbon</a><br>")}else {document.writeln("<font color='#FFFFFF'>TCR Carbon</font><br>")}
if (DullOption != 4){document.writeln("<a href='bicycles-road-giant-tcr_2004.htm'>TCR Range</a><br>")}else {document.writeln("<font color='#FFFFFF'>TCR Range</font><br>")}
if (DullOption != 5){document.writeln("<a href='bicycles-road-giant-special_2004.htm'>Frames</a><br>")}else {document.writeln("<font color='#FFFFFF'>Frames</font><br>")}
if (DullOption != 6){document.writeln("<a href='bicycles-road-giant-ocr_2004.htm'>OCR Range</a><br>")}else {document.writeln("<font color='#FFFFFF'>OCR Range</font><br>")}
if (DullOption != 7){document.writeln("<a href='bicycles-road-giant-fcr_2004.htm'>FCR Range</a>")}else {document.writeln("<font color='#FFFFFF'>FCR Range</font>")}
document.writeln("</font></font></td></tr>")
document.writeln("<tr bgcolor='#0000FF'> ")
document.writeln("<td> ")
document.writeln("<div align='center'><font face='Verdana, Arial, Helvetica, sans-serif' size='2' color='#FFFFFF'><b>Colnago</b></font></div>")
document.writeln("</td>")
document.writeln("</tr>")
document.writeln("<tr bgcolor='#996600'> ")
document.writeln("<td bgcolor='#663300'> ")
document.writeln("<div align='left'>")
if (DullOption != 8){document.writeln("<a href='bicycles-road-colnago-1.htm'><font face='Verdana, Arial, Helvetica, sans-serif' size='2'>Colnago</font></a>")}else {document.writeln("<font face='Verdana, Arial, Helvetica, sans-serif' size='2' color='#FFFFFF'>Colnago</font><br>")}
document.writeln("</div>")
document.writeln("</td>")
document.writeln("</tr>")
document.writeln("<tr bgcolor='#996600'> ")
document.writeln("<td bgcolor='#0000FF'><font size='2' face='Verdana, Arial, Helvetica, sans-serif'><b><font color='#FFFFFF'>Specialized</font></b></font></td>")
document.writeln("</tr>")
document.writeln("<tr bgcolor='#996600'>") 
document.writeln("<td bgcolor='#663300'><font size='2' face='Verdana, Arial, Helvetica, sans-serif'>")
if (DullOption != 9){document.writeln("<a href='bicycles-road-specialized-allez_2004.htm'>Allez</a>")}else {document.writeln("<font color='#FFFFFF'>Allez</font><br>")}
if (DullOption != 12){document.writeln("<a href='bicycles-road-specialized-sequoia_2004.htm'>Sequoia</a>")}else {document.writeln("<font color='#FFFFFF'>Sequoia</font><br>")}
document.writeln("</font></td>")
document.writeln("</tr>")
document.writeln("<tr bgcolor='#996600'> ")
document.writeln("<td bgcolor='#0000FF'><font size='2' face='Verdana, Arial, Helvetica, sans-serif'><b><font color='#FFFFFF'>Fuji</font></b></font></td>")
document.writeln("</tr>")
document.writeln("<tr bgcolor='#996600'>") 
document.writeln("<td bgcolor='#663300'><font size='2' face='Verdana, Arial, Helvetica, sans-serif'>")
if (DullOption != 13){document.writeln("<a href='bicycles-road-fuji_2004.htm'>Road/Track</a>")}else {document.writeln("<font color='#FFFFFF'>Road/Track</font><br>")}
document.writeln("</font></td>")
document.writeln("</tr>")
document.writeln("<tr bgcolor='#996600'>") 
document.writeln("<td bgcolor='#663300'><font size='2' face='Verdana, Arial, Helvetica, sans-serif'>")
if (DullOption != 14){document.writeln("<a href='bicycles-road-klein_2004.htm'>Klein</a>")}else {document.writeln("<font color='#FFFFFF'>Klein</font><br>")}
document.writeln("</font></td>")
document.writeln("</tr>")
document.writeln("</table>")
document.writeln("</div>")
}

//====================================================
function roadbike_nav_foot(DullOption)
{
document.writeln("<div align='center'><font face='Verdana, Arial, Helvetica, sans-serif' size='2'>")
if (DullOption != 1){document.writeln("<a href='bicycles-road-trek-5000_2003.htm'>Trek 5000 Range</a> | ")}else {document.writeln("<font color='#0000FF'>Trek 5000 Range</font> |")}
if (DullOption != 2){document.writeln("<a href='bicycles-road-trek-1000_2003.htm'>Trek 1000 Range</a> <br>")}else {document.writeln("<font color='#0000FF'>Trek 1000 Range</font><br>")}
if (DullOption != 6){document.writeln("<a href='bicycles-road-giant-ocr_2003.htm'>GIANT OCR Range</a> | ")}else {document.writeln("<font color='#0000FF'>GIANT OCR Range</font> |")}
if (DullOption != 4){document.writeln("<a href='bicycles-road-giant-tcr_2003.htm'>GIANT TCR Range</a> | ")}else {document.writeln("<font color='#0000FF'>GIANT TCR Range</font> |")}
if (DullOption != 3){document.writeln("<a href='bicycles-road-giant-tcr_carbon_2003.htm'>Giant TCR Carbon</a> | ")}else {document.writeln("<font color='#0000FF'>GIANT TCR Carbon</font> |")}
if (DullOption != 5){document.writeln("<a href='bicycles-road-giant-tcr_frame_2003.htm'>GIANT TCR Frames</a> <br>")}else {document.writeln("<font color='#0000FF'>GIANT TCR Frames</font>")}
if (DullOption != 7){document.writeln("<a href='bicycles-road-giant-fcr_2003.htm'>GIANT FCR Range</a> | ")}else {document.writeln("<font color='#0000FF'>GIANT FCR Range</font><br>")}
if (DullOption != 8){document.writeln("<a href='bicycles-road-colnago-1.htm'>Colnago</a> | ")}else {document.writeln("<font color='#0000FF'>Colnago</font> |")}

if (DullOption != 9){document.writeln("<a href='bicycles-road-specialized-allez_2003.htm'>Specialized Allez Range</a>")}else {document.writeln("<font color='#0000FF'>Specialized Allez Range</font>")}
document.writeln("</font></div>")
}

function mtnbike_nav_foot(DullOption)
{
document.writeln("<div align='center'><font face='Verdana, Arial, Helvetica, sans-serif' size='2'>")
if (DullOption != 1){document.writeln("<a href='bicycles-mountain-giant_xtc_2003.htm'>2003 GIANT XtC Range</a> | ")}else {document.writeln("<font color='#0000FF'>2003 GIANT XtC Range</font> | ")}
if (DullOption != 2){document.writeln("<a href='bicycles-mountain-giant_boulder_2003.htm'>2003 GIANT Boulder Range</a><br>")}else {document.writeln("<font color='#0000FF'>2003 Boulder Range</font><br>")}
if (DullOption != 3){document.writeln("<a href='bicycles-mountain-trek_4000_2003.htm'>2003 Trek 4000 Range</a>  | ")}else {document.writeln("<font color='#0000FF'>2003 Trek 4000 Range</font> |")}
if (DullOption != 4){document.writeln("<a href='bicycles-mountain-specialized_hardrock_2003.htm'>2003 Specialized Hardrock</a><br> ")}else {document.writeln("<font color='#0000FF'>2003 Specialized Hardrock</font><br>")}
document.writeln("</font></div>")
}

//======================================================

function mtnbike_nav(DullOption)
{


document.writeln("<div id='bikeMenu'>") 
document.writeln("<table width='88' border='1' cellspacing='0'>")




document.writeln("<tr bgcolor='#0000FF' valign='top'> ")
document.writeln("<td><font size='2'><font face='Verdana, Arial, Helvetica, sans-serif' color='#FFFFFF'><b>GIANT</b></font></font></td>")
document.writeln("</tr>")

document.writeln("<tr bgcolor='#663300'> ")
document.writeln("<td><font size='2'><font face='Verdana, Arial, Helvetica, sans-serif' color='#FFFFFF'> ")
if (DullOption != 1){document.writeln("<a href='bicycles-mountain-giant_xtc_2004.htm'>XtC Range</a><br>")}else {document.writeln("<font color='#FFFFFF'>XtC Range</font><br>")}
if (DullOption != 2){document.writeln("<a href='bicycles-mountain-giant_nrs_2004.htm'>NRS Range</a><br>")}else {document.writeln("<font color='#FFFFFF'>NRS Range</font><br>")}
document.writeln("</font></font></tr>")

document.writeln("<tr bgcolor='#0000FF'>")
document.writeln("<td><font size='2' face='Verdana, Arial, Helvetica, sans-serif' color='#FFFFFF'><b>Trek Bikes</b></font></td>")
document.writeln("</tr>")

document.writeln("<tr bgcolor='#663300'> ")
document.writeln("<td valign='top'><font size='2' face='Verdana, Arial, Helvetica, sans-serif'>")
if (DullOption != 3){document.writeln("<a href='bicycles-mountain-trek_elite_2004.htm'>Carbon</a><br>")}else {document.writeln("<font color='#FFFFFF'>Carbon</font><br>")}
document.writeln("</font></tr>")

document.writeln("<tr bgcolor='#996600'> ")
document.writeln("<td bgcolor='#0000FF'><font size='2' face='Verdana, Arial, Helvetica, sans-serif'><b><font color='#FFFFFF'>Specialized</font></b></font></td>")
document.writeln("</tr>")

document.writeln("<tr bgcolor='#996600'>") 
document.writeln("<td bgcolor='#663300'><font size='2' face='Verdana, Arial, Helvetica, sans-serif'>")
if (DullOption != 4){document.writeln("<a href='bicycles-mountain-spz_hardrock_2004.htm'>Hardrock</a>")}else {document.writeln("<font color='#FFFFFF'>Hardrock</font><br>")}
if (DullOption != 5){document.writeln("<a href='bicycles-mountain-spz_rockhopper_2004.htm'>Rockhopper</a>")}else {document.writeln("<font color='#FFFFFF'>Rockhopper</font><br>")}
if (DullOption != 6){document.writeln("<a href='bicycles-mountain-spz_starjumper_2004.htm'>Stumpjumper</a>")}else {document.writeln("<font color='#FFFFFF'>Stumpjumper</font><br>")}
if (DullOption != 7){document.writeln("<a href='bicycles-mountain-spz_epicfsr_2004.htm'>Epic FSR</a>")}else {document.writeln("<font color='#FFFFFF'>Epic FSR</font><br>")}
if (DullOption != 8){document.writeln("<a href='bicycles-mountain-spz_Starjumperfsr_2004.htm'><font size='1'>Starjmpr FSR</font></a>")}else {document.writeln("<font color='#FFFFFF' size='1'>Stumpjmpr FSR</font><br>")}
if (DullOption != 9){document.writeln("<a href='bicycles-mountain-spz_endurofsr_2004.htm'>Enduro FSR</a>")}else {document.writeln("<font color='#FFFFFF'>Enduro FSR</font><br>")}

document.writeln("</font></td>")
document.writeln("</tr>")
/**/
document.writeln("</table>")
document.writeln("</div>")

}
//======================================================
function hybridbike_nav_foot(DullOption)
{
document.writeln("<div align='center'><font face='Verdana, Arial, Helvetica, sans-serif' size='2'>") 
if (DullOption != 1){document.writeln("<a href='bicycles-hybrid-giant_fcr_2003.htm'>2003 Giant FCR Range</a> | ")}else {document.writeln("<font color='#0000FF'>2003 Giant FCR Range</font> | ")} 
if (DullOption != 7){document.writeln("<a href='bicycles-hybrid-giant_lafree_2003.htm'>2003 Giant Electric</a><br>")}else {document.writeln("<font color='#0000FF'>2003 Giant Electric</font><br>")}
if (DullOption != 6){document.writeln("<a href='bicycles-hybrid-trek_7000_2003.htm'>2003 Trek Multitrak</a><br>")}else {document.writeln("<font color='#0000FF'>2003 Trek Multitrak</font><br>")}
if (DullOption != 2){document.writeln("<a href='bicycles-hybrid-ridgeback2003-day.htm'>2003 Ridgeback Genesis</a> |  ")}else {document.writeln("<font color='#0000FF'>2003 Ridgeback Genesis</font> | ")}
if (DullOption != 3){document.writeln("<a href='/bicycles-hybrid-ridgeback2003-men.htm'>2003 Ridgeback Rapide (Men)</a><br>")}else {document.writeln("<font color='#0000FF'>2003 Ridgeback Rapide (Men)</font><br>")}
if (DullOption != 4){document.writeln("<a href='/bicycles-hybrid-ridgeback2003-women.htm'>2003 Ridgeback Rapide (Women)</a> | ")}else {document.writeln("<font color='#0000FF'>2003 Ridgeback Rapide (Women)</font> |")}
if (DullOption != 9){document.writeln("<a href='/bicycles-hybrid-ridgeback_switch_2003.htm'>2003 Ridgeback Switch</a><br> ")}else {document.writeln("<font color='#0000FF'>2003 Ridgeback Switch</font><br>")}
if (DullOption != 5){document.writeln("<a href='bicycles-hybrid-spz_sirrus_2003.htm'><font face='Verdana, Arial, Helvetica, sans-serif' size='2'>Specialized Sirrus</font></a>")}else {document.writeln("<font color='#0000FF'> <font face='Verdana, Arial, Helvetica, sans-serif' size='2'>2003 Specialized Sirrus</font></font>")}
if (DullOption != 8){document.writeln("<a href='http://www.devercycles.co.uk/bicycles-hybrid-giant_ezb_2003.htm'>2003 Giant EZB</a><br>")}else {document.writeln("<font color='#0000FF'>2003 Giant EZB</font><br>")}

document.writeln("</font></div>")
}

//======================================================
function hybridbike_nav(DullOption)
{
document.writeln("<div id='bikeMenu'>") 
document.writeln("<table width='88' border='1' cellspacing='0'>")
//Title #1
document.writeln("<tr bgcolor='#0000FF' valign='top'> ")
document.writeln("<td><font size='2'><font face='Verdana, Arial, Helvetica, sans-serif' color='#FFFFFF'><b>GIANT</b></font></font></td>")
document.writeln("</tr>")
//Links #1
document.writeln("<tr bgcolor='#663300'> ")
document.writeln("<td valign='top'><font size='2' face='Verdana, Arial, Helvetica, sans-serif'>") 
if (DullOption != 1){document.writeln("<a href='bicycles-hybrid-giant-fcr_2004.htm'>FCR Range</a><br>")}else {document.writeln("<font color='#FFFFFF'>FCR Range</font><br>")}
if (DullOption != 7){document.writeln("<a href='bicycles-hybrid-giant_hybrid_2004.htm'>Hybrid</a><br>")}else {document.writeln("<font color='#FFFFFF'>Hybrid</font><br>")}
//if (DullOption != 8){document.writeln("<a href='http://www.devercycles.co.uk/bicycles-hybrid-giant_ezb_2003.htm'>EZ Bike</a>")}else {document.writeln("<font color='#FFFFFF'>EZ Bike</font><br>")}
document.writeln("</font></td>")
document.writeln("</tr>")
//Title # 2
document.writeln("<tr bgcolor='#0000FF'> ")
document.writeln("<td> ")
document.writeln("<div align='center'><font face='Verdana, Arial, Helvetica, sans-serif' size='2' color='#FFFFFF'><b>Ridgeback</b></font></div>")
document.writeln("</td>")

//Links #2
document.writeln("<tr bgcolor='#663300'> ")
document.writeln("<td><font size='2'><font face='Verdana, Arial, Helvetica, sans-serif' color='#FFFFFF'> ")
if (DullOption != 2){document.writeln("<a href='bicycles-hybrid-ridgeback2004-day.htm'>Genesis</a><br>")}else {document.writeln("<font color='#FFFFFF'>Genesis</font><br>")}
if (DullOption != 3){document.writeln("<a href='/bicycles-hybrid-ridgeback2004-men.htm'>Rapide <font size='1'>(M)</font></a><br>")}else {document.writeln("<font color='#FFFFFF'>Rapide <font size='1'>(M)</font></font><br>")}
if (DullOption != 4){document.writeln("<a href='/bicycles-hybrid-ridgeback2004-women.htm'><font size='1'>Rapide (W)</font></a>")}else {document.writeln("<font color='#FFFFFF'><font size='1'>Rapide (W)</font></font><br>")}
if (DullOption != 9){document.writeln("<a href='/bicycles-hybrid-ridgeback_switch_2004.htm'><font size='2'>Switch</font></a>")}else {document.writeln("<font color='#FFFFFF'><font size='2'>Switch</font></font><br>")}
document.writeln("</font></font></td>")
document.writeln("</tr>")
//Title #3
document.writeln("<tr bgcolor='#996600'> ")
document.writeln("<td bgcolor='#0000FF'><font size='2' face='Verdana, Arial, Helvetica, sans-serif'><b><font color='#FFFFFF'>Specialized</font></b></font></td>")
document.writeln("</tr>")


//Links #3
document.writeln("<tr bgcolor='#996600'> ")
document.writeln("<td bgcolor='#663300'> ")
document.writeln("<div align='left'>")
if (DullOption != 5){document.writeln("<a href='bicycles-hybrid-spz_sirrus_2004.htm'><font face='Verdana, Arial, Helvetica, sans-serif' size='2'>Sirrus</font></a>")}else {document.writeln("<font face='Verdana, Arial, Helvetica, sans-serif' size='2' color='#FFFFFF'>Sirrus</font><br>")}
if (DullOption != 10){document.writeln("<a href='bicycles-hybrid-spz_xroads_2004.htm'><font face='Verdana, Arial, Helvetica, sans-serif' size='2'>Xroads</font></a>")}else {document.writeln("<font face='Verdana, Arial, Helvetica, sans-serif' size='2' color='#FFFFFF'>Xroads</font><br>")}


document.writeln("</div>")
document.writeln("</td>")
document.writeln("</tr>")
//Title #4
document.writeln("<tr bgcolor='#0000FF'>")
document.writeln("<td><font size='2' face='Verdana, Arial, Helvetica, sans-serif' color='#FFFFFF'><b>Trek Bikes</b></font></td>")
document.writeln("</tr>")


//Links #4
document.writeln("<tr bgcolor='#996600'>") 
document.writeln("<td bgcolor='#663300'><font size='2' face='Verdana, Arial, Helvetica, sans-serif'>")
if (DullOption != 6){document.writeln("<a href='bicycles-hybrid-trek_7000_2004.htm'>Multitrak</a>")}else {document.writeln("<font color='#FFFFFF'>Multitrak</font><br>")}
document.writeln("</font></td>")
document.writeln("</tr>")
//Title #5
document.writeln("<tr bgcolor='#0000FF'>")
document.writeln("<td><font size='2' face='Verdana, Arial, Helvetica, sans-serif' color='#FFFFFF'><b>Zero Bikes</b></font></td>")
document.writeln("</tr>")


//Links #5
document.writeln("<tr bgcolor='#996600'>") 
document.writeln("<td bgcolor='#663300'><font size='2' face='Verdana, Arial, Helvetica, sans-serif'>")
if (DullOption != 11){document.writeln("<a href='bicycles-hybrid-zero_2004.htm'>City</a>")}else {document.writeln("<font color='#FFFFFF'>Zero</font><br>")}
document.writeln("</font></td>")
document.writeln("</tr>")
document.writeln("</table>")
document.writeln("</div>")
}


//======================================================

//======================================================
function viewBike()
{
argc = viewBike.arguments.length;
argv = viewBike.arguments;
var intWidth, strBike;
if (argc>0)
{
	strBike = argv[0];
}
else
{
	alert('No Image Specified');
	return;
}
if(argc>1)
{
	intWidth = argv[1];
}
 window.open('bicycles-viewer.asp?bikePic=http://www.devercycles.co.uk/images/'+strBike+'&width='+intWidth,'bikeView','height=500,width=650')
}
function viewBikeCT()
{
argc = viewBikeCT.arguments.length;
argv = viewBikeCT.arguments;
var intWidth, strBike;
if (argc>0)
{
	strBike = argv[0];
}
else
{
	alert('No Image Specified');
	return;
}
if(argc>1)
{
	intWidth = argv[1];
}
 window.open('bicycles-viewer.asp?bikePic='+strBike+'&width='+intWidth,'bikeView','height=500,width=650')
}
//======================================================
function folding_bike_nav(DullOption)
{
document.writeln("<div id='bikeMenu'>") 
document.writeln("<table width='88' border='1' cellspacing='0'>")
//Title #1
/*document.writeln("<tr bgcolor='#0000FF' valign='top'> ")
document.writeln("<td><font size='2'><font face='Verdana, Arial, Helvetica, sans-serif' color='#FFFFFF'><b>Ridgeback</b></font></font></td>")
document.writeln("</tr>")
//Links #1
document.writeln("<tr bgcolor='#663300'> ")
document.writeln("<td valign='top'><font size='2' face='Verdana, Arial, Helvetica, sans-serif'>") 
if (DullOption != 1){document.writeln("<a href='bicycles-folding-ridgeback-1.htm'>Folding</a>")}else {document.writeln("<font color='#FFFFFF'>Folding</font>")}
document.writeln("</font></td>")
document.writeln("</tr>")*/
//Title #2
document.writeln("<tr bgcolor='#0000FF' valign='top'> ")
document.writeln("<td><font size='2'><font face='Verdana, Arial, Helvetica, sans-serif' color='#FFFFFF'><b>Brompton</b></font></font></td>")
document.writeln("</tr>")
//Links #2
document.writeln("<tr bgcolor='#663300'> ")
document.writeln("<td valign='top'><font size='2' face='Verdana, Arial, Helvetica, sans-serif'>") 
if (DullOption != 2){document.writeln("<a href='bicycles-folding-brompton_2003.htm'>CT&L-Type</a>")}else {document.writeln("<font color='#FFFFFF'>CT&L-Type</font><br>")}
document.writeln("</font></td>")
document.writeln("</tr>")

document.writeln("</table>")
document.writeln("</div>")
}


//======================================================
function folding_bike_nav_foot(DullOption)
{
document.writeln("<div align='center'><font face='Verdana, Arial, Helvetica, sans-serif' size='2'>") 
if (DullOption != 1){document.writeln("<a href='bicycles-folding-ridgeback-1.htm'>2003 Ridgeback Folding</a> | ")}else {document.writeln("<font color='#0000FF'>2003 Ridgeback Folding</font> | ")} 
if (DullOption != 2){document.writeln("<a href='bicycles-folding-brompton_2003.htm'>2003 Brompton Folding</a><br>")}else {document.writeln("<font color='#0000FF'>2003 Brompton Folding</font><br>")}
document.writeln("</font></div>")
}
function setContent()
{
	var argc = arguments.length;
	var argv = arguments;
	var title;
	var bikeTable = new Array();
	if (argc>0)
	{
		bikeTable = argv[0];
	}
	if (argc>1)
	{
		title = argv[1];
	}
	else
	{
		title = "<b>Price:</b> £"
	}
	for (c=0;c<bikeTable.length;c++)
	{
		var text = title + eval("p"+bikeTable[c])
		changeContent('x'+bikeTable[c],text)
	}
}

function setContent1()
{
	var argc = arguments.length;
	var argv = arguments;
	var title;
	var bikeTable = new Array();
	if (argc>0)
	{
		bikeTable = argv[0];
		zdummy = bikeTable[1]
	}

	for (c=0;c<bikeTable.length;c++)
	{
		var price = eval("p"+bikeTable[c]);
		var rrprice = eval("rrp"+bikeTable[c]);
		var sof = eval("so"+bikeTable[c]);
		var ctlink = eval("l"+bikeTable[c]);

		var text='';
		if (sof=='Y')
		{
			text = "<font color='red'><b>Sold Out</b></font> <a href='http://www.devercycles.co.uk/bikes-2005.asp?yr=05'>Click Here for 2005 Models</a>";
			text+="<p><b>Price:</b> £" + price + "</p>";
		}
		else
		{
			if (rrprice==price)
			{
				text="<p><b>Price:</b> £" + rrprice + "</p>";
				text += "<a href='http://www.devercycles.co.uk/bikes-2005.asp?yr=05'>Click Here for 2005 Models</a>";
				
				//text= text +"<p><input type='button' name='"+bikeTable[c]+"' value='Buy Item' onClick=\"javascript: w=window.open('dever_eshop.asp?pc="+bikeTable[c]+"','eshop','HEIGHT=300,WIDTH=700');w.focus()\"></p>";
			}
			if (rrprice>price)
			{
				
				text="<p><s><b>Price:</b> £" + rrprice + "</s></p>";
				text+="<p><b>Price:</b> £" + price + "</p>";
				text += "<a href='http://www.devercycles.co.uk/bikes-2005.asp?yr=05'>Click Here for 2005 Models</a>";				
				//text+="<p><input type='button' name='"+bikeTable[c]+"' value='Buy Item' onClick=\"javascript: w=window.open('dever_eshop.asp?pc="+bikeTable[c]+"','eshop','HEIGHT=300,WIDTH=700');w.focus()\"></p>";			
				
			}
			if (rrprice<price)
			{
				
				text="<p><b>Price:</b> £" + price + "</p>";				
				//text+="<p><input type='button' name='"+bikeTable[c]+"' value='Buy Item' onClick=\"javascript: w=window.open('dever_eshop.asp?pc="+bikeTable[c]+"','eshop','HEIGHT=300,WIDTH=700');w.focus()\"></p>";			
				
			}
			if (ctlink != 0)
			{
				
				text+="<p><input type='button' name='l"+bikeTable[c]+"' value='Buy Item' onClick=\"location.href ='"+ctlink+"'\"></p>";
			}		
		}
		changeContent('x'+bikeTable[c],text)
	}
}

function changeContent(what,text) {
	var x;	
    if (document.all)
    {
        x = eval('document.all.'+what);
        x.innerHTML = text;
		
    }
    if (parseInt(navigator.appVersion)>=5 && navigator.appName=="Netscape")
    {
             document.getElementById(what).style.position='relative'
             x= document.getElementById(what)
             x.innerHTML = text;
    }
   else
          {
                   if (document.layers && netscapeWarn==0)
               {
			   		
                     alert('Dynamic price update does not work with this version of netscape\n For details click on the yellow Pound(£)')
					 netscapeWarn=1;
					 //x = eval("document.layers['"+what+"']");
                     //x.document.open();
                     //x.document.write(text);
                     //x.document.close();
               }
           }
}
// The constructor function: creates a cookie object for the specified
// document, with a specified name and optional attributes.
// Arguments:
//   document: The Document object that the cookie is stored for. Required.
//   name:     A string that specifies a name for the cookie. Required.
//   hours:    An optional number that specifies the number of hours from now
//             that the cookie should expire.
//   path:     An optional string that specifies the cookie path attribute.
//   domain:   An optional string that specifies the cookie domain attribute.
//   secure:   An optional Boolean value that, if true, requests a secure cookie.
//
function Cookie(document, name, hours, path, domain, secure)
{
    // All the predefined properties of this object begin with '$'
    // to distinguish them from other properties which are the values to
    // be stored in the cookie.
    this.$document = document;
    this.$name = name;
    if (hours)
        this.$expiration = new Date((new Date()).getTime() + hours*3600000);
    else this.$expiration = null;
    if (path) this.$path = path; else this.$path = null;
    if (domain) this.$domain = domain; else this.$domain = null;
    if (secure) this.$secure = true; else this.$secure = false;
}

// This function is the store() method of the Cookie object.
function _Cookie_store()
{
    // First, loop through the properties of the Cookie object and
    // put together the value of the cookie. Since cookies use the
    // equals sign and semicolons as separators, we'll use colons
    // and ampersands for the individual state variables we store
    // within a single cookie value. Note that we escape the value
    // of each state variable, in case it contains punctuation or other
    // illegal characters.
    var cookieval = "";
    for(var prop in this) {
        // Ignore properties with names that begin with '$' and also methods.
        if ((prop.charAt(0) == '$') || ((typeof this[prop]) == 'function'))
            continue;

        if (cookieval != "") cookieval += '&';
        cookieval += prop + ':' + escape(this[prop]);
    }

    // Now that we have the value of the cookie, put together the
    // complete cookie string, which includes the name and the various
    // attributes specified when the Cookie object was created.
    var cookie = this.$name + '=' + cookieval;
    if (this.$expiration)
        cookie += '; expires=' + this.$expiration.toGMTString();
    if (this.$path) cookie += '; path=' + this.$path;
    if (this.$domain) cookie += '; domain=' + this.$domain;
    if (this.$secure) cookie += '; secure';

    // Now store the cookie by setting the magic Document.cookie property.
    this.$document.cookie = cookie;
}
// This function is the load() method of the Cookie object.
function _Cookie_load()
{
    // First, get a list of all cookies that pertain to this document.
    // We do this by reading the magic Document.cookie property.
    var allcookies = this.$document.cookie;
    if (allcookies == "") return false;

    // Now extract just the named cookie from that list.
    var start = allcookies.indexOf(this.$name + '=');
    if (start == -1) return false;   // Cookie not defined for this page.
    start += this.$name.length + 1;  // Skip name and equals sign.
    var end = allcookies.indexOf(';', start);
    if (end == -1) end = allcookies.length;
    var cookieval = allcookies.substring(start, end);

    // Now that we've extracted the value of the named cookie, we've
    // got to break that value down into individual state variable
    // names and values. The name/value pairs are separated from each
    // other by ampersands, and the individual names and values are
    // separated from each other by colons. We use the split method
    // to parse everything.
    var a = cookieval.split('&');    // Break it into array of name/value pairs.
    for(var i=0; i < a.length; i++)  // Break each pair into an array.
        a[i] = a[i].split(':');

    // Now that we've parsed the cookie value, set all the names and values
    // of the state variables in this Cookie object. Note that we unescape()
    // the property value, because we called escape() when we stored it.
    for(var i = 0; i < a.length; i++) {
        this[a[i][0]] = unescape(a[i][1]);
    }

    // We're done, so return the success code.
    return true;
}

// This function is the remove() method of the Cookie object.
function _Cookie_remove()
{
    var cookie;
    cookie = this.$name + '=';
    if (this.$path) cookie += '; path=' + this.$path;
    if (this.$domain) cookie += '; domain=' + this.$domain;
    cookie += '; expires=Fri, 02-Jan-1970 00:00:00 GMT';

    this.$document.cookie = cookie;
}

// Create a dummy Cookie object, so we can use the prototype object to make
// the functions above into methods.
new Cookie();
Cookie.prototype.store = _Cookie_store;
Cookie.prototype.load = _Cookie_load;
Cookie.prototype.remove = _Cookie_remove;

//************************************************************//
//                Check user can accept cookies               //
//*************************************************************
function acceptCookie()
{
//Create Test Cookie Object
 objCookie = new Cookie(document,"xv1zqr990",240);
 objCookie.value = 'test';

 //If Cookie already exists see if we can delete it.
 if (objCookie.load())
 {
     objCookie.remove();
      if (objCookie.load())
      {
          return(false)
      }

 }
 objCookie.store();


 objNewCookie = new Cookie(document,"xv1zqr990",240);
 if(objNewCookie.load())
 {
   objNewCookie.remove();
   return(true);
 }
 else
 {
  objNewCookie.remove();
  return(false);
 }
}
// JavaScript Cookie Code
// Coding by Ammon Johns
// www.webmarketingplus.co.uk

function setTracker()
{
var cDomain = self.location.hostname;

if(cDomain.indexOf(".") < cDomain.lastIndexOf(".")){
  var domainOffset = cDomain.indexOf(".")+1
  cDomain = cDomain.substr(domainOffset);
}
	trackCookie = new Cookie(document, 'dvctracker', expHours, "/", cDomain);
if(!trackCookie.load() && document.referrer.indexOf(cDomain)==-1 && document.referrer!=""){
	var expHours = 90*24;
	var refdate = new Date();

	trackCookie.referrer = escape(document.referrer);
	trackCookie.refdate = escape(refdate.toGMTString());
	trackCookie.store();
	
	
	}
}
setTracker()

