
function swap_b(imgname,imgid){
	var path = 'storefront/images/Blue-Moon-Black-Tea/';
	document.images[imgid].src = path+imgname;
	//var alink = anchor.this.href;// - breaks open window script in IE
	//window.alert(alink);
	//this.href = "index.html";
}
function swap_g(imgname,imgid){
	var path = 'storefront/images/Blue-Moon-Green-Tea/';
	document.images[imgid].src = path+imgname;
}
function swap_r(imgname,imgid){
	var path = 'storefront/images/Blue-Moon-Rooibos-Tea/';
	document.images[imgid].src = path+imgname;
}
function swap_w(imgname,imgid){
	var path = 'storefront/images/Blue-Moon-White-Tea/';
	document.images[imgid].src = path+imgname;
}/*
function init(){
	var allimgs = new Array();
	var imgs = document.getElementsByTagName("img");
	for(var i =0; i < imgs.length; i++){
		allimgs[i] = document.images[i].src;
	}
}
window.onload = init();

function restore(){
	var imgs = document.getElementsByTagName("img");
	for(var i =0; i < imgs.length; i++){
		//document.images[i].src = document.getElementsByTagName("img")[4].src;
		allimgs[i] = document.images[i].src;
		
	}
}
function swap_back(){
	oldImg = new Image();
	oldImg.src = document.images["imgid"].src;
	oldImg.onmouseout = function(){
		this.src= imgname.outImg.scr;
	}
}*/
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 noship(){
	window.alert('Cannot ship to warm climates');
	return true;
}
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 openwindow(imgsrc){
	var img1= new Image();
	img1.src = imgsrc;
	var imgheight =img1.height + 20;
	var imgwidth = img1.width + 20;
	window.open(imgsrc,"Image","width="+imgwidth+",height="+imgheight+",resizable=yes");
}