var mikExp = "-";
/*
function doanothercheck(form) {

	if(form.value.search(mikExp) == -1) {
		//correct
		return true;
		//return false;
	}
	else {
		alert("Sorry, please enter ONLY numbers in the format xx.xx");
		form.select();
		form.focus();
		return false;
	}
*/
function dodacheck(val) {

	var strPass = val.value;
	var strLength = strPass.length;
	var lchar = val.value.charAt((strLength) - 1);

	if(lchar.search(mikExp) != -1) {
		var tst = val.value.substring(0, (strLength) - 1);
		val.value = tst;
	   }

	}



function addValues(form) {

	var a = (form.price1.value != '') ? eval(form.price1.value) : 0;
	if (a<0){
	a = a * -1;
	}

	var j = (form.price2.value != '') ? eval(form.price2.value) : 0;
	if (j<0){
	j = j * -1;
	}
	
	var b = (form.priceh1.value != '') ? eval(form.priceh1.value) : 0;
	if (b<0){
	b = b * -1;
	}

	var c = (form.priceh2.value != '') ? eval(form.priceh2.value) : 0;
	if (c<0){
	c = c * -1;
	}

	var d = (form.pricea1.value != '') ? eval(form.pricea1.value) : 0;
	if (d<0){
	d = d * -1;
	}

	var e = (form.pricea2.value != '') ? eval(form.pricea2.value) : 0;
	if (e<0){
	e = e * -1;
	}

	var f = (form.pricea3.value != '') ? eval(form.pricea3.value) : 0;
	if (f<0){
	f = f * -1;
	}

	var g = (form.pricea4.value != '') ? eval(form.pricea4.value) : 0;
	if (g<0){
	g = g * -1;
	}

	var h = (form.pricea5.value != '') ? eval(form.pricea5.value) : 0;
	if (h<0){
	h = h * -1;
	}

	var i = (form.pricea6.value != '') ? eval(form.pricea6.value) : 0;
	if (i<0){
	i = i * -1;
	}
	
	var tot = a + b + c + d + e + f + g + h + i + j;

	form.total.value = tot.toFixed(2);
}

function submitform(myform)
{
  document.myform.submit();
}
	
function wopen(url)
{
	window.open (url,"Great Savings","location=0,status=1,scrollbars=0,width=300,height=650"); 
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function displaywarning()
{
	//Until such as time as we get a login page this will have to do
	var sPath = window.location.pathname;
	var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);

	if (sPage == "order.php")
	{
		alert('This section is for bike shop use only.\n\nIf you are an employee and would like to order a bike simply visit your local bike shop or shop online using the link from our Employee page');
	}

	if (sPage == "partners.php")
	{
	alert('To search for a specific bike shop, please type their name and choose region. To search for all the shops that we currently know, leave the bike shop name field blank and choose region from the dropdown list.');
	}


}
