<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='http://www.blackmouse.com/"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function MM_shopjumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='http://www.blackmousecl.com/bmshop/"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function  SetPostage(slcObj) {
var alertboxnames = ""

	document.myform.Postage.value=twoDecimalPlaces(slcObj.value)
	document.myform.GrandTotal.value = twoDecimalPlaces(Number(document.myform.NetTotal.value) + Number(document.myform.Postage.value))
	document.worldpay.PostageText.value=slcObj.options[slcObj.selectedIndex].text
	document.worldpay.Postage.value=document.myform.Postage.value
      if (document.worldpay.PostageText.value == "Overseas"){
		alert("We are unable at this time to confirm postage charges overseas." +   "\n"  +
			"Should you wish to proceed with your purchase please do so." +   "\n"  +
			"We will advise you of the postage cost prior to despatch and will " +   "\n"  +
			"Complete your order on receipt of the outstanding delivery payment" +   "\n" +   "\n"  +
			"Tel. +44 (0) 1159 559137 or Email overseas@blackmouse.co.uk")
      }



}

function buyit(idx) 
{ 
    qty = (eval("document.galleryform.qty" + idx + ".value"));
	StockCode= (eval("document.galleryform.StockCode" + idx + ".value"));
	strstr = "add_to_basket_1.asp?Qty=" + qty + "&StockCode=" + StockCode;
	location = strstr;


}

function  doMath(maxIdx) {


	cdeidx = 0
	cstidx = 1
	qtyidx = 2
	totidx = 3
	cols = 4
	NetTot = 0
	tstOK = true
	lastidx = maxIdx 


	while (cdeidx < lastidx) {

 		document.myform[totidx].value = twoDecimalPlaces(doMath_1(document.myform[cstidx].value,document.myform[qtyidx].value))


     	NetTot += Number(myform[totidx].value)
		cstidx += cols
		qtyidx += cols
		totidx += cols
		cdeidx += 1
	}
	document.myform.NetTotal.value = twoDecimalPlaces(NetTot) 
	document.myform.GrandTotal.value = twoDecimalPlaces(NetTot + Number(document.myform.Postage.value))


}

function doMath_1(qty,cost) {
	var prod = qty * cost
      
	return custRound(prod,2);
    	
}

function custRound(x,places) {
	return (Math.round(x*Math.pow(10,places)))/Math.pow(10,places)
}

function  doVAT() {
	var net = eval(document.myform.net.value)
	var vatRate = 1.175
	var prod = net  * vatRate
        var tot = custRound(prod,2)
        var vat = tot - net
        tot += Number(myform.postage.value)
        document.myform.GrandTotal.value=custRound(tot,2)
	document.myform.vat.value=custRound(vat,2)
}

function putFocus(formInst, elementInst) {
	if (document.forms.length > 0) {
		document.forms[formInst].elements[elementInst].focus();
	}
}
function twoDecimalPlaces(n) {
  var s = "" + Math.round(n * 100) / 100
  var i = s.indexOf('.')
  if (i < 0) return s + ".00"
  var t = s.substring(0, i + 1) + s.substring(i + 1, i + 3)
  if (i + 2 == s.length) t += "0"
  return t
}
function AddText(strItem,qtyName){
    var qty = qtyName.value
    if (qty > 4){
       qty = 4
    }
    var hgt = (235 + Math.round(qty *60));
	
 	var exe = "window.open('addtext1.asp?stockcode="+strItem+"&items="+qtyName.value+"','"+strItem.substr((strItem.length -3),strItem.length)+"','width=450,height="+hgt+",scrollbars=1')";

	eval(exe);

}
function Terms(){
 	var exe = "window.open('termsandcond.htm','Terms','title=Terms,resizable=yes,location=no,scrollbars=yes')";


	eval(exe);

}
function SeePrev(stritem){
		var idxof = stritem.indexOf('-',0) + 1

		var framname = stritem.substr(idxof,stritem.length)
 	 	var exe ="window.open('preview_1.asp?stockcode="+stritem+"','"+framname+"','width=550,height=600,scrollbars=1')";


	eval(exe);

}
function CheckForm(){

var fieldnames = new Array (7)
	fieldnames[0] = "Name "
	fieldnames[1] = "Address "
	fieldnames[2] = "Postcode "
	fieldnames[3] = "Telephone Number "

	var onoff=0
	var alertboxnames = ""

	var fields = new Array (7)
	fields[0] = document.forms['worldpay'].name.value.length
	fields[1] = document.forms['worldpay'].address.value.length
	fields[2] = document.forms['worldpay'].postcode.value.length
	fields[3] = document.forms['worldpay'].tel.value.length
	for (var i=0; i < fields.length; i++) {
	
        if (fields[i] == 0) {
    	
    	alertboxnames = alertboxnames + fieldnames[i] + "\n";
        
        onoff ++;
		}              
 
	}




    if(worldpay['terms'].checked != true) {
	alertboxnames = alertboxnames + "You Must accept the Terms and Conditions" + "\n";   
	onoff ++;   
    }
	
    if(worldpay['email'].value != worldpay['confemail'].value) {
	alertboxnames = alertboxnames + "Email does not match Confimation Email " + "\n";   
	onoff ++;   
    }

	if((worldpay['email'].value == "" || worldpay['email'].value.indexOf('@', 0) == -1) || worldpay['email'].value.indexOf('.') == -1) {  
	alertboxnames = alertboxnames + "valid email address " + "\n";   
	
	onoff ++;   
	} 


	if (onoff == 0) {
	
		return true
		
	} else {
	
		if (onoff == 1) {
		
			var catness = alertboxnames.substring (0, alertboxnames.indexOf("\n"));
		
			alert ("The following required field has been left blank or is incorrect:\n \n" + catness + "\n \nPlease correct this field before submitting your order.");

			} else {
			
			var catness = alertboxnames.substring (0, alertboxnames.length-2)
				
	        alert ("The following required fields have been left blank or are incorrect:\n \n" + catness + "\n \nPlease correct these fields before submitting your order."); 

			}
		
		return false
		
	}

}
	function mOvr(src,clrOver) {
		if (!src.contains(event.fromElement)) {
			src.style.cursor = 'hand';
			src.style.cursor = 'pointer';
			src.bgColor = clrOver;
		}
	}
	function mOut(src,clrIn) {
		if (!src.contains(event.toElement)) {
			src.style.cursor = 'default';
			src.bgColor = clrIn;
		}
	}

	function mClk(src) {
		if(event.srcElement.tagName=='TD'){
			src.children.tags('A')[0].click();
		}
	}
//-->