'Main Page code

function Large(fileName, Name, PNum, Price, Wt, description)
if len(Pnum) > 5 then
		   dim strURLInfo
		   strURLInfo = "Logos.asp?url=NewHomePage.asp&file=" & fileName & "&title=" & Name & "&PtNum=" & PNum & "&price=" & Price & "&weight=" & Wt & "&description=" & description
		   specs = " height=" & 500 & ", width=" & 650 & ",scrollbars=yes, resizable=no'"  'wide tall
		   window.open strURLInfo, "BigItem", specs
end if
end function

'--------------------------------------------------------------------------------------------------------------
function callpage(pgName)

	location.href = pgName
end function

function change(index, mode)
	if mode = 1 then
		mainmenu(index).className = "menuover"
	elseif mode = 0 then 
		mainmenu(index).className = "menu"
	end if
end function


Dim shoppingcart

sub DirectToPage(buttonID)
	
	if buttonID = 2 then
		category.action = "ViewCart.asp"
	else						'if buttonID = 1 then
		category.action = "home.asp"
	end if
	
	
	document.forms("category").submit()
'	location.reload

end sub

sub changeImage( xcat, picName, W, H, iid, catid, PN, BC , DName, Name, TNPic, Pr, Wt)                    ', Desc , Descript 
'document.write Descript													
dim fldrName

select case xcat
	case 1
		fldrName = "Cabinets\"
	case 2
		fldrName = "pictures\"	
	case 3
		fldrName = "pictures\"
	case 4
		fldrName = "pictures\"
	case 5	
		fldrName = "pictures\"	
end select

IDNumber.value = iid
PartNumber.value = PN
form1.item_number.value = PN
BCNumber.value = BC
DispName.value = DName
form1.item_name.value = DName
NoSPacesName.value = Name
ItemPrice.value =  formatcurrency(Pr, 2)
form1.amount.value = Pr
Itemweight.value = Wt

myimage.width = W
myimage.height = H
myimage.src = fldrName & picName

end sub

sub SaveValues()
dim originalstring
dim newitemstring
dim newstring	

'get current cart string
originalstring = category.cartitems.value

'build new item string
newitemstring = IDNumber.value & "," & _
				  PartNumber.value  & "," & _
				  ItemPrice.value & "," & _
				  Itemweight.value & "," & _
				  qty.value & "," & _
				  NoSPacesName.value
				 ' DispName.value & "," & _
				 ' BCNumber.value & "," & _

'add the two string together base on the existense of other items or not
if len(originalstring) < 1 then
	newstring = newitemstring
else
	newstring = originalstring & "," & newitemstring
end if			 				  

'assign new string to form textbox for transfer to shopping cart 
category.cartitems.value = newstring

end sub

sub changeMenus(value)
	category.method = "Post"
	category.action = "Home.asp"
	category.Submit()
end sub

sub changebuttonface(onoff)

	if onoff = 1 then
		form1.other.src = "buttons/AddToCartMaroon.JPG"
	else 
		form1.other.src = "buttons/AddToCartGreen.JPG"
	end if

end sub
