//****************************************************************
//****************************************************************
//	Embroidery Font Shop
//	Copyright 2004
//
//****************************************************************
//****************************************************************
var browserName = navigator.appName;
var browserVer = parseInt(navigator.appVersion);
var version = "no";

if (browserName == "Netscape" && browserVer >=3) version = "yes";
if (browserName == "Microsoft Internet Explorer" && browserVer >=4) version = "yes";

//****************************************************************
//	Form Validation
//****************************************************************
function ValidateForm(FormName) 
{ 
  // Check if neither Format nor Size were selected
  if ((FormName.os1.value == 'NoSelection') && (FormName.os0.value == 'NoSelection')){
  alert("Please select a Size and Format!");
  return false;
  }
  // Check if Size has been selected
  if (FormName.os1.value == 'NoSelection'){
  alert("Please select a Size!");
  return false;
  }
  // Check if Format has been selected
  if (FormName.os0.value == 'NoSelection'){
  alert("Please select a Format!");
  return false;
  }
  // If Format and Size have been selected
  return true;
} 

//****************************************************************
//	popup
//****************************************************************
function popup(mylink, windowname) 
{ 
if (! window.focus)return true; 
var href; 
if (typeof(mylink) == 'string') 
	href=mylink; 
else 
	href=mylink.href; 
	var newWin = window.open(href, windowname, 'width=750,height=500,left=50,top=50,scrollbars=yes,resizable=yes'); 
	newWin.focus()
	return false; 
} 

//****************************************************************
//	popup2
//****************************************************************
function popup2(mylink, windowname) 
{ 
if (! window.focus)return true; 
var href; 
if (typeof(mylink) == 'string') 
	href=mylink; 
else 
	href=mylink.href; 
	var newWin = window.open(href, windowname, 'width=400,height=300,left=100,top=100,scrollbars=no,resizable=no'); 
	newWin.focus()
	return false; 
} 

//****************************************************************
//	picSwitch
//****************************************************************
function picSwitch(name) {
var pic = eval( "document." + name );
if (pic) {
	if (pic.src.indexOf("c.gif") > -1) {
		// Don't change
		}
	else if (pic.src.indexOf("a.gif") == -1) {
		pic.src = pic.src.substring(0,pic.src.length-5)+"a.gif"
		} 
	else {
		pic.src = pic.src.substring(0,pic.src.length-5)+"b.gif"
		}
	}
}

//****************************************************************
//	autotab
//****************************************************************
function autotab(original,destination){
if (original.getAttribute&&original.value.length==original.getAttribute("maxlength"))
destination.focus()
}


