<!--


// buyItem - adds an item to the shopping basket
function buyItem(itemNo, qty) 
{
// set up variables for message riders
//alert("itemNo = " + itemNo + 'line 8 function buyItem    ' + itemNo, qty);
		var whichitem;
		var size;
		var color = "";
		var bgcolor = "";
		var copy1 = "";
		var copy2 = "";
//alert (itemNo.substr(0,6) + ' line 15  ' + itemNo.substr(7,4) + "  QTY= " + qty);		

		if (itemNo.substr(0,6) == "DPB-L-")
		{ 
			whichitem = "Digital Printed Banner Landscape";
			size = ' x ' ;
			color = "Full Color"			
			bgcolor = "White";
			copy1 = document.getElementById("Namerider_name").value + ' ~~ ' + document.getElementById("Namerider_phone1").value +
					' ~~ ' + document.getElementById("Namerider_name1").value;	
			var filepath = document.getElementById("F1").value.split("\\");
			var filename = filepath[filepath.length - 1] + " ~~ ";
			var filepath2 = document.getElementById("F2").value.split("\\");
				filename += filepath2[filepath2.length - 1] + " ~~ ";
			var filepath3 = document.getElementById("F3").value.split("\\"); 			
				filename += filepath3[filepath3.length - 1] + " ~~ ";
			var filepath4 = document.getElementById("F4").value.split("\\"); 			
				filename += filepath4[filepath4.length - 1];								
			copy2 = filename;					
		}
		if (itemNo.substr(0,6) == "DPB-P-")
		{ 
			whichitem = "Digital Printed Banner Portrait";
			size = ' x ' ;
			color = "Full Color"			
			bgcolor = "White";
			copy1 = document.getElementById("Namerider_name").value + ' ~~ ' + document.getElementById("Namerider_phone1").value +
					' ~~ ' + document.getElementById("Namerider_name1").value;	
			var filepath = document.getElementById("F1").value.split("\\");
			var filename = filepath[filepath.length - 1] + " ~~ ";
			var filepath2 = document.getElementById("F2").value.split("\\");
				filename += filepath2[filepath2.length - 1] + " ~~ ";
			var filepath3 = document.getElementById("F3").value.split("\\"); 			
				filename += filepath3[filepath3.length - 1] + " ~~ ";
			var filepath4 = document.getElementById("F4").value.split("\\"); 			
				filename += filepath4[filepath4.length - 1];
			copy2 = filename;					
		}	
		if (itemNo.substr(0,6) == "DigMag")
		{ 
			whichitem = "Digital Printed Auto Magnetic";
			color = "Full Color"
			bgcolor = "Photo";
			copy1 = document.getElementById("Namerider_name").value + ' ~~ ' + document.getElementById("Namerider_phone1").value +
					' ~~ ' + document.getElementById("Namerider_name1").value;	
			var filepath = document.getElementById("F1").value.split("\\");
			var filename = filepath[filepath.length - 1] + " ~~ ";
			var filepath2 = document.getElementById("F2").value.split("\\");
				filename += filepath2[filepath2.length - 1] + " ~~ ";
			var filepath3 = document.getElementById("F3").value.split("\\"); 			
				filename += filepath3[filepath3.length - 1] + " ~~ ";
			var filepath4 = document.getElementById("F4").value.split("\\"); 			
				filename += filepath4[filepath4.length - 1];
//alert(filename + '  Line 68  ');				
			copy2 = filename;
			
			if(itemNo.substr (7,4) == "1014")
			{
				size = "10x14"
			}
			if(itemNo.substr (7,4) == "1016")
			{
				size = "10x16"
			}
			if(itemNo.substr (7,4) == "1018")
			{
				size = "10x18"
			}
			if(itemNo.substr (7,4) == "1218")
			{
				size = "12x18"
			}
			if(itemNo.substr (7,4) == "1224")
			{
				size = "12x24"
			}																	
		}			
			
			oldCart = getCookie('ShopCart');
		newCart = "["+itemNo+"|"+whichitem+"|"+size+"|"+color+"|"+bgcolor+"|"+copy1+"|"+copy2+"|"+qty+"]";
		cartFull = oldCart + newCart;
		setCookie('ShopCart',cartFull);	
		
		viewCart();
}

//-------------------------------------------------------------------------------------------------------------------------------
// validate form fields
function addItemDpb(itemNoField, Commercialqty)
{

		// validates Commercialqty
		if (Commercialqty == "" || Commercialqty == " ")
        {
		//alert(selectQtyValue);
		    alert('Please enter a quantity.');
			return;
		}
		isNo = chkForNum(Commercialqty);
		if (!isNo)
		{
			alert('Please enter only numeric values');
			return;
		}
		


	// adds item info into cart
	 buyItem(itemNoField, Commercialqty)
}

//-------------------------------------------------------------------------------------------------------------------------------
// goes to view cart
function viewCart()
	{

		self.location.href="shop_view_cart_abq.htm"
	}
	
//===========================================================================

function getPriceDpb(itemNo, qty)
{

//alert(itemNo + ' line 132 ' + qty);

			var dim1 = itemNo.split("-");
			var dim2 = dim1[dim1.length - 1];
			var dim3 = dim2.split("x");
			var dim4 = dim3[dim3.length - 2];			
			var dim5 = dim3[dim3.length - 1];


	if (itemNo.substr(0,6) == "DPB-L-")
	{
		if (dim4<=2)
		{	thePrice=dim4*dim5*4.75;
			if (thePrice < 50)
			{
				thePrice = 50.00;
				return thePrice.toFixed(2)
			}
			else
			{
				return thePrice.toFixed(2).toFixed(2)
			}	
		}
		if (dim4<=3)
		{	thePrice=dim4*dim5*4.50;
			if (thePrice < 50)
			{
				thePrice = 50.00;
				return thePrice.toFixed(2)
			}
			else
			{
				return thePrice.toFixed(2);
			}	
		}
		if (dim4<=4)
		{	thePrice=dim4*dim5*4.25;
			if (thePrice < 50)
			{
				thePrice = 50.00;
				return thePrice.toFixed(2)
			}
			else
			{
				return thePrice.toFixed(2);
			}	
		}
		if (dim4<=5)
		{	thePrice=dim4*dim5*4.25;
			if (thePrice < 50)
			{
				thePrice = 50.00;
				return thePrice.toFixed(2)
			}
			else
			{
				return thePrice.toFixed(2);
			}	
		}						
	}

if (itemNo.substr(0,6) == "DPB-P-")
	{
		if (dim5<=2)
		{	thePrice=dim4*dim5*4.75;
			if (thePrice < 50)
			{
				thePrice = 50.00;
				return thePrice.toFixed(2)
			}
			else
			{
				return thePrice.toFixed(2);
			}	
		}
		if (dim5<=3)
		{	thePrice=dim4*dim5*4.50;
			if (thePrice < 50)
			{
				thePrice = 50.00;
				return thePrice.toFixed(2)
			}
			else
			{
				return thePrice.toFixed(2);
			}	
		}
		if (dim5<=4)
		{	thePrice=dim4*dim5*4.25;
			if (thePrice < 50)
			{
				thePrice = 50.00;
				return thePrice.toFixed(2)
			}
			else
			{
				return thePrice.toFixed(2);
			}	
		}
		if (dim5<=5)
		{	thePrice=dim4*dim5*4.25;
			if (thePrice < 50)
			{
				thePrice = 50.00;
				return thePrice.toFixed(2)
			}
			else
			{
				return thePrice.toFixed(2);
			}	
		}						
	}
//alert(itemNo + ' line 244 ' + qty);	
	if (itemNo == "DigMag-1014")
	{
			if (qty<4) return "29.95";
			if (qty<6) return "28.50";
			if (qty<12) return "26.95";
			if (qty<24) return "23.95";
			return "20.95"	
	}
	if (itemNo == "DigMag-1016")
	{
			if (qty<4) return "33.95";
			if (qty<6) return "32.25";
			if (qty<12) return "30.50";
			if (qty<24) return "25.25";
			return "23.75"	
	}
	if (itemNo == "DigMag-1018")
	{
			if (qty<4) return "37.95";
			if (qty<6) return "35.95";
			if (qty<12) return "34.25";
			if (qty<24) return "30.50";
			return "26.50"	
	}		
	if (itemNo == "DigMag-1224")
	{
			if (qty<4) return "39.95";
			if (qty<6) return "37.95";
			if (qty<12) return "35.95";
			if (qty<24) return "31.95";
			return "27.95"	
	}
	if (itemNo == "DigMag-1218")
	{
			if (qty<4) return "43.95";
			if (qty<6) return "41.75";
			if (qty<12) return "39.50";
			if (qty<24) return "35.25";
			return "30.75"	
	}		
	
}
	




/*
//--------------------------------------------------------------------------------------------
function getPriceRSXSPC(itemNo, qty)
{
	switch(itemNo)
	{
		case "rsxSpc1":
			return "2.44";
		case "rsxSpc2":
			return "14.88";
		case "rsxSpc3":
			return "7.88"	
		case "rsxSpc4":
			return "4.88";	
		case "rsxSpc5":
			return "2.88";			
		case "rsxSpc61":
			return "3.66";
		case "rsxSp62":
			return "2.88";
		case "rsxSpc63":
			return "9.88";
		case "rsxSpc7":
			return "3.88";
		case "rsxSpc8":
			return "9.88";
		case "rsxSpc9-RD":
			return "5.88";
		case "rsxSpc9-BK":
			return "5.88";
		case "rsxSpc9-BE":
			return "5.88";
		case "rsxSpc9-WH":
			return "5.88";
		case "rsxSp10":
			return "2.88";
		case "rsxSp11-Mag":
			return "3.88";	
		case "rsxSp11-Pin":
			return "3.88";
		case "rsxSp12A":
			return "5.88";
		case "rsxSp12B":
			return "11.88";			
		case "rsxSp13-WT":
			return "2.88";	
		case "rsxSp13-BK":
			return "2.88";																																																			
		default:
			return "";
	}
	
}
*/
//-------------------------------------------------------------------------------------------------------------------------------

function viewInfo(infoType)
{
	if (infoType == 'rsxSpc5'){
		smallwin1 = window.open("rsx_spec5_popup.htm", "small1", "scrollbars,width=600,height=400");
		smallwin1.focus;
	} else if (infoType == 'Material'){
		smallwin2 = window.open("popouts/agent_material_popup.htm", "small2", "scrollbars,width=500,height=400");		
		smallwin2.focus;
	} else if (infoType == 'Product'){
		smallwin3 = window.open("popouts/product_popup.htm", "small3", "scrollbars,width=550,height=400");		
		smallwin3.focus;
	} else if (infoType == 'dShape'){
		smallwin4 = window.open("popouts/d_shape_popup.htm", "small4", "scrollbars,width=500,height=400");
	} else if (infoType == 'dStyle'){
		smallwin5 = window.open("popouts/d_style_popup.htm", "small5", "scrollbars,width=550,height=300");
	} else if (infoType == 'nrColor'){
		smallwin6 = window.open("popouts/nr_color_popup.htm", "small6", "scrollbars,width=550,height=300");
	} else if (infoType == 'nrMaterial'){
		smallwin7 = window.open("popouts/material_popup_nr.htm", "small7", "scrollbars,width=550,height=400");
	} else if (infoType == 'nrStyle'){
		smallwin8 = window.open("popouts/nr_style_popup.htm", "small8", "scrollbars,width=550,height=300");
	} else if (infoType == 'Signature'){
		smallwin9 = window.open("popouts/new_franchise_popup.htm", "small9", "scrollbars,width=475,height=400");
	} else if (infoType == 'dMaterial'){
		smallwin10 = window.open("popouts/d_material_popup.htm", "small10", "scrollbars,width=475,height=300");
	} else if (infoType == 'lfMaterial'){
		smallwin11 = window.open("popouts/material_popup_large_format.htm", "small11", "scrollbars,width=550,height=200");
	} else if (infoType == 'evName'){
		smallwin12 = window.open("popouts/name_conventions.htm", "small12", "scrollbars,width=450,height=300");
	}else if (infoType == 'evHouse'){
		smallwin13 = window.open("popouts/read_open_house.htm", "small13", "scrollbars,width=550,height=300");
	}
}

// -->	









