function defaultCal()
{
	document.frm.idtotal.value="AU$7.40";

}
function updatepos()
{
	if(document.getElementById("qty").value<=6)
	{
		deliv = document.getElementById("delivery").value;
		if(deliv < 4 && deliv > 2)
		{			//alert("if");
			document.getElementById("delivery").value="3.5"			
			document.getElementById("post_text").innerHTML='<span id = warning><p><strong><font color="#FF0000">Warning:</font></strong> NBA does not take any responsibility for the security of the postal<br>delivery if you select $3.50. <i><b>Payment by credit card only</b></i>.</p></span>';
			document.getElementById("radiobutton").style.visibility='visible';
		}
		else
		{// alert("else");
			document.getElementById("delivery").value="10"			
			document.getElementById("radiobutton").style.visibility='visible';
			
		}
		
	}
	else
	{ //alert("ifelse");
		document.getElementById("delivery").value="10"
		//document.getElementById("p_cost2").checked=true;
		document.getElementById("post_text").innerHTML='';
		document.getElementById("radiobutton").style.visibility='hidden';
	}
}
function updatepos_ch(cost)
{ //alert(cost)
	if(cost<=4)
	{
		document.getElementById("delivery").value="3.5"
		document.getElementById("p_cost1").selectedIndex=0;
		document.getElementById("post_text").innerHTML='<span id = warning><p><strong><font color="#FF0000">Warning:</font></strong> NBA does not take any responsibility for the security of the postal<br>delivery if you select $3.50. <b>Payment by credit card only</b>.</p></span>';
	}
	else
	{
		document.getElementById("delivery").value="10"
		document.getElementById("p_cost2").selectedIndex=1;
		document.getElementById("post_text").innerHTML='';
	}
}

function UpdatePreview()
{
var img;
	if (document.all["onlytext"].checked == true) {
		img ="only_text.jpg";
		document.frm.select_colour.options[0].selected=true;
		document.all["bac1"].src = "images/gold.gif";
		
		document.all["bcolor"].style.display = 'block';
		document.all["bcolorimg"].style.display = 'block';
		document.all["bcolortex"].style.display = 'none';
		document.all["bcolorimgtex"].style.display = 'none';
		document.all["bcolorflat"].style.display = 'none';
		document.all["bcolorimgflat"].style.display = 'none';
		document.all["bcolorbb"].style.display = 'none';
		document.all["bcolorimgbb"].style.display = 'none';
		document.all["bcolorlogo"].style.display = 'none';
		document.all["bcolorimglogo"].style.display = 'none';
		document.all["acr"].style.display = 'block';
		document.all["acr1"].style.display = 'block';
		//document.all["sw_clip"].style.display = 'block';
		document.frm.size.options[3] = new Option('Extra Large 50mm x 80mm','Extra Large 50mm x 80mm');
	}
	if (document.all["idlogotext"].checked == true){
		img = "logo_text.jpg";
		document.frm.select_colourlogo.options[0].selected=true;
		document.all["bac2"].src = "images/gold.gif";
		document.all["bcolor"].style.display = 'none';
		document.all["bcolorimg"].style.display = 'none';
		document.all["bcolortex"].style.display = 'none';
		document.all["bcolorimgtex"].style.display = 'none';
		document.all["bcolorflat"].style.display = 'none';
		document.all["bcolorimgflat"].style.display = 'none';
		document.all["bcolorbb"].style.display = 'none';
		document.all["bcolorimgbb"].style.display = 'none';
		document.all["bcolorlogo"].style.display = 'block';
		document.all["bcolorimglogo"].style.display = 'block';
		document.all["acr"].style.display = 'block';
		document.all["acr1"].style.display = 'block';
		//document.all["sw_clip"].style.display = 'block';
		document.frm.size.options[3] = new Option('Extra Large 50mm x 80mm','Extra Large 50mm x 80mm');
	}
	if (document.all["idlogo"].checked == true){
		img = "logo_only_badge.jpg";
		document.frm.select_colourlogo.options[0].selected=true;
		document.all["bac2"].src = "images/gold.gif";
		document.all["bcolor"].style.display = 'none';
		document.all["bcolorimg"].style.display = 'none';
		document.all["bcolortex"].style.display = 'none';
		document.all["bcolorimgtex"].style.display = 'none';
		document.all["bcolorflat"].style.display = 'none';
		document.all["bcolorimgflat"].style.display = 'none';
		document.all["bcolorbb"].style.display = 'none';
		document.all["bcolorimgbb"].style.display = 'none';
		document.all["bcolorlogo"].style.display = 'block';
		document.all["bcolorimglogo"].style.display = 'block';
		document.all["acr"].style.display = 'block';
		document.all["acr1"].style.display = 'block';
		//document.all["sw_clip"].style.display = 'block';
		document.frm.size.options[3] = new Option('Extra Large 50mm x 80mm','Extra Large 50mm x 80mm');
	}
	if (document.all["idblankbadge"].checked == true){
		img = "badge_blank.gif";
		document.frm.select_colourlogo.options[0].selected=true;
		document.all["bac6"].src = "images/gold.gif";
		document.all["bcolor"].style.display = 'none';
		document.all["bcolorimg"].style.display = 'none';
		document.all["bcolortex"].style.display = 'none';
		document.all["bcolorimgtex"].style.display = 'none';
		document.all["bcolorflat"].style.display = 'none';
		document.all["bcolorimgflat"].style.display = 'none';
		document.all["bcolorlogo"].style.display = 'none';
		document.all["bcolorimglogo"].style.display = 'none';
		document.all["acr"].style.display = 'block';
		document.all["acr1"].style.display = 'block';
		document.all["bcolorbb"].style.display = 'block';
		document.all["bcolorimgbb"].style.display = 'block';
		//document.all["sw_clip"].style.display = 'block';
		document.frm.size.options[3] = new Option('Extra Large 50mm x 80mm','Extra Large 50mm x 80mm');
	}
	if (document.all["idtexturefinish"].checked == true) {
		img = "texture_finishing_badge.jpg";
		document.all["bac3"].src = "images/bb_navy.jpg";
		document.all["bcolor"].style.display = 'none';
		document.all["bcolorimg"].style.display = 'none';		
		document.all["bcolorflat"].style.display = 'none';
		document.all["bcolorimgflat"].style.display = 'none';
		document.all["bcolorlogo"].style.display = 'none';
		document.all["bcolorimglogo"].style.display = 'none';
		document.all["bcolorbb"].style.display = 'none';
		document.all["bcolorimgbb"].style.display = 'none';
		document.all["acr"].style.display = 'none';
		document.all["acr1"].style.display = 'none';
		
		document.all["bcolortex"].style.display = 'block';
		document.all["bcolorimgtex"].style.display = 'block';
		//document.all["sw_clip"].style.display = 'none';
		document.frm.acrylic.checked=false;
		document.frm.size.options[3] = null;
	}
	if (document.all["idflatfinishing"].checked == true) {
		img = "flat_finishing_badge.gif";
		document.all["bac4"].src = "images/bb_gold.jpg";
		document.all["bcolor"].style.display = 'none';
		document.all["bcolorimg"].style.display = 'none';
		document.all["bcolortex"].style.display = 'none';
		document.all["bcolorimgtex"].style.display = 'none';				
		document.all["bcolorlogo"].style.display = 'none';
		document.all["bcolorimglogo"].style.display = 'none';
		document.all["bcolorbb"].style.display = 'none';
		document.all["bcolorimgbb"].style.display = 'none';
		document.all["acr"].style.display = 'none';
		document.all["acr1"].style.display = 'none';
		document.all["bcolorflat"].style.display = 'block';
		document.all["bcolorimgflat"].style.display = 'block';
		
		//document.all["sw_clip"].style.display = 'none';
		document.frm.acrylic.checked=false;
		document.frm.size.options[3] = null;
	}
	if (img == ""){ img = "blank"; }
//alert("images/" + img);
document.all["blank"].src = "images/" + img;

}
function calculate()
{ 
	quantity=document.frm.qty.value;
	if(quantity<=0)
	{
	alert("Please Enter Quantity greater than 0.")
	document.frm.qty.focus();
	}
	else if(isNaN(quantity))
	{
		alert("Please Enter Quantity in number.")
		document.frm.qty.focus();
	}
	else if(document.all["onlytext"].checked == false && document.all["idlogotext"].checked == false && document.all["idlogo"].checked == false && document.all["idblankbadge"].checked == false && document.all["idtexturefinish"].checked == false && document.all["idflatfinishing"].checked == false)
	{
		alert("Please select badge type");
		document.frm.qty.focus();
	}
	else
	{
	acryliccost=0.00;
	sizecost=0.00;
	setup_fee=0.00;
	
	Size=document.frm.size.value;
	for(var i=0;i<document.frm.fitting.length;i++)
	{
		if(document.frm.fitting[i].checked)
		Fitt=document.frm.fitting[i].value;
	}
	if(document.frm.acrylic.checked)
	acryliccost=2.20;
	deliverycost=eval(document.frm.delivery.value);
	
//.......For Set Up Fees.................................................
if( (document.all["idlogotext"].checked == true || document.all["idlogo"].checked == true) && quantity>0&&quantity<11)
{
    setup_fee=15.00;
}
//............................................................
	if(document.all["onlytext"].checked == true )
	{
		if(quantity>0&&quantity<11)
		{
		total=7.40;
		}
		if(quantity>=11&&quantity<=25)
		{
		total=6.90;
		}
		if(quantity>=26&&quantity<=50)
		{
		total=6.40;
		}
		if(quantity>=51&&quantity<=100)
		{
		total=5.90;
		}
		if(quantity>=101&&quantity<=500)
		{
		total=5.30;
		}
		if(quantity>=501&&quantity<=1000)
		{
		total=4.70;
		}
		if(quantity>=1001)
		{
		total=4.20;
		}
		
		//if(quantity>100)
		//{
		//total="P.O.A";
		//}
		/*if(quantity>=101&&quantity<=250)
		{
		total=5.90;
		}
		if(quantity>=251&&quantity<=500)
		{
		total=5.65;
		}*/
		if(Size=="Extra Large 50mm x 80mm" || Size=="Large 30mm x 80mm")
		sizecost=1.10;
	}
	else if(document.all["idlogotext"].checked == true)
	{
		if(quantity>0&&quantity<11)
		{
			total=7.40;
		}
		if(quantity>=11&&quantity<=25)
		{
			total=6.90;
		}
		if(quantity>=26&&quantity<=50)
		{
			total=6.40;
		}
		if(quantity>=51&&quantity<=100)
		{
			total=5.90;
		}
		if(quantity>=101&&quantity<=500)
		{
			total=5.30;
		}
		if(quantity>=501&&quantity<=1000)
		{
			total=4.70;
		}
		if(quantity>=1001)
		{
			total=4.20;
		}
		if(Size=="Extra Large 50mm x 80mm" || Size=="Large 30mm x 80mm")
			sizecost=1.10;
	
	}
	else if(document.all["idlogo"].checked == true)
	{
		if(quantity>0&&quantity<51)
		{
			total=4.20;
		}		
		if(quantity>=51&&quantity<=100)
		{
			total=3.60;
		}
		if(quantity>=101&&quantity<=500)
		{
			total=3.00;
		}
		if(quantity>=501&&quantity<=1000)
		{
			total=2.40;
		}
		if(quantity>=1001)
		{
			total=2.20;
		}
		if(Size=="Extra Large 50mm x 80mm" || Size=="Large 30mm x 80mm")
			sizecost=1.10;
	
	}
	else if(document.all["idblankbadge"].checked == true)
	{
	if(quantity>0&&quantity<51)
		{
		total=4.00;
		}
		if(quantity>=51&&quantity<=100)
		{
		total=3.30;
		}
		if(quantity>=101&&quantity<=500)
		{
		total=2.75;
		}
		if(quantity>=501&&quantity<=1000)
		{
		total=2.20;
		}
		if(quantity>=1001)
		{
		total=2.00;
		}		
		if(Size=="Extra Large 50mm x 80mm" || Size=="Large 30mm x 80mm")
		sizecost=1.10;
	
	
	}
	else if(document.all["idtexturefinish"].checked == true || document.all["idflatfinishing"].checked == true)
	{
		if(quantity>0&&quantity<26)
		{
		total=6.00;
		}
		if(quantity>=26&&quantity<=50)
		{
		total=5.75;
		}
		if(quantity>=51&&quantity<=100)
		{
		total=5.50;
		}
		if(quantity>100)
		{
		total="P.O.A";
		}
	}
	if(Fitt=="Magnet")
	fittingcost=2.00;
	else if(Fitt=="Swivel pin")
	fittingcost=1.00;
	else
	fittingcost=0.00;
		if(total=="P.O.A")
		{
			//alert("hi");
			document.frm.idtotal.value="P.O.A";
			document.frm.gtotal.value="P.O.A";
			document.frm.dcost.value="AU$"+deliverycost.toFixed(2);
			document.frm.tcost.value="P.O.A";
			document.all["order"].style.display = 'block';
			
		}
		else
		{
			//alert(deliverycost);
			Total=eval(total + fittingcost + acryliccost + sizecost).toFixed(2);
			grandtotal=eval(quantity*Total);
			totalcost=eval(deliverycost + grandtotal+setup_fee).toFixed(2);
			document.frm.idtotal.value="AU$"+Total;
			document.frm.gtotal.value="AU$"+grandtotal.toFixed(2);
			if(document.getElementById("p_cost2").checked==true || document.getElementById("p_cost1").checked==true || document.getElementById("qty").value>=6)
			{
				document.frm.dcost.value="AU$"+deliverycost.toFixed(2);
			}
			document.frm.setup.value="AU$"+setup_fee.toFixed(2);
			document.frm.tcost.value="AU$"+totalcost;
			document.all["order"].style.display = 'block';
		}
	}
}

			function show_layer()
			{
				var colour_code=document.frm.select_colour.options[document.frm.select_colour.selectedIndex].value;
					document.frm.select_colour.options[document.frm.select_colour.selectedIndex].selected=true;
					if(colour_code=="blank")
					{
						  img ="no_image_available.gif";
          			}
				else if(colour_code=="Gold Background")
					{
							img ="gold.gif";		
        			}
				else if(colour_code=="Silver Background")
					{
							img ="silver.gif";					
					}
			
			else if(colour_code=="White Background")
					{
							img ="white.gif";
					}
					
			else if(colour_code=="Black Background")
					{
							img ="black.gif";
					}
					else if(colour_code=="Red Background")
					{
							img ="red.gif";
					}
					else if(colour_code=="Yellow Background")
					{
							img ="yellow.gif";
					}
					else if(colour_code=="Light Blue Background")
					{
							img ="blue.gif";
					}
					else if(colour_code=="Dark Blue Background")
					{
							img ="blue2.gif";
					}
					else if(colour_code=="Maroon Background")
					{
							img ="maroon.gif";
					}
					else if(colour_code=="Light Green Background")
					{
							img ="green.gif";
					}
					else if(colour_code=="Dark Green Background")
					{
							img ="green2.gif";
					}		

		else
					{
							img ="no_image_available.gif";
					}

					document.all["bac1"].src = "images/" + img;


			}
			
function show_layer3()
			{
				
				var colour_code=document.frm.select_colourlogo.options[document.frm.select_colourlogo.selectedIndex].value;
				document.frm.select_colourlogo.options[document.frm.select_colourlogo.selectedIndex].selected=true;
					if(colour_code=="blank")
					{
						  img ="no_image_available.gif";
          			}
				else if(colour_code=="Gold Background")
					{
							img ="gold.gif";		
        			}
				else if(colour_code=="Silver Background")
					{
							img ="silver.gif";					
					}
			
			else if(colour_code=="White Background")
					{
							img ="white.gif";
					}
					
			else if(colour_code=="Black Background")
					{
							img ="black.gif";
					}
					else if(colour_code=="Red Background")
					{
							img ="red.gif";
					}
					else if(colour_code=="Yellow Background")
					{
							img ="yellow.gif";
					}
					else if(colour_code=="Light Blue Background")
					{
							img ="blue.gif";
					}
					else if(colour_code=="Dark Blue Background")
					{
							img ="blue2.gif";
					}
					else if(colour_code=="Maroon Background")
					{
							img ="maroon.gif";
					}
					else if(colour_code=="Light Green Background")
					{
							img ="green.gif";
					}
					else if(colour_code=="Dark Green Background")
					{
							img ="green2.gif";
					}		

		else
					{
							img ="no_image_available.gif";
					}

					document.all["bac2"].src = "images/" + img;


			}
			


function show_layer1()
			{
				var colour_code=document.frm.select_colour1.options[document.frm.select_colour1.selectedIndex].value;

					if(colour_code=="blank")
					{
						img ="no_image_available.gif";
        			}
				else if(colour_code=="Navy Blue / White (TEX B-W)")
					{
						img ="bb_navy.jpg";
        			}
					else if(colour_code=="Maroon / White (TEX M-W)")
					{
						img ="bb_mahroon.jpg";
        			}
					else if(colour_code=="Dark Green / White (TEX G-W)")
					{
						img ="bb_darkgreen.jpg";
        			}
					else if(colour_code=="Black / White (TEX B-W)")
					{
						img ="bb_black.jpg";
        			}
					else if(colour_code=="White / Black (TEX W-B)")
					{
						img ="bb_white.jpg";
        			}
					document.all["bac3"].src = "images/" + img;
				
		}
		function show_layerbb()
			{
				var colour_code=document.frm.select_colourbb.options[document.frm.select_colourbb.selectedIndex].value;

					if(colour_code=="blank")
					{
						  img ="no_image_available.gif";
          			}
				else if(colour_code=="Gold Background")
					{
							img ="gold.gif";		
        			}
				else if(colour_code=="Silver Background")
					{
							img ="silver.gif";					
					}
			
			else if(colour_code=="White Background")
					{
							img ="white.gif";
					}
					
					document.all["bac6"].src = "images/" + img;
				
		}
			
	function show_layer2()
			{
				var colour_code=document.frm.select_colour2.options[document.frm.select_colour2.selectedIndex].value;

					if(colour_code=="blank")
					{
						img ="no_image_available.gif";
        			}
				else if(colour_code=="Brushed Gold / Black text (BG-B)")
					{
						img ="bb_gold.jpg";
        			}
					else if(colour_code=="Brushed Silver / Black text (BS-B)")
					{
						img ="bb_silver.jpg";
        			}
					else if(colour_code=="Navy Blue / White text (DB-W)")
					{
						img ="bb_navy1.jpg";
        			}
					else if(colour_code=="Maroon / White text (M-W)")
					{
						img ="bb_mahroon1.jpg";
        			}
					else if(colour_code=="Dark Green / White text (G-W)")
					{
						img ="bb_darkgreen1.jpg";
        			}
					
					
					else if(colour_code=="Black / White text (B-W)")
					{
						img ="bb_black1.jpg";
        			}
					else if(colour_code=="White / Black text (W-B)")
					{
						img ="bb_white1.jpg";
        			}
					else if(colour_code=="Red / White text (R-W)")
					{
						img ="bb_red.jpg";
        			}
					else if(colour_code=="White/ Red text (W-R)")
					{
						img ="bb_white_red.jpg";
        			}
					else if(colour_code=="Yellow / Black text (Y-B)")
					{
						img ="bb_yellow.jpg";
        			}
					else if(colour_code=="White/ Blue text (W-B)")
					{
						img ="bb_white_blue.jpg";
        			}
					document.all["bac4"].src = "images/" + img;
				
		}
					

function Fitting()
{
	var fitting_code=document.frm.size.options[document.frm.size.selectedIndex].value;
	if (document.all["pi"].checked == true) {
		img ="brouch_pin.jpg";
	}
	if (document.all["bul"].checked == true){
		if(fitting_code=="Small 20mm x 64mm")
		{
			alert("Clip and Pin not available on small badges");
			document.all["bul"].checked = false;
			document.all["pi"].checked = true;
			img ="brouch_pin.jpg";
		}
		else
		{
			img ="bulldog_pin.jpg";
		}
	}
	if (document.all["mag"].checked == true) {
		img ="magnet1.jpg";
	}
/*	if (document.all["sw"].checked == true) {
		if(fitting_code=="Small 20mm x 64mm")
		{
			alert("Swivel Pin not available on small badges");
			document.all["bul"].checked = false;
			document.all["pi"].checked = true;
			img ="brouch_pin.jpg";
		}
		else
		{
			img ="swivel_pin.jpg";
		}
	}*/
	
	document.all["bac5"].src = "images/" + img;
}


function order()
{
	
	if(document.getElementById("p_cost2").checked==false && document.getElementById("p_cost1").checked==false && document.getElementById("qty").value<=6)
	{
		alert('Please choose the preferred method for postage and handling');
		document.getElementById("p_cost2").focus();
		return false;
	}
	document.frm.action="gen_cart_id.php";
		document.frm.submit();
	
}

function change() {
	
	var img;
	current = document.frm.font1.selectedIndex;

	if(document.frm.font1[current].value=="NA")
		document.all["im_line1"].style.display = 'none';
	else
		document.all["im_line1"].style.display = 'block';
	if (document.frm.font1[current].value == "Arial Bold") 
		img ="arial_bold.jpg";
	else if (document.frm.font1[current].value == "Cancun") 
		img ="cancun.gif";
	else if (document.frm.font1[current].value == "Century Gothic") 
		img ="century.jpg";
	else if (document.frm.font1[current].value == "Franklin Gothic ITC Heavy  BT") 
		img ="Franklin.jpg";
	else if (document.frm.font1[current].value == "Futura") 
		img ="futura.jpg";
	else if (document.frm.font1[current].value == "Futura MB BT Bold") 
		img ="futura_bold.jpg";
	else if (document.frm.font1[current].value == "Lyndian BT Bold") 
		img ="lyndian.jpg";
	else if (document.frm.font1[current].value == "Ribbon 131") 
		img ="ribbon.jpg";
	else if (document.frm.font1[current].value == "Script Mt Bold") 
		img ="script_mt.jpg";
	else if (document.frm.font1[current].value == "Souvenir Demi Bt") 
		img ="souvenir.jpg";
	else if (document.frm.font1[current].value == "Tahoma Bold") 
		img ="tahoma.jpg";
	else if (document.frm.font1[current].value == "Times New Roman") 
		img ="times_roma.jpg";
	else if (document.frm.font1[current].value == "Centry") 
		img ="budget_centry.jpg";
	else if (document.frm.font1[current].value == "Crayonet") 
		img ="budget_crayonet.jpg";
	else if (document.frm.font1[current].value == "Cursive") 
		img ="budget_cursive.jpg";
	else if (document.frm.font1[current].value == "Fifth") 
		img ="budget_fifth.jpg";
	else if (document.frm.font1[current].value == "Gotland") 
		img ="budget_gotland.jpg";
	else if (document.frm.font1[current].value == "Helvetica") 
		img ="budget_helvetica.jpg";
	else if (document.frm.font1[current].value == "Helvetica 3 Line") 
		img ="budget_helveticaline3.jpg";
	else if (document.frm.font1[current].value == "Manhatton") 
		img ="budget_manhatton.jpg";
	else if (document.frm.font1[current].value == "Nbaski") 
		img ="budget_nbaski.jpg";
	else if (document.frm.font1[current].value == "Roman") 
		img ="budget_roman.jpg";
	else if (document.frm.font1[current].value == "Script") 
		img ="budget_script.jpg";
else if (document.frm.font1[current].value == "Brush Script BT") 
		img ="brush_script.jpg";

else if (document.frm.font1[current].value == "Meta Roman") 
		img ="meta_roman.jpg";
else if (document.frm.font1[current].value == "New Caledonia") 
		img ="new_caledonia.jpg";
else if (document.frm.font1[current].value == "Optima") 
		img ="optima.jpg";
	if (img == ""){ img = "arial_black.jpg"; }
	document.all["show1"].src = "images/" + img;
}


function change1() {
	var img;
	current = document.frm.colour1.selectedIndex;
	if(document.frm.colour1[current].value=="NA")
		document.all["im_line2"].style.display = 'none';
	else
		document.all["im_line2"].style.display = 'block';
	if (document.frm.colour1[current].value == "Black") 
		img ="strip_black.gif";
	else if (document.frm.colour1[current].value == "Blue") 
		img ="strip_blue.gif";
	else if (document.frm.colour1[current].value == "Red") 
		img ="strip_red.gif";
	else if (document.frm.colour1[current].value == "Green") 
		img ="strip_green.gif";
	else if (document.frm.colour1[current].value == "Yellow") 
		img ="strip_yellow.gif";
	else if (document.frm.colour1[current].value == "White") 
		img ="strip_white.gif";
	
	if (img == ""){ img = "arial_black.jpg"; }
	document.all["show2"].src = "images/" + img;
}


function change2() {
	var img;
	current = document.frm.font2.selectedIndex;
	if(document.frm.font2[current].value=="NA")
		document.all["im_line3"].style.display = 'none';
	else
		document.all["im_line3"].style.display = 'block';
	if (document.frm.font2[current].value == "Arial Bold") 
		img ="arial_bold.jpg";
	else if (document.frm.font2[current].value == "Cancun") 
		img ="cancun.gif";
	else if (document.frm.font2[current].value == "Century Gothic") 
		img ="century.jpg";
	else if (document.frm.font2[current].value == "Franklin Gothic ITC Heavy  BT") 
		img ="Franklin.jpg";
	else if (document.frm.font2[current].value == "Futura") 
		img ="futura.jpg";
	else if (document.frm.font2[current].value == "Futura MB BT Bold") 
		img ="futura_bold.jpg";
	else if (document.frm.font2[current].value == "Lyndian BT Bold") 
		img ="lyndian.jpg";
	else if (document.frm.font2[current].value == "Ribbon 131") 
		img ="ribbon.jpg";
	else if (document.frm.font2[current].value == "Script Mt Bold") 
		img ="script_mt.jpg";
	else if (document.frm.font2[current].value == "Souvenir Demi Bt") 
		img ="souvenir.jpg";
	else if (document.frm.font2[current].value == "Tahoma Bold") 
		img ="tahoma.jpg";
	else if (document.frm.font2[current].value == "Times New Roman") 
		img ="times_roma.jpg";
	else if (document.frm.font2[current].value == "Centry") 
		img ="budget_centry.jpg";
	else if (document.frm.font2[current].value == "Crayonet") 
		img ="budget_crayonet.jpg";
	else if (document.frm.font2[current].value == "Cursive") 
		img ="budget_cursive.jpg";
	else if (document.frm.font2[current].value == "Fifth") 
		img ="budget_fifth.jpg";
	else if (document.frm.font2[current].value == "Gotland") 
		img ="budget_gotland.jpg";
	else if (document.frm.font2[current].value == "Helvetica") 
		img ="budget_helvetica.jpg";
	else if (document.frm.font2[current].value == "Helvetica 3 Line") 
		img ="budget_helveticaline3.jpg";
	else if (document.frm.font2[current].value == "Manhatton") 
		img ="budget_manhatton.jpg";
	else if (document.frm.font2[current].value == "Nbaski") 
		img ="budget_nbaski.jpg";
	else if (document.frm.font2[current].value == "Roman") 
		img ="budget_roman.jpg";
	else if (document.frm.font2[current].value == "Script") 
		img ="budget_script.jpg";

else if (document.frm.font1[current].value == "Brush Script BT") 
		img ="brush_script.jpg";

else if (document.frm.font1[current].value == "Meta Roman") 
		img ="meta_roman.jpg";
else if (document.frm.font1[current].value == "New Caledonia") 
		img ="new_caledonia.jpg";
else if (document.frm.font1[current].value == "Optima") 
		img ="optima.jpg";


	if (img == ""){ img = "arial_black.jpg"; }
	document.all["show3"].src = "images/" + img;
}


function change3() {
	var img;
	current = document.frm.colour2.selectedIndex;
	if(document.frm.colour2[current].value=="NA")
		document.all["im_line4"].style.display = 'none';
	else
		document.all["im_line4"].style.display = 'block';
	if (document.frm.colour2[current].value == "Black") 
		img ="strip_black.gif";
	else if (document.frm.colour2[current].value == "Blue") 
		img ="strip_blue.gif";
	else if (document.frm.colour2[current].value == "Red") 
		img ="strip_red.gif";
	else if (document.frm.colour2[current].value == "Green") 
		img ="strip_green.gif";
	else if (document.frm.colour2[current].value == "Yellow") 
		img ="strip_yellow.gif";
	else if (document.frm.colour2[current].value == "White") 
		img ="strip_white.gif";
	
	if (img == ""){ img = "arial_black.jpg"; }
	document.all["show4"].src = "images/" + img;
}


function change4() {
	var img;
	current = document.frm.font3.selectedIndex;
	if(document.frm.font3[current].value=="NA")
		document.all["im_line5"].style.display = 'none';
	else
		document.all["im_line5"].style.display = 'block';
	if (document.frm.font3[current].value == "Arial Bold") 
		img ="arial_bold.jpg";
	else if (document.frm.font3[current].value == "Cancun") 
		img ="cancun.gif";
	else if (document.frm.font3[current].value == "Century Gothic") 
		img ="century.jpg";
	else if (document.frm.font3[current].value == "Franklin Gothic ITC Heavy  BT") 
		img ="Franklin.jpg";
	else if (document.frm.font3[current].value == "Futura") 
		img ="futura.jpg";
	else if (document.frm.font3[current].value == "Futura MB BT Bold") 
		img ="futura_bold.jpg";
	else if (document.frm.font3[current].value == "Lyndian BT Bold") 
		img ="lyndian.jpg";
	else if (document.frm.font3[current].value == "Ribbon 131") 
		img ="ribbon.jpg";
	else if (document.frm.font3[current].value == "Script Mt Bold") 
		img ="script_mt.jpg";
	else if (document.frm.font3[current].value == "Souvenir Demi Bt") 
		img ="souvenir.jpg";
	else if (document.frm.font3[current].value == "Tahoma Bold") 
		img ="tahoma.jpg";
	else if (document.frm.font3[current].value == "Times New Roman") 
		img ="times_roma.jpg";
		
	else if (document.frm.font3[current].value == "Centry") 
		img ="budget_centry.jpg";
	else if (document.frm.font3[current].value == "Crayonet") 
		img ="budget_crayonet.jpg";
	else if (document.frm.font3[current].value == "Cursive") 
		img ="budget_cursive.jpg";
	else if (document.frm.font3[current].value == "Fifth") 
		img ="budget_fifth.jpg";
	else if (document.frm.font3[current].value == "Gotland") 
		img ="budget_gotland.jpg";
	else if (document.frm.font3[current].value == "Helvetica") 
		img ="budget_helvetica.jpg";
	else if (document.frm.font3[current].value == "Helvetica 3 Line") 
		img ="budget_helveticaline3.jpg";
	else if (document.frm.font3[current].value == "Manhatton") 
		img ="budget_manhatton.jpg";
	else if (document.frm.font3[current].value == "Nbaski") 
		img ="budget_nbaski.jpg";
	else if (document.frm.font3[current].value == "Roman") 
		img ="budget_roman.jpg";
	else if (document.frm.font3[current].value == "Script") 
		img ="budget_script.jpg";

	else if (document.frm.font1[current].value == "Brush Script BT") 
		img ="brush_script.jpg";

else if (document.frm.font1[current].value == "Meta Roman") 
		img ="meta_roman.jpg";
else if (document.frm.font1[current].value == "New Caledonia") 
		img ="new_caledonia.jpg";
else if (document.frm.font1[current].value == "Optima") 
		img ="optima.jpg";

	
	if (img == ""){ img = "arial_black.jpg"; }
	document.all["show5"].src = "images/" + img;
}


function change5() {
	var img;
	current = document.frm.colour3.selectedIndex;
	if(document.frm.colour3[current].value=="NA")
		document.all["im_line6"].style.display = 'none';
	else
		document.all["im_line6"].style.display = 'block';
	if (document.frm.colour3[current].value == "Black") 
		img ="strip_black.gif";
	else if (document.frm.colour3[current].value == "Blue") 
		img ="strip_blue.gif";
	else if (document.frm.colour3[current].value == "Red") 
		img ="strip_red.gif";
	else if (document.frm.colour3[current].value == "Green") 
		img ="strip_green.gif";
	else if (document.frm.colour3[current].value == "Yellow") 
		img ="strip_yellow.gif";
	else if (document.frm.colour3[current].value == "White") 
		img ="strip_white.gif";
	
	if (img == ""){ img = "arial_black.jpg"; }
	document.all["show6"].src = "images/" + img;
}


		  function change_action()
		  { 
				function ltrim(str) { 
					for(var k = 0; k < str.length && isWhitespace(str.charAt(k)); k++);
					return str.substring(k, str.length);
				}
				function rtrim(str) {
					for(var j=str.length-1; j>=0 && isWhitespace(str.charAt(j)) ; j--) ;
					return str.substring(0,j+1);
				}
				function trim(str) {
					return ltrim(rtrim(str));
				}
				function isWhitespace(charToCheck) {
					var whitespaceChars = " \t\n\r\f";
					return (whitespaceChars.indexOf(charToCheck) != -1);
				}
				var fsub=0;
		  		var strTemp = trim(document.frm.badge_all.value);
				var current = document.frm.font1.selectedIndex;
				var current1 = document.frm.size1.selectedIndex;
				var current2 = document.frm.colour1.selectedIndex;
				if(document.frm.font1[current].value=="NA")
				{
					alert("Please select font style for line1");
					document.frm.font1.focus();
					fsub=1;
					return false;	
				}
				if(document.frm.size1[current1].value=="NA")
				{
					alert("Please select font size for line1");
					document.frm.size1.focus();
					fsub=1;
					return false;	
				}
				if(document.frm.colour1[current2].value=="NA")
				{
					alert("Please select font color for line1");
					document.frm.colour1.focus();
					fsub=1;
					return false;	
				}
				if(strTemp=="")
				{
					alert("Please fill the badge details");
					document.all['Layer1'].style.visibility = 'hidden';
					document.frm.badge_all.focus();
					fsub=1;
					return false;			  
				}
				if(fsub==0)
				{
					document.frm.action = "insert_data.php";
					document.frm.submit();
				}
			  
		  }
		  
		  
		   function file_upload()
		  {
			  if(document.frm.fileupload2.value=="")
			  {
				alert("Please fill the badge details");
				document.frm.fileupload2.focus();
				return false;			  
			  }
			  else
			  {
				document.frm.action = "upload_file.php";
				document.frm.submit();
			  }	
		  }
		  
		  function frm_layout()
		  {			  			
				document.frm.action = "process_layout_options.php";
				document.frm.submit();
		  }
		   function frm_layout_text()
		  {
			  	document.frm.action = "process_layout_options.php";
				document.frm.submit();
		 }
		  function back_step1()
		  {
				document.frm.action ="price_calculator.php";
				document.frm.submit();
		  }
		  
		  function back_step2()
		  {
				document.frm.action ="step2_logo_layout.php";
				document.frm.submit();
		  }
		  function back_step2_text()
		  {
				document.frm.action ="step2_text_layout.php";
				document.frm.submit();
		  }
			function back_step3()
		  {
				document.frm.action ="step3.php";
				document.frm.submit();
		  }
		  
		  function frm_checkout()
		  {
			  	document.frm.action = "https://qs810.pair.com/bonzaqs1/namebadgesaustralia.com/order_form.php";
				//document.frm.action = "order_form.php";
				document.frm.submit();
			 	
		  }

function frm_recheckout()
		  {
			  if(document.getElementById("p_cost2").checked==false && document.getElementById("p_cost1").checked==false)
				{
					alert('Please choose the preferred method for postage and handling');
					document.getElementById("p_cost2").focus();
					return false;
				}
			  
			  	document.frm.action = "re_order_form_submit.php";
				document.frm.submit();
			 	
		  }

function UpdatePreview1(size_back)
{
var img;
	if (document.all["onlytext"].checked == true) {
		img ="only_text.jpg";
		//document.frm.select_colour.options[0].selected=true;
		//document.all["bac1"].src = "images/gold.gif";
		
		document.all["bcolor"].style.display = 'block';
		document.all["bcolorimg"].style.display = 'block';
		document.all["bcolortex"].style.display = 'none';
		document.all["bcolorimgtex"].style.display = 'none';
		document.all["bcolorflat"].style.display = 'none';
		document.all["bcolorimgflat"].style.display = 'none';
		document.all["bcolorlogo"].style.display = 'none';
		document.all["bcolorimglogo"].style.display = 'none';
		document.all["acr"].style.display = 'block';
		document.all["acr1"].style.display = 'block';
		document.all["sw_clip"].style.display = 'block';
		document.frm.size.options[3] = new Option('Extra Large 50mm x 80mm','Extra Large 50mm x 80mm');
		if(size_back=="Extra Large 50mm x 80mm")
		document.frm.size.options[3].selected=true;
	}
	if (document.all["idlogotext"].checked == true){
		img = "logo_text.jpg";
		//document.frm.select_colourlogo.options[0].selected=true;
		//document.all["bac2"].src = "images/gold.gif";
		document.all["bcolor"].style.display = 'none';
		document.all["bcolorimg"].style.display = 'none';
		document.all["bcolortex"].style.display = 'none';
		document.all["bcolorimgtex"].style.display = 'none';
		document.all["bcolorflat"].style.display = 'none';
		document.all["bcolorimgflat"].style.display = 'none';
		document.all["bcolorlogo"].style.display = 'block';
		document.all["bcolorimglogo"].style.display = 'block';
		document.all["acr"].style.display = 'block';
		document.all["acr1"].style.display = 'block';
		document.all["sw_clip"].style.display = 'block';
		document.frm.size.options[3] = new Option('Extra Large 50mm x 80mm','Extra Large 50mm x 80mm');
		if(size_back=="Extra Large 50mm x 80mm")
		document.frm.size.options[3].selected=true;
	}
	if (document.all["idtexturefinish"].checked == true) {
		img = "texture_finishing_badge.jpg";
		document.all["bac3"].src = "images/bb_navy.jpg";
		document.all["bcolor"].style.display = 'none';
		document.all["bcolorimg"].style.display = 'none';
		document.all["bcolortex"].style.display = 'block';
		document.all["bcolorimgtex"].style.display = 'block';
		document.all["bcolorflat"].style.display = 'none';
		document.all["bcolorimgflat"].style.display = 'none';
		document.all["bcolorlogo"].style.display = 'none';
		document.all["bcolorimglogo"].style.display = 'none';
		document.all["acr"].style.display = 'none';
		document.all["acr1"].style.display = 'none';
		document.all["sw_clip"].style.display = 'none';
		document.frm.size.options[3] = null;
	}
	if (document.all["idflatfinishing"].checked == true) {
		img = "flat_finishing_badge.gif";
		document.all["bac4"].src = "images/bb_gold.jpg";
		document.all["bcolor"].style.display = 'none';
		document.all["bcolorimg"].style.display = 'none';
		document.all["bcolortex"].style.display = 'none';
		document.all["bcolorimgtex"].style.display = 'none';
		document.all["bcolorflat"].style.display = 'block';
		document.all["bcolorimgflat"].style.display = 'block';
		document.all["bcolorlogo"].style.display = 'none';
		document.all["bcolorimglogo"].style.display = 'none';
		document.all["acr"].style.display = 'block';
		document.all["acr1"].style.display = 'block';
		document.all["sw_clip"].style.display = 'none';
		document.frm.size.options[3] = null;
	}
if (img == ""){ img = "blank"; }
document.all["blank"].src = "images/" + img;

}




function  samtest()
{
var found_it;

for (var i = 0 ; i < document.checkoutForm.payment_option.length ; i++)
{
		if (document.checkoutForm.payment_option[i].checked)
		  {
			found_it = document.checkoutForm.payment_option[i].value
			} 

} 

		if (found_it=="payment by credit card")
		{
		test_payment="credit";
		}
		else
		{
		test_payment="cheque";
		}


}



function change_type()
{
	len=document.form1.select_colour.options.length;
	current = document.form1.badge_type.selectedIndex;
	
	for(i=0;i<len;i++)
	{
		document.form1.select_colour.options[i]=null;
	}
	
	
	if(document.form1.badge_type[current].value=="text")
	{
		document.form1.select_colour.options[0] = new Option('Gold Background','Gold Background',true,true);
		document.form1.select_colour.options[1] = new Option('Silver Background','Silver Background');
		document.form1.select_colour.options[2] = new Option('White Background','White Background');
		document.form1.select_colour.options[3] = new Option('Black Background','Black Background');
		document.form1.select_colour.options[4] = new Option('Red Background','Red Background');
		document.form1.select_colour.options[5] = new Option('Yellow Background','Yellow Background');
		document.form1.select_colour.options[6] = new Option('Light Blue Background','Light Blue Background');
		document.form1.select_colour.options[7] = new Option('Dark Blue Background','Dark Blue Background');
		document.form1.select_colour.options[8] = new Option('Maroon Background','Maroon Background');
		document.form1.select_colour.options[9] = new Option('Light Green Background','Light Green Background');
		document.form1.select_colour.options[10] = new Option('Dark Green Background','Dark Green Background');
	}
	if(document.form1.badge_type[current].value=="logo")
	{
		document.form1.select_colour.options[0] = new Option('Gold Background','Gold Background',true,true);
		document.form1.select_colour.options[1] = new Option('Silver Background','Silver Background');
		document.form1.select_colour.options[2] = new Option('White Background','White Background');
		document.form1.select_colour.options[3] = new Option('Black Background','Black Background');
		document.form1.select_colour.options[4] = new Option('Red Background','Red Background');
		document.form1.select_colour.options[5] = new Option('Yellow Background','Yellow Background');
		document.form1.select_colour.options[6] = new Option('Light Blue Background','Light Blue Background');
		document.form1.select_colour.options[7] = new Option('Dark Blue Background','Dark Blue Background');
		document.form1.select_colour.options[8] = new Option('Maroon Background','Maroon Background');
		document.form1.select_colour.options[9] = new Option('Light Green Background','Light Green Background');
		document.form1.select_colour.options[10] = new Option('Dark Green Background','Dark Green Background');
	}
	if(document.form1.badge_type[current].value=="texture")
	{
		document.form1.select_colour.options[0] = new Option('Navy Blue / White','Navy Blue / White (TEX B-W)',true,true);
		document.form1.select_colour.options[1] = new Option('Maroon / White','Maroon / White (TEX M-W)');
		document.form1.select_colour.options[2] = new Option('Dark Green / White','Dark Green / White (TEX G-W)');
		document.form1.select_colour.options[3] = new Option('Black / White','Black / White (TEX B-W)');
		document.form1.select_colour.options[4] = new Option('White / Black','White / Black (TEX W-B)');
		document.form1.size.options[3]=null;
	}
	if(document.form1.badge_type[current].value=="flat")
	{
		document.form1.select_colour.options[0] = new Option('Brushed Gold / Black text','Brushed Gold / Black text (BG-B)',true,true);
		document.form1.select_colour.options[1] = new Option('Brushed Silver / Black text','Brushed Silver / Black text (BS-B)');
		document.form1.select_colour.options[2] = new Option('Navy Blue / White text','Navy Blue / White text (DB-W)');
		document.form1.select_colour.options[3] = new Option('Maroon / White text','Maroon / White text (M-W)');
		document.form1.select_colour.options[4] = new Option('Dark Green / White text','Dark Green / White text (G-W)');
		document.form1.select_colour.options[5] = new Option('Black / White text','Black / White text (B-W)');
		document.form1.select_colour.options[6] = new Option('White / Black text','White / Black text (W-B)');
		document.form1.select_colour.options[7] = new Option('Red / White text','Red / White text (R-W)');
		document.form1.select_colour.options[8] = new Option('White/ Red text','White/ Red text (W-R)');
		document.form1.select_colour.options[9] = new Option('Yellow / Black text','Yellow / Black text (Y-B)');
		document.form1.select_colour.options[10] = new Option('White/ Blue text','White/ Blue text (W-B)');
		document.form1.size.options[3]=null;
	}
}


function chk_frm()
{
	
	if(form1.mail.value=="")
	{
		alert("Email Address is a compulsory field.");
		form1.mail.focus();
		return false;						
	}							
	else 
	{    
			var emailStr=form1.mail.value;
		   // checks if the e-mail address is valid
			//var emailPat = /^(\".*\"|[A-Za-z]\w*)@(\[\d{1,3}(\.\d{1,3}){3}]|[A-Za-z]\w*(\.[A-Za-z]\w*)+)$/;
			 //var matchArray = emailStr.match(emailPat);
		   //if (matchArray == null) {
		   var reg1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/; // not valid
			var reg2 = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/; // valid
			if (!(!reg1.test(emailStr) && reg2.test(emailStr))) 
			{
			 	alert("Please check your Email Address.");
				form1.mail.focus();
			  	return false;   
			 }				
			
  	}
	
	if (form1.numbers.value=="")
	{
		alert("The Number of badges cannot be left blank");
		form1.numbers.focus();
		return false;
	}
	else
	{
		//Otherwise, if there is something entered we carry out our checks on each character ...
		n=document.form1.numbers.value.length;
		for (i=0;i<n; i++)
		// We start a FOR loop to check every character from the first (0) to the last (n)
		{
		cchar=document.form1.numbers.value.charAt(i);
		// cchar is the name of each character entered. charAt(i) return the character at position i.
			if (parseFloat(cchar)|| (cchar=='.')||(cchar=='0'))
		// This is the crux! If the character can be changed into a number ...
		// Or if it is a decimal point then ...
			{
					if(document.form1.numbers.value<51)
					{
						alert("We will provide quote only if the quantity is above 50 units.");
						document.form1.numbers.focus();
						//break;
						return false;
					}
					

			}
			else
			{
			alert('The character \''+cchar+'\' is not a number\nPlease enter numbers only');
			document.form1.numbers.value='';
			form1.numbers.focus();
			return false;
			break;
		//Otherwise, if the character isn't a number then we tell the user
		// and clear the form. 
		}
		}
		}

	
	if (form1.pintype.value=="")
	{
		alert("The Pin Type cannot be left blank");
		form1.pintype.focus();
		return false;
	}
if (form1.verify.value=="")
	{
		alert("Please enter the verification code given below");
    
		form1.verify.focus();
		return false;
	}
if (form1.verify.value!=form1.vp.value)
	{
		alert("Verification code does not match");
		form1.verify.focus();
		return false;
	}
	
	
	

}


function pin_type()
{
	current = document.form1.size.selectedIndex;
	len=document.form1.pintype.options.length;
	for(i=0;i<len;i++)
	{
		document.form1.pintype.options[i]=null;
	}
	if(document.form1.size[current].value=="Medium 25mm x 76mm" || document.form1.size[current].value=="Large 30mm x 80mm" || document.form1.size[current].value=="Extra Large 50mm x 80mm")
	{
		document.form1.pintype.options[0] = new Option('Pin','Pin',true,true);
		document.form1.pintype.options[1] = new Option('Clip and Pin','Clip and Pin');
		document.form1.pintype.options[2] = new Option('Magnet','Magnet');
		//document.form1.pintype.options[3] = new Option('Swivel pin','Swivel pin');
	}
	if(document.form1.size[current].value=="Small 20mm x 64mm")
	{
		document.form1.pintype.options[0] = new Option('Pin','Pin',true,true);
		document.form1.pintype.options[1] = new Option('Magnet','Magnet');
	}
}


function chk_frm1()
{
	
	if (form1.invoice_no.value=="")
	{
		alert("The Invoice Number cannot be left blank");
		form1.invoice_no.focus();
		return false;
	}
	
	if(form1.email.value=="")
	{
		alert("Email Address is a compulsory field.");
		form1.email.focus();
		return false;						
	}							
	else 
	{    
			var emailStr=form1.email.value;
		   // checks if the e-mail address is valid
			//var emailPat = /^(\".*\"|[A-Za-z]\w*)@(\[\d{1,3}(\.\d{1,3}){3}]|[A-Za-z]\w*(\.[A-Za-z]\w*)+)$/;
			 //var matchArray = emailStr.match(emailPat);
		   //if (matchArray == null) {
		   var reg1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/; // not valid
			var reg2 = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/; // valid
			if (!(!reg1.test(emailStr) && reg2.test(emailStr))) 
			{
			 	alert("Please check your Email Address.");
				form1.email.focus();
			  	return false;   
			 }				
			
  	}
	

}

function reorder_new_text()
{
	
	document.all["typetext"].style.display = 'block';
}

function updatepos_reorder(cost)
{ 
	if(cost<=4)
	{
		document.getElementById("delivery").value="3.5"
		
		document.getElementById("post_text").innerHTML='<span id = warning><p><strong><font color="#FF0000">Warning:</font></strong> NBA does not take any responsibility for the security of the postal<br>delivery if you select $3.50. <i><b>Payment by credit card only</b></i>.</p></span>';
	}
	else
	{
		document.getElementById("delivery").value="10"
		
		document.getElementById("post_text").innerHTML='';
	}
}

function update_postcost()
{ 
	
	quantity=document.frm.qty.value;
	document.getElementById("delivery").value = 10;	
	document.getElementById("post_text").innerHTML='';
	
	if(quantity>6)
	{
		
		document.getElementById("radiobutton").visibility='hidden';
		
	}
	else
	{
		
		document.getElementById("radiobutton").visibility='visible';
		//document.getElementById("p_cost2").checked=true;
	}
		
}

function calculate_new(layout,doming,fitting,size)
{
	//alert(doming+" hi"+ delivery);
	//var total=0.00;
	quantity=document.frm.qty.value;	
	delivery = document.getElementById("delivery").value;
	payby=document.frm.paymentby.value;
	if(quantity<=0)
	{
		alert("Please Enter Quantity greater than 1.")
		document.frm.qty.focus();
	}
	else if(isNaN(quantity))
	{
		alert("Please Enter Quantity in number.")
		document.frm.qty.focus();
	}
	else
	{
		acryliccost=0.00;
		sizecost=0.00;
		if(doming=="yes")
			acryliccost=2.20;
		
		deliverycost=eval(delivery);
		if(layout == "Name badges with text only" )
		{
			if(quantity>0&&quantity<11)
			{
				total=7.40;
			}
			if(quantity>=11&&quantity<=25)
			{
				total=6.90;
			}
			if(quantity>=26&&quantity<=50)
			{
				total=6.40;
			}
			if(quantity>=51&&quantity<=100)
			{
				total=5.90;
			}
			if(quantity>=101&&quantity<=500)
			{
				total=5.30;
			}
			if(quantity>=501&&quantity<=1000)
			{
				total=4.70;
			}
			if(quantity>=1001)
			{
				total=4.20;
			}
			
			if(size=="Extra Large 50mm x 80mm" || size=="Large 30mm x 80mm")
				sizecost=1.10;
		}
		else if(layout == "Name badges with text and a logo or photograph")
		{
			if(quantity>0&&quantity<11)
			{
				total=7.40;
			}
			if(quantity>=11&&quantity<=25)
			{
				total=6.90;
			}
			if(quantity>=26&&quantity<=50)
			{
				total=6.40;
			}
			if(quantity>=51&&quantity<=100)
			{
				total=5.90;
			}
			if(quantity>=101&&quantity<=500)
			{
				total=5.30;
			}
			if(quantity>=501&&quantity<=1000)
			{
				total=4.70;
			}
			if(quantity>=1001)
			{
				total=4.20;
			}
			
			//if(quantity>100)
			//{
			//total="P.O.A";
			//}
			/*if(quantity>=101&&quantity<=250)
			{
			total=5.90;
			}
			if(quantity>=251&&quantity<=500)
			{
			total=5.65;
			}*/
			if(size=="Extra Large 50mm x 80mm" || size=="Large 30mm x 80mm")
				sizecost=1.10;		
		}
		else if(layout == "Logo badges only")
		{
			if(quantity>0&&quantity<51)
			{
				total=4.20;
			}		
			if(quantity>=51&&quantity<=100)
			{
				total=3.60;
			}
			if(quantity>=101&&quantity<=500)
			{
				total=3.00;
			}
			if(quantity>=501&&quantity<=1000)
			{
				total=2.40;
			}
			if(quantity>=1001)
			{
				total=2.20;
			}
		if(size=="Extra Large 50mm x 80mm" || size=="Large 30mm x 80mm")
			sizecost=1.10;
	}
	else if(layout == "Name badges with blank badge")
	{
	if(quantity>0&&quantity<51)
		{
		total=4.00;
		}
		if(quantity>=51&&quantity<=100)
		{
		total=3.30;
		}
		if(quantity>=101&&quantity<=500)
		{
		total=2.75;
		}
		if(quantity>=501&&quantity<=1000)
		{
		total=2.20;
		}
		if(quantity>=1001)
		{
		total=2.00;
		}
		
		//if(quantity>100)
		//{
		//total="P.O.A";
		//}
		/*if(quantity>=101&&quantity<=250)
		{
		total=5.90;
		}
		if(quantity>=251&&quantity<=500)
		{
		total=5.65;
		}*/
		if(size=="Extra Large 50mm x 80mm" || size=="Large 30mm x 80mm")
		sizecost=1.10;
	
	
	}
		else if(layout == "Engraved Badge - Texture Finish" || layout == "Engraved Badge - Flat Finish" || layout == "Budget Badge - Texture Finish" || layout == "Budget Badge - Flat Finish")
		{
			if(quantity>0&&quantity<26)
			{
				total=6.00;
			}
			if(quantity>=26&&quantity<=50)
			{
				total=5.75;
			}
			if(quantity>=51&&quantity<=100)
			{
				total=5.50;
			}
			if(quantity>100)
			{
				total="P.O.A";
			}
		}
		if(fitting=="Magnet")
		fittingcost=2.00;
		else if(fitting=="Swivel pin")
		fittingcost=1.00;
		else
		fittingcost=0.00;
		
		if(total=="P.O.A")
		{
			document.frm.bcost.value="P.O.A";
			document.frm.ficost.value="AU$"+fittingcost.toFixed(2);
			if(doming=="yes")
			document.frm.acost.value="AU$"+acryliccost.toFixed(2);
			if(document.getElementById("p_cost2").checked==true || document.getElementById("p_cost1").checked==true)
			{
			document.frm.fcost.value="AU$"+deliverycost.toFixed(2);
			}
			document.frm.tcost.value="P.O.A";
			document.frm.gcost.value="P.O.A";
			document.all["order"].style.display = 'block';
			document.all["typetext"].style.display = 'block';
			Layer1.style.top = "1250";
		}
		else
		{
			badge_Total=eval(total + sizecost );
			Total=eval(badge_Total + fittingcost + acryliccost);
			grandtotal=eval(quantity*Total);
			dis=eval((Total*10)/100);
			afterdiscount=eval(Total-((Total*10)/100));
			grandtotaldis=eval(quantity*afterdiscount);
			totalcost=eval(deliverycost + grandtotal).toFixed(2);
			totalcostdis=eval(deliverycost + grandtotaldis).toFixed(2);
			document.frm.bcost.value="AU$"+badge_Total.toFixed(2);
			document.frm.ficost.value="AU$"+fittingcost.toFixed(2);
			if(doming=="yes")
			document.frm.acost.value="AU$"+acryliccost.toFixed(2);
			if(document.getElementById("p_cost2").checked==true || document.getElementById("p_cost1").checked==true)
			{
			document.frm.fcost.value="AU$"+deliverycost.toFixed(2);
			}
			document.frm.tcost.value="AU$"+grandtotal.toFixed(2);
			document.frm.gcost.value="AU$"+totalcost;
			document.all["order"].style.display = 'block';
			document.all["typetext"].style.display = 'block';
			
			
		}
	}
}

function printPage(){
	document.getElementById("header").style.display="none";
	document.getElementById("footer").style.display="none";
	document.getElementById("leftPanel").style.display="none";
	document.getElementById("oid").style.display="none";
	document.getElementById("cc").style.display="none";
	document.getElementById("spr").style.display="none";
	document.getElementById("logo").style.display="block";
	document.getElementById("cp").style.display="block";
	document.getElementById("cpt").style.display="block";
	document.getElementById("cp1").style.display="none";
	document.getElementById("cp2").style.display="none";
	window.location="#top";
	window.print();
}
function cancelPage(){
	document.getElementById("header").style.display="block";
	document.getElementById("footer").style.display="block";
	document.getElementById("leftPanel").style.display="block";
	document.getElementById("oid").style.display="block";
	document.getElementById("cc").style.display="block";
	document.getElementById("spr").style.display="block";
	document.getElementById("logo").style.display="none";
	document.getElementById("cp1").style.display="block";
	document.getElementById("cp2").style.display="block";
	document.getElementById("cp").style.display="none";
	document.getElementById("cpt").style.display="none";
	window.location="#top";
}

function remove_po()
{
	document.getElementById("lessthan7").style.display='none';
	//document.getElementById("lesstha7").style.display='none';
	//document.getElementById("lessth7").style.display='none';
	document.getElementById("lesst7").innerHTML='&nbsp;';
	document.getElementById("less7").innerHTML='&nbsp;';
}
