// JavaScript Document
function StockDel(pItem)
<!--
{
var strIDs = 'Stock Message: '
{
if (pItem >= 2)
{
strIDs = 'Usually ships in 2 working days'
}
else
{
strIDs = 'Usually ships in 7 working days'
}
}
return strIDs
}
//-->

function checkrrp(pItem, qItem)
<!--
{

qItem = qItem.replace(/&#163;/, "")
qItem = qItem.replace(/&#46;/, ".")

if (pItem > "METQUOTEVAR:PRICEPROMPT")
{
	pItem = 0
}

if (pItem > qItem)
{
return document.write("RRP: £" + pItem + " ");
}

}
//-->



function Savings(pItem, qItem)
<!--
{

qItem = qItem.replace(/&#163;/g, "")
qItem = qItem.replace(/&#46;/g, ".")

save = pItem - qItem

save = FormatNumber(save,2)

if (save > 5)
{
return document.write("So You Save: £" + save)
}
}
//-->

function Percent(pItem, qItem)
<!--
{

qItem = qItem.replace(/&#163;/g, "")
qItem = qItem.replace(/&#46;/g, ".")

percent = 100 - ((qItem/pItem)*100)

percent = FormatPercent(percent,0)

if (percent >= 5)
{
return document.write("(" + percent + "%)")
}

}
//-->

function FormatNumber(expr, decplaces)
<!--
{
var str = "" + Math.round(eval(expr) * Math.pow(10,decplaces));

while (str.length <= decplaces)
{
str = "0" + str;
}

var decpoint = str.length - decplaces;

return str.substring(0,decpoint) + "." + str.substring(decpoint, str.length);
} //End function FormatNumber-->

function FormatPercent(expr, decplaces)
<!--
{
var str2 = "" + Math.round(eval(expr) * Math.pow(10,decplaces));

while (str2.length <= decplaces)
{
str2 = "0" + str2;
}

var decpoint = str2.length - decplaces;

return str2.substring(0,decpoint)
} //End function FormatNumber-->
