function gotopage(){
	if(document.getElementById('selecttea').value == 'brand'){
		window.location="tea-brand.htm";
	}
	if(document.getElementById('selecttea').value == 'type'){
		window.location="tea-type.htm";
	}
	return true;
}
function gotopage2(){// for Sample-Item.html tamplate
	if(document.getElementById('selecttea').value == 'brand'){
		window.location="../tea-brand.htm";
	}
	if(document.getElementById('selecttea').value == 'type'){
		window.location="../tea-type.htm";
	}
	return true;
}

function feildchk(){//////////Check Product Form\\\\\\\\\\\\\\
	var error = false;
	var name = document.product.prod_name.value;
	var id = document.product.prod_id.value;
	var stock = document.product.prod_stock.value;
	var type = document.product.prod_type.value;
	var brand = document.product.prod_brand.value;
	var alt = document.product.prod_imgalt.value;
	var price = document.product.prod_price.value;
	var discr = document.product.prod_descrip.value;
	if((name == "")||(name == null)){
		error = true;
		var errmsg= ' Product Name \n ';
	}
	if((id == "")||(id == null)){
		error = true;
		var errmsg= 'Product Id \n';
	}
	/*
	if((stock == "")||(stock == null)){
		error = true;
		var errmsg= 'Stock not selected\n';
	}*/
	if((type == "")||(type == null)){
		error = true;
		var errmsg= 'Product type\n';
	}
	if((brand == "")||(brand == null)){
		error = true;
		var errmsg= 'Product brand\n';
	}
	if((alt == "")||(alt == null)){
		error = true;
		var errmsg= 'Product alt\n';
	}
	if((price == "")||(price == null)){
		error = true;
		var errmsg= 'Product Price\n';
	}
	if((discr == "")||(discr == null)){
		error = true;
		var errmsg= ' Product Discription \n';
	}
	if(error == true){
		var result = confirm("The following fields are Empty: \n"+errmsg+" Are you sure you want to proceed? ");
	}
	return result;
	
}
function noship(){
	window.alert('Cannot ship in warm weather');
	return false;
}
function nostock(){
	window.alert('This product is currently out of stock');
	return false;
}
function send_emails(){
	var result = confirm('Are you sure you want to send email to everyone in the Database');
	return result;
}
function emptyout(){
	document.TrackByRef[0].tracknumbers.value = '';
}
function addnubr(){
	var thenmr = 'SALES RECEIPT #'
	var trknumb = document.TrackByRef[0].tracknumbers.value;
	var txtnnumb = thenmr+trknumb;
	document.TrackByRef[0].tracknumbers.value = txtnnumb;
	
}
function formvalid(){//CheckOut.html Form Validater
	if(document.my_form.phone1.value == "" || document.my_form.phone1.value.length < 10 || document.my_form.phone1.value.length > 20){
		alert('Please provide a valid, 10-digit phone number.')
		return false;
	}
	return true;
}
function newsletter_clear(){
	if(document.getElementById('email').value == 'Enter your email!'){
		document.getElementById('email').value='';
	}
}
function swap(imgpath,imgid){
	document.images[imgid].src = imgpath;
}
