function calccircleprice()
{
A = document.frmtwo.quantity.value
B = document.frmtwo.itemname2.value
C = 0.05+((B * B)*0.0004)
D = C

if (A<5) {document.frmtwo.price.value = D.toFixed(2)}
if (A > 4) {document.frmtwo.price.value = (D*0.8).toFixed(2)}
if (A > 9) {document.frmtwo.price.value = (D*0.7).toFixed(2)}
if (A > 24) {document.frmtwo.price.value = (D*0.6).toFixed(2)}
if (A > 49) {document.frmtwo.price.value = (D*0.5).toFixed(2)}
if (A > 99) {document.frmtwo.price.value = (D*0.4).toFixed(2)}
if (A > 249) {document.frmtwo.price.value = (D*0.3).toFixed(2)}
if (A > 499) {document.frmtwo.price.value = (D*0.2).toFixed(2)}
if (A > 999) {document.frmtwo.price.value = ((D*0.1)+(0.05)).toFixed(2)}

Z = document.frmtwo.price.value

document.frmtwo.total.value = (Z*A).toFixed(2)

}




function cdcalculate()
{

A = document.frmCD.quantity.value
B = document.frmCD.X1quantity.value
C = document.frmCD.X2quantity.value
D = document.frmCD.X3quantity.value
E = document.frmCD.X4quantity.value
F = document.frmCD.X5quantity.value
G = document.frmCD.X6quantity.value
H = document.frmCD.X7quantity.value
I = document.frmCD.X8quantity.value
J = document.frmCD.X9quantity.value

K = (A * 1) + (B * 1) + (C * 1) + (D * 1) + (E * 1) + (F * 1) + (G * 1) + (H * 1) + (I * 1) + (J * 1);

if (K<5) {document.frmCD.price.value = 10.00.toFixed(2)}
if ((K > 4) && (K < 10)) {document.frmCD.price.value = 2.70.toFixed(2)}
if ((K > 9) && (K < 25)) {document.frmCD.price.value = 1.70.toFixed(2)}
if ((K > 24) && (K < 50)) {document.frmCD.price.value = 1.40.toFixed(2)}
if ((K > 49) && (K < 100)) {document.frmCD.price.value = 1.20.toFixed(2)}
if (K>99) {document.frmCD.price.value = 0.90.toFixed(2)}


if (K<5) {document.frmCD.X1price.value = 10.00.toFixed(2)}
if ((K > 4) && (K < 10)) {document.frmCD.X1price.value = 2.70.toFixed(2)}
if ((K > 9) && (K < 25)) {document.frmCD.X1price.value = 1.70.toFixed(2)}
if ((K > 24) && (K < 50)) {document.frmCD.X1price.value = 1.40.toFixed(2)}
if ((K > 49) && (K < 100)) {document.frmCD.X1price.value = 1.20.toFixed(2)}
if (K>99) {document.frmCD.X1price.value = 0.90.toFixed(2)}


if (K<5) {document.frmCD.X2price.value = 10.00.toFixed(2)}
if ((K > 4) && (K < 10)) {document.frmCD.X2price.value = 2.70.toFixed(2)}
if ((K > 9) && (K < 25)) {document.frmCD.X2price.value = 1.70.toFixed(2)}
if ((K > 24) && (K < 50)) {document.frmCD.X2price.value = 1.40.toFixed(2)}
if ((K > 49) && (K < 100)) {document.frmCD.X2price.value = 1.20.toFixed(2)}
if (K>99) {document.frmCD.X2price.value = 0.90.toFixed(2)}


if (K<5) {document.frmCD.X3price.value = 10.00.toFixed(2)}
if ((K > 4) && (K < 10)) {document.frmCD.X3price.value = 2.70.toFixed(2)}
if ((K > 9) && (K < 25)) {document.frmCD.X3price.value = 1.70.toFixed(2)}
if ((K > 24) && (K < 50)) {document.frmCD.X3price.value = 1.40.toFixed(2)}
if ((K > 49) && (K < 100)) {document.frmCD.X3price.value = 1.20.toFixed(2)}
if (K>99) {document.frmCD.X3price.value = 0.90.toFixed(2)}


if (K<5) {document.frmCD.X4price.value = 10.00.toFixed(2)}
if ((K > 4) && (K < 10)) {document.frmCD.X4price.value = 2.70.toFixed(2)}
if ((K > 9) && (K < 25)) {document.frmCD.X4price.value = 1.70.toFixed(2)}
if ((K > 24) && (K < 50)) {document.frmCD.X4price.value = 1.40.toFixed(2)}
if ((K > 49) && (K < 100)) {document.frmCD.X4price.value = 1.20.toFixed(2)}
if (K>99) {document.frmCD.X4price.value = 0.90.toFixed(2)}


if (K<5) {document.frmCD.X5price.value = 10.00.toFixed(2)}
if ((K > 4) && (K < 10)) {document.frmCD.X5price.value = 2.70.toFixed(2)}
if ((K > 9) && (K < 25)) {document.frmCD.X5price.value = 1.70.toFixed(2)}
if ((K > 24) && (K < 50)) {document.frmCD.X5price.value = 1.40.toFixed(2)}
if ((K > 49) && (K < 100)) {document.frmCD.X5price.value = 1.20.toFixed(2)}
if (K>99) {document.frmCD.X5price.value = 0.90.toFixed(2)}


if (K<5) {document.frmCD.X6price.value = 10.00.toFixed(2)}
if ((K > 4) && (K < 10)) {document.frmCD.X6price.value = 2.70.toFixed(2)}
if ((K > 9) && (K < 25)) {document.frmCD.X6price.value = 1.70.toFixed(2)}
if ((K > 24) && (K < 50)) {document.frmCD.X6price.value = 1.40.toFixed(2)}
if ((K > 49) && (K < 100)) {document.frmCD.X6price.value = 1.20.toFixed(2)}
if (K>99) {document.frmCD.X6price.value = 0.90.toFixed(2)}


if (K<5) {document.frmCD.X7price.value = 10.00.toFixed(2)}
if ((K > 4) && (K < 10)) {document.frmCD.X7price.value = 2.70.toFixed(2)}
if ((K > 9) && (K < 25)) {document.frmCD.X7price.value = 1.70.toFixed(2)}
if ((K > 24) && (K < 50)) {document.frmCD.X7price.value = 1.40.toFixed(2)}
if ((K > 49) && (K < 100)) {document.frmCD.X7price.value = 1.20.toFixed(2)}
if (K>99) {document.frmCD.X7price.value = 0.90.toFixed(2)}


if (K<5) {document.frmCD.X8price.value = 10.00.toFixed(2)}
if ((K > 4) && (K < 10)) {document.frmCD.X8price.value = 2.70.toFixed(2)}
if ((K > 9) && (K < 25)) {document.frmCD.X8price.value = 1.70.toFixed(2)}
if ((K > 24) && (K < 50)) {document.frmCD.X8price.value = 1.40.toFixed(2)}
if ((K > 49) && (K < 100)) {document.frmCD.X8price.value = 1.20.toFixed(2)}
if (K>99) {document.frmCD.X8price.value = 0.90.toFixed(2)}


if (K<5) {document.frmCD.X9price.value = 10.00.toFixed(2)}
if ((K > 4) && (K < 10)) {document.frmCD.X9price.value = 2.70.toFixed(2)}
if ((K > 9) && (K < 25)) {document.frmCD.X9price.value = 1.70.toFixed(2)}
if ((K > 24) && (K < 50)) {document.frmCD.X9price.value = 1.40.toFixed(2)}
if ((K > 49) && (K < 100)) {document.frmCD.X9price.value = 1.20.toFixed(2)}
if (K>99) {document.frmCD.X9price.value = 0.90.toFixed(2)}

}


function ignoreSpaces(string)
{
var temp = "";
string = '' + string;
splitstring = string.split(" ");
for(i = 0; i < splitstring.length; i++)
temp += splitstring[i];
return temp;
}


var r={
  'special':/[\W]/g,
  'quotes':/['\''&'\"']/g,
  'notnumbers':/[^\d]/g
}

function valid(o,w){
  o.value = o.value.replace(r[w],'');
}

function countit(what)
{

//Character count script- by javascriptkit.com
//Visit JavaScript Kit (http://javascriptkit.com) for script
//Credit must stay intact for use

formcontent=what.form.itemname7.value
what.form.quantity.value=formcontent.length

}


function calchipslett()
{
A = formcontent.length
B = document.frmtwo.itemname3.value
C = ((B*B)*0.00004)+0.15
D = C.toFixed(2)
E = A*D
document.frmtwo.price.value = D
document.frmtwo.total.value = E.toFixed(2)
}

function Alert ()  {
alert ("Thanks very much for your order. PLEASE NOTE WE WILL NOT BE ABLE TO SEND THIS UNTIL AFTER MAY 3rd DUE TO OUR ANNUAL EASTER BREAK!!");
}

function Alertthanks ()  {
alert ("Thank-you - This item has been added to your shopping cart");
}


   function ticking()

	{

	var  getform = document.forms['movements'];
	
	var getshort = getform.elements['shortspindle'];
	var getmedium = getform.elements['mediumspindle'];
	var getlong = getform.elements['longspindle'];
		
	var shortspindle = getshort.value;
	var mediumspindle = getmedium.value;
	var longspindle = getlong.value;
		
	var b = shortspindle*1;
	var c = mediumspindle*1;
	var d = longspindle*1;
	
	var E = (b+c+d);
	
	var total = E;   	
	   	
   	
   	document.frmtwo.quantity.value = E;
   	
   	
	if (E<5) {document.frmtwo.price.value = 10.00.toFixed(2)}
	if ((E > 4) && (E < 10)) {document.frmtwo.price.value = 2.60.toFixed(2)}
	if ((E > 9) && (E < 25)) {document.frmtwo.price.value = 1.60.toFixed(2)}
	if ((E > 24) && (E < 50)) {document.frmtwo.price.value = 1.30.toFixed(2)}
	if ((E > 49) && (E < 100)) {document.frmtwo.price.value = 1.10.toFixed(2)}
	if ((E > 99) && (E < 250)) {document.frmtwo.price.value = 0.80.toFixed(2)}
	if ((E > 249) && (E < 500)) {document.frmtwo.price.value = 0.75.toFixed(2)}
	if (E>499) {document.frmtwo.price.value = 0.70.toFixed(2)}
	
	
	
	alert("You have ordered: " + E  + " TICKING clock movements - please check that your selection has been correctly added to the shopping cart then click the continue shopping button to order " + E +  " free sets of hands. ")	
	
	} 		
	
	
	function sweep()

	{

	var  getform = document.forms['movements'];
	
	var getshort = getform.elements['shortspindle'];
	var getmedium = getform.elements['mediumspindle'];
	var getlong = getform.elements['longspindle'];
		
	var shortspindle = getshort.value;
	var mediumspindle = getmedium.value;
	var longspindle = getlong.value;
		
	var b = shortspindle*1;
	var c = mediumspindle*1;
	var d = longspindle*1;
	
	var E = (b+c+d);
	
	var total = E;   	
	   	
   	
   	document.frmtwo.quantity.value = E;
   	
   	
	if (E<5) {document.frmtwo.price.value = 10.00.toFixed(2)}
	if ((E > 4) && (E < 10)) {document.frmtwo.price.value = 2.70.toFixed(2)}
	if ((E > 9) && (E < 25)) {document.frmtwo.price.value = 1.70.toFixed(2)}
	if ((E > 24) && (E < 50)) {document.frmtwo.price.value = 1.40.toFixed(2)}
	if ((E > 49) && (E < 100)) {document.frmtwo.price.value = 1.20.toFixed(2)}
	if ((E > 99) && (E < 250)) {document.frmtwo.price.value = 0.85.toFixed(2)}
	if ((E > 249) && (E < 500)) {document.frmtwo.price.value = 0.80.toFixed(2)}
	if (E>499) {document.frmtwo.price.value = 0.75.toFixed(2)}
	
	
	
	alert("You have ordered: " + E  + " SWEEP Non Ticking clock movements - please check that your selection has been correctly added to the shopping cart then click the continue shopping button to order " + E +  " free sets of hands. ")	
	
	} 		
	
		
	function calcsweepmovements()

	{

	A = document.frmtwo.quantity.value
	
	E = (A*1);

	if (E<5) {document.frmtwo.price.value = 10.00.toFixed(2)}
	if ((E > 4) && (E < 10)) {document.frmtwo.price.value = 2.70.toFixed(2)}
	if ((E > 9) && (E < 25)) {document.frmtwo.price.value = 1.70.toFixed(2)}
	if ((E > 24) && (E < 50)) {document.frmtwo.price.value = 1.40.toFixed(2)}
	if ((E > 49) && (E < 100)) {document.frmtwo.price.value = 1.20.toFixed(2)}
	if ((E > 99) && (E < 250)) {document.frmtwo.price.value = 0.85.toFixed(2)}
	if ((E > 249) && (E < 500)) {document.frmtwo.price.value = 0.80.toFixed(2)}
	if (E>499) {document.frmtwo.price.value = 0.75.toFixed(2)}
	
	}


function calcmovements()
{

A = document.frmtwo.quantity.value
B = document.frmtwo.X1quantity.value
C = document.frmtwo.X2quantity.value
D = document.frmtwo.X3quantity.value

E = (A * 1) + (B * 1) + (C * 1) + (D * 1);

if (E<5) {document.frmtwo.price.value = 10.00.toFixed(2)}
if ((E > 4) && (E < 10)) {document.frmtwo.price.value = 2.60.toFixed(2)}
if ((E > 9) && (E < 25)) {document.frmtwo.price.value = 1.60.toFixed(2)}
if ((E > 24) && (E < 50)) {document.frmtwo.price.value = 1.30.toFixed(2)}
if ((E > 49) && (E < 100)) {document.frmtwo.price.value = 1.10.toFixed(2)}
if ((E > 99) && (E < 250)) {document.frmtwo.price.value = 0.80.toFixed(2)}
if ((E > 249) && (E < 500)) {document.frmtwo.price.value = 0.75.toFixed(2)}
if (E>499) {document.frmtwo.price.value = 0.70.toFixed(2)}


if (E<5) {document.frmtwo.X1price.value = 10.00.toFixed(2)}
if ((E > 4) && (E < 10)) {document.frmtwo.X1price.value = 2.60.toFixed(2)}
if ((E > 9) && (E < 25)) {document.frmtwo.X1price.value = 1.60.toFixed(2)}
if ((E > 24) && (E < 50)) {document.frmtwo.X1price.value = 1.30.toFixed(2)}
if ((E > 49) && (E < 100)) {document.frmtwo.X1price.value = 1.10.toFixed(2)}
if ((E > 99) && (E < 250)) {document.frmtwo.X1price.value = 0.80.toFixed(2)}
if ((E > 249) && (E < 500)) {document.frmtwo.X1price.value = 0.75.toFixed(2)}
if (E>499) {document.frmtwo.X1price.value = 0.70.toFixed(2)}


if (E<5) {document.frmtwo.X2price.value = 10.00.toFixed(2)}
if ((E > 4) && (E < 10)) {document.frmtwo.X2price.value = 2.60.toFixed(2)}
if ((E > 9) && (E < 25)) {document.frmtwo.X2price.value = 1.60.toFixed(2)}
if ((E > 24) && (E < 50)) {document.frmtwo.X2price.value = 1.30.toFixed(2)}
if ((E > 49) && (E < 100)) {document.frmtwo.X2price.value = 1.10.toFixed(2)}
if ((E > 99) && (E < 250)) {document.frmtwo.X2price.value = 0.80.toFixed(2)}
if ((E > 249) && (E < 500)) {document.frmtwo.X2price.value = 0.75.toFixed(2)}
if (E>499) {document.frmtwo.X2price.value = 0.70.toFixed(2)}


if (E<5) {document.frmtwo.X3price.value = 11.00.toFixed(2)}
if ((E > 4) && (E < 10)) {document.frmtwo.X3price.value = 3.60.toFixed(2)}
if ((E > 9) && (E < 25)) {document.frmtwo.X3price.value = 2.60.toFixed(2)}
if ((E > 24) && (E < 50)) {document.frmtwo.X3price.value = 2.30.toFixed(2)}
if ((E > 49) && (E < 100)) {document.frmtwo.X3price.value = 2.10.toFixed(2)}
if ((E > 99) && (E < 250)) {document.frmtwo.X3price.value = 1.80.toFixed(2)}
if ((E > 249) && (E < 500)) {document.frmtwo.X3price.value = 1.75.toFixed(2)}
if (E>499) {document.frmtwo.X3price.value = 1.70.toFixed(2)}

}




function calcacrylic()
{
A = document.frmtwo.itemname2.value
B = document.frmtwo.itemname3.value
C = 1+((A * B)*0.00004)
document.frmtwo.price.value = C.toFixed(2)
}


function calcacrshape()
{
A = document.frmtwo.itemname2.value
B = document.frmtwo.itemname3.value
C = 1+((A * B)*0.00015)
document.frmtwo.price.value = C.toFixed(2)
}


function verify() {
var themessage = "Please enter the";
if (document.frmtwo.itemname2.value=="") {
themessage = themessage + " length";
}
if (document.frmtwo.itemname3.value=="") {
themessage = themessage + " width";
}
//alert if fields are empty and cancel form submit
if (themessage == "Please enter the") {
document.frmtwo.submit();
}
else {
alert(themessage);
return false;
   }
}

function calcsign()
{
A = document.frmtwo.itemname2.value
B = document.frmtwo.itemname3.value
C = 9+((A * B)*0.00005)
document.frmtwo.price.value = C.toFixed(2)
}

function calcpvclett()
{
A = formcontent.length
B = document.frmtwo.itemname3.value
C = ((B*B)*0.0000233221)+0.15
D = C.toFixed(2)
E = A*D
document.frmtwo.price.value = D
document.frmtwo.total.value = E.toFixed(2)
}

function calchipsshape()
{
A = document.frmtwo.itemname2.value
B = document.frmtwo.itemname3.value
C = 1+((A * B)*0.00003)
document.frmtwo.price.value = C.toFixed(2)
}

function calcpvcsignsheet()
{
A = document.frmtwo.itemname2.value
B = document.frmtwo.itemname3.value
C = 7+((A * B)*0.00003)
document.frmtwo.price.value = C.toFixed(2)
}


function addEvent(elm, evType, fn, useCapture){if(elm.addEventListener){elm.addEventListener(evType, fn, useCapture);return true;}else if (elm.attachEvent){var r = elm.attachEvent('on' + evType, fn);return r;}else{elm['on' + evType] = fn;}}
			var newWindow = null;

			function closeWin(){
				if (newWindow != null){
					if(!newWindow.closed)
						newWindow.close();
				}
			}

			function popUpWin(url, type, strWidth, strHeight){

				closeWin();

				type = type.toLowerCase();

				if (type == "fullscreen"){
					strWidth = screen.availWidth;
					strHeight = screen.availHeight;
				}
				var tools="";
				if (type == "standard") tools = "resizable,toolbar=yes,location=yes,scrollbars=yes,menubar=yes,width="+strWidth+",height="+strHeight+",top=0,left=0";
				if (type == "console" || type == "fullscreen") tools = "resizable,toolbar=no,location=no,scrollbars=no,width="+strWidth+",height="+strHeight+",left=0,top=0";
				newWindow = window.open(url, "newWin", tools);
				newWindow.focus();
			}

			function doPopUp(e)
			{
			//set defaults - if nothing in rel attrib, these will be used
			var t = "standard";
			var w = "780";
			var h = "580";
			//look for parameters
			attribs = this.rel.split(" ");
			if (attribs[1]!=null) {t = attribs[1];}
			if (attribs[2]!=null) {w = attribs[2];}
			if (attribs[3]!=null) {h = attribs[3];}
			//call the popup script
			popUpWin(this.href,t,w,h);
			//cancel the default link action if pop-up activated
			if (window.event) 
				{
				window.event.returnValue = false;
				window.event.cancelBubble = true;
				} 
			else if (e) 
				{
				e.stopPropagation();
				e.preventDefault();
				}
			}

			function findPopUps()
			{
			var popups = document.getElementsByTagName("a");
			for (i=0;i<popups.length;i++)
				{
				if (popups[i].rel.indexOf("popup")!=-1)
					{
					// attach popup behaviour
					popups[i].onclick = doPopUp;
					// add popup indicator
					if (popups[i].rel.indexOf("noicon")==-1)
						{
						popups[i].style.backgroundImage = "url(pop-up.gif)";
						popups[i].style.backgroundPosition = "0 center";
						popups[i].style.backgroundRepeat = "no-repeat";
						popups[i].style.paddingLeft = "15px";
						}
					// add info to title attribute to alert fact that it's a pop-up window
					popups[i].title = popups[i].title + " [Opens in pop-up window]";
					}
				}
			}

			addEvent(window, "load", findPopUps, false);<!-- #EndEditable -->


