// JavaScript Document
// Browser detect
var doit = false

with(navigator) {
  code = appCodeName; 
  app = appName; 
  version = appVersion; 
  iver = parseInt(version); 
  ua = userAgent;
  }

// this will work in "Mozilla" 3+ (includes MSIE 4)
if ( code == "Mozilla" && iver >= 3 )
{doit = true}
else 
{doit = false}

if (doit==true)
{
if (document.images) {
// Main Rollover ON Graphics (when moused over)
image1on = new Image();  image1on.src = "images/nav/art_glass_on.gif";
image2on = new Image();  image2on.src = "images/nav/lighting_on.gif";
image3on = new Image();  image3on.src = "images/nav/furniture_on.gif";
image4on = new Image();  image4on.src = "images/nav/sculpture_on.gif";
image5on = new Image();  image5on.src = "images/nav/artwork_on.gif";
image6on = new Image();  image6on.src = "images/nav/accessories_on.gif";
image7on = new Image();  image7on.src = "images/nav/gallery_on.gif";
image8on = new Image();  image8on.src = "images/nav/email_on.gif";
image9on = new Image();  image9on.src = "images/nav/location_on.gif";
image10on = new Image();  image10on.src = "images/nav/contact_on.gif";
image11on = new Image();  image11on.src = "images/nav/home_on.gif";
image12on = new Image();  image12on.src = "images/h_artglass_on.jpg";
image13on = new Image();  image13on.src = "images/h_lighting_on.jpg";
image14on = new Image();  image14on.src = "images/h_furniture_on.jpg";
image15on = new Image();  image15on.src = "images/h_sculpture_on.jpg";
image16on = new Image();  image16on.src = "images/h_artwork_on.jpg";
image17on = new Image();  image17on.src = "images/h_accessories_on.jpg";
image18on = new Image();  image18on.src = "images/sm_nav/h_artglass_on.jpg";
image19on = new Image();  image19on.src = "images/sm_nav/h_lighting_on.jpg";
image20on = new Image();  image20on.src = "images/sm_nav/h_furniture_on.jpg";
image21on = new Image();  image21on.src = "images/sm_nav/h_sculpture_on.jpg";
image22on = new Image();  image22on.src = "images/sm_nav/h_artwork_on.jpg";
image23on = new Image();  image23on.src = "images/sm_nav/h_accessories_on.jpg";
image24on = new Image();  image24on.src = "images/view_detail_on.gif";

// Main Rollover OFF Graphics (when NOT moused over)
image1off = new Image();  image1off.src = "images/nav/art_glass_off.gif";
image2off = new Image();  image2off.src = "images/nav/lighting_off.gif";
image3off = new Image();  image3off.src = "images/nav/furniture_off.gif";
image4off = new Image();  image4off.src = "images/nav/sculpture_off.gif";
image5off = new Image();  image5off.src = "images/nav/artwork_off.gif";
image6off = new Image();  image6off.src = "images/nav/accessories_off.gif";
image7off = new Image();  image7off.src = "images/nav/gallery_off.gif";
image8off = new Image();  image8off.src = "images/nav/email_off.gif";
image9off = new Image();  image9off.src = "images/nav/location_off.gif";
image10off = new Image();  image10off.src = "images/nav/contact_off.gif";
image11off = new Image();  image11off.src = "images/nav/home_off.gif";
image12off = new Image();  image12off.src = "images/h_artglass_off.jpg";
image13off = new Image();  image13off.src = "images/h_lighting_off.jpg";
image14off = new Image();  image14off.src = "images/h_furniture_off.jpg";
image15off = new Image();  image15off.src = "images/h_sculpture_off.jpg";
image16off = new Image();  image16off.src = "images/h_artwork_off.jpg";
image17off = new Image();  image17off.src = "images/h_accessories_off.jpg";
image18off = new Image();  image18off.src = "images/sm_nav/h_artglass_off.jpg";
image19off = new Image();  image19off.src = "images/sm_nav/h_lighting_off.jpg";
image20off = new Image();  image20off.src = "images/sm_nav/h_furniture_off.jpg";
image21off = new Image();  image21off.src = "images/sm_nav/h_sculpture_off.jpg";
image22off = new Image();  image22off.src = "images/sm_nav/h_artwork_off.jpg";
image23off = new Image();  image23off.src = "images/sm_nav/h_accessories_off.jpg";
image24off = new Image();  image24off.src = "images/view_detail_off.gif";

}
}

// Main Rollover Functions (ON and OFF)

function turnOn(imageName) {
if (doit==true)
{if (document.images) {
    document[imageName].src = eval(imageName + "on.src"); }}
}        
function turnOff(imageName) {
if (doit==true)
{if (document.images) {
    document[imageName].src = eval(imageName + "off.src"); }}
}
//-->
<!--
var nslayer = 0;
var ielayer = 0;
nslayer = (document.layers)  ? 1:0;
ielayer = (document.all)  ? 1:0;

var do_submit = "";

function checksearchform() {
do_submit = "YES";

if(do_submit=="YES") {
if(document.searchform.search_term.value=='')
{alert("Please enter a search word(s).          ");
if(nslayer==1 || ielayer==1)
{document.searchform.search_term.focus()}
do_submit="NO"}}

if(do_submit=="YES") {
document.searchform.submit();
}

}
//-->
<!--
var ns4 = (document.layers)  ? 1:0;
var ie4 = (document.all)  ? 1:0;
var moz5 = ((navigator.userAgent.toLowerCase().indexOf("mozilla")==0) && (navigator.userAgent.toLowerCase().charAt(8) >= 5) && (navigator.userAgent.toLowerCase().indexOf("compatible")<0));

function doLayer(whichLayer) {
	if (moz5) {
	document.getElementById(whichLayer).style.position="relative";
	document.getElementById(whichLayer).style.visibility="visible";
	document.getElementById(whichLayer).style.display="none";
	}
	if (ns4) {
	document.layers[whichLayer].position="relative";
	document.layers[whichLayer].visibility="visible";
	}
	if (ie4) {
	document.all[whichLayer].style.position="relative";
	document.all[whichLayer].style.visibility="visible";
	}
}

function undoLayer(whichLayer) {
	if (moz5) {
	document.getElementById(whichLayer).style.visibility="hidden";
	document.getElementById(whichLayer).style.display="block";
	}
	if (ns4) {
	document.layers[whichLayer].visibility="hidden";
	}
	if (ie4) {
	document.all[whichLayer].style.visibility="hidden";
	}
}
//-->
<!--
function LockPage() {

for (i=0; i<document.links.length; i++) {
	document.links[i].href="javascript:void(document.foreform.submit())";
	if(document.links[i].name=="but_view") {document.links[i].style.visibility="hidden";document.links[i].style.position="absolute";doLayer("div_"+document.links[i].name)}
	if(document.links[i].name=="but_check2") {document.links[i].style.visibility="hidden";document.links[i].style.position="absolute";doLayer("div_"+document.links[i].name)}
	
	if(document.links[i].name=="but_empty") {document.links[i].style.visibility="hidden";document.links[i].style.position="absolute";doLayer("div_"+document.links[i].name)}
	if(document.links[i].name=="but_ref") {document.links[i].style.visibility="hidden";document.links[i].style.position="absolute";doLayer("div_"+document.links[i].name)}
	if(document.links[i].name=="but_checkout") {document.links[i].style.visibility="hidden";document.links[i].style.position="absolute";doLayer("div_"+document.links[i].name)}
	if(document.links[i].name=="but_edit") {document.links[i].style.visibility="hidden";document.links[i].style.position="absolute";doLayer("div_"+document.links[i].name)}
	if(document.links[i].name=="but_keep") {document.links[i].style.visibility="hidden";document.links[i].style.position="absolute";doLayer("div_"+document.links[i].name)}
	if(document.links[i].name=="but_cancel") {document.links[i].style.visibility="hidden";document.links[i].style.position="absolute";doLayer("div_"+document.links[i].name)}
	if(document.links[i].name=="but_finish") {document.links[i].style.visibility="hidden";document.links[i].style.position="absolute";doLayer("div_"+document.links[i].name)}

//	if(document.links[i].name=="but_quote") {document.links[i].style.visibility="hidden";document.links[i].style.position="absolute";doLayer("div_"+document.links[i].name)}
//	if(document.links[i].name=="but_email") {document.links[i].style.visibility="hidden";document.links[i].style.position="absolute";doLayer("div_"+document.links[i].name)}

	
	but_counter = (i+1);
	if(i < 9) {but_counter="0"+(i+1)}
	for (j=0; j<document.links.length; j++) {
	if(document.links[j].name=="bottom"+but_counter) {document.links[j].style.visibility="hidden";document.links[j].style.position="absolute";doLayer("div_"+document.links[j].name)}
	} // for j
	
}
//	undoLayer("div_flash"); // CUSTOM ONLY FOR SITES THAT HAVE FLASH NAVIGATION
}
//-->
<!--
function viewsamp(win_name,width1,height1,vtype,witem) {
// window.open("preview.cfm?vtype="+escape(vtype)+"&witem="+escape(witem),win_name,"WIDTH="+width1+",HEIGHT="+height1+",location=0,menubar=1,resizable=1,scrollbars=1,status=0,titlebar=1,toolbar=0");
openwin("preview.cfm?vtype="+escape(vtype)+"&witem="+escape(witem),width1,height1,0,0,1,1,0,0,0);
}
//-->
<!--
function openwin(page_name,width1,height1,scrollbars1,resizable1,menubar1,status1,toolbar1,titlebar1,location1) {
if(typeof popup_window != 'undefined') {
if(popup_window != null) {
if(popup_window.closed==false) {
popup_window.close();
} // window closed
} // window null
} // window undefined
popup_window=window.open(page_name,"popup_window","WIDTH="+width1+",HEIGHT="+height1+",top=45,left=50,location=0,menubar="+menubar1+",resizable="+resizable1+",scrollbars="+scrollbars1+",status="+status1+",toolbar="+toolbar1+",titlebar="+titlebar1+",location="+location1);
if(typeof popup_window != 'undefined') {
if(popup_window != null) {
if(popup_window.closed==false) {
popup_window.focus();
} // window closed
} // window null
} // window undefined
return
}
//-->
<!--
var nslayer = 0;
var ielayer = 0;
nslayer = (document.layers)  ? 1:0;
ielayer = (document.all)  ? 1:0;

var do_submit = "";

function checkform() {
do_submit = "YES";

if(do_submit=="YES") {
if(document.foreform.first.value=='')
{alert("Please enter a NAME.          ");
if(nslayer==1 || ielayer==1)
{document.foreform.first.focus()}
do_submit="NO"}}

if(do_submit=="YES") {
if(document.foreform.address.value=='')
{alert("Please enter an ADDRESS.          ");
if(nslayer==1 || ielayer==1)
{document.foreform.address.focus()}
do_submit="NO"}}

if(do_submit=="YES") {
if(document.foreform.city.value=='')
{alert("Please enter a CITY.          ");
if(nslayer==1 || ielayer==1)
{document.foreform.city.focus()}
do_submit="NO"}}

if(do_submit=="YES") {
if(document.foreform.state.value=='')
{alert("Please enter a STATE/PROVINCE.          ");
if(nslayer==1 || ielayer==1)
{document.foreform.state.focus()}
do_submit="NO"}}

if(do_submit=="YES") {
if(document.foreform.zip.value=='')
{alert("Please enter a POSTAL CODE.          ");
if(nslayer==1 || ielayer==1)
{document.foreform.zip.focus()}
do_submit="NO"}}

if(do_submit=="YES") {
if(document.foreform.country.value=='')
{alert("Please enter an COUNTRY.          ");
if(nslayer==1 || ielayer==1)
{document.foreform.country.focus()}
do_submit="NO"}}

if(do_submit=="YES") {
if(document.foreform.phone.value=='')
{alert("Please enter a TELEPHONE NUMBER.          ");
if(nslayer==1 || ielayer==1)
{document.foreform.phone.focus()}
do_submit="NO"}}

if(do_submit=="YES") {
if (checkemail(document.foreform.email.value)==false)
{alert("Please enter a valid EMAIL.          ");
if(nslayer==1 || ielayer==1)
{document.foreform.email.focus()}
do_submit="NO"}}

if(do_submit=="YES") {
if(document.foreform.iama.options[0].selected)
{alert("Please select your PROFESSION.          ");
if(nslayer==1 || ielayer==1)
{document.foreform.iama.focus()}
do_submit="NO"}}

if(do_submit=="YES") {
document.foreform.submit();
}

}
//-->
<!--
function checkemail(the_value) {
// Checks the email field for:
// 1. must be at least 6 characters long i.e. 1@3.56
// 2. cannot begin with a "@" or a "."
// 3. cannot end with a "@" or a "."
// 4. cannot have 2 "." in a row
// 5. cannot have ".@" nor "@."
// 6. must contain 1 "@" and at least 1 "."
// 7. must have 2 or 3 characters after the final "."
// 8. checks specified bad chars like commas
var amp1 = 0;
var dot1 = 0;
var postdot1 = 0;
if (the_value.length<6)
{return false}
if (the_value.charAt(0)=='.')
{return false}
if (the_value.charAt(the_value.length)=='.')
{return false}
if (the_value.charAt(0)=='@')
{return false}
if (the_value.charAt(the_value.length)=='@')
{return false}
amp1 = 0;
dot1 = 0;
postdot1 = 0;
for (var i = 0; i < the_value.length; i++)
{
if (the_value.charAt(i)==',') // add bad chars here
{return false}
if (the_value.charAt(i)=='@')
{if (the_value.charAt(i-1)=='.')
{return false}
amp1=amp1+1}
if (the_value.charAt(i)=='.')
{if (the_value.charAt(i-1)=='.')
{return false}
if (the_value.charAt(i-1)=='@')
{return false}
if (dot1>0)
{dot1=0;
postdot1=0}
dot1=dot1+1}
if (dot1>0)
{postdot1=postdot1+1}
}
if (amp1!=1)
{return false}
if (dot1<1)
{return false}
if (postdot1!=5 && postdot1!=4 && postdot1!=3)
{return false}
return true
}
//-->
function FrontPage_Form1_Validator(theForm)
{

  if (theForm.Purchase_ItemDesc1.value == "")
  {
    alert("Please enter a value for the \"Item #1\" field.");
    theForm.Purchase_ItemDesc1.focus();
    return (false);
  }

  if (theForm.Purchase_ShippingName.value == "")
  {
    alert("Please enter a value for the \"Name\" field.");
    theForm.Purchase_ShippingName.focus();
    return (false);
  }

  if (theForm.Purchase_ShippingAddress1.value == "")
  {
    alert("Please enter a value for the \"Address\" field.");
    theForm.Purchase_ShippingAddress1.focus();
    return (false);
  }

  if (theForm.Purchase_ShippingCity.value == "")
  {
    alert("Please enter a value for the \"City\" field.");
    theForm.Purchase_ShippingCity.focus();
    return (false);
  }

  if (theForm.Purchase_ShippingState.value == "")
  {
    alert("Please enter a value for the \"State\" field.");
    theForm.Purchase_ShippingState.focus();
    return (false);
  }

  if (theForm.Purchase_ShippingZip.value == "")
  {
    alert("Please enter a value for the \"Postal Code\" field.");
    theForm.Purchase_ShippingZip.focus();
    return (false);
  }

  if (theForm.Purchase_ShippingZip.value.length < 2)
  {
    alert("Please enter at least 2 characters in the \"Postal Code\" field.");
    theForm.Purchase_ShippingZip.focus();
    return (false);
  }

  if (theForm.Purchase_ShippingZip.value.length > 5)
  {
    alert("Please enter at most 5 characters in the \"Postal Code\" field.");
    theForm.Purchase_ShippingZip.focus();
    return (false);
  }

  if (theForm.Purchase_ShippingCountry.value == "")
  {
    alert("Please enter a value for the \"Country\" field.");
    theForm.Purchase_ShippingCountry.focus();
    return (false);
  }
  if(theForm.Purchase_ShippingTel.value == "")
  {
    alert("Please enter a value for the \"Telephone\" field.");
    theForm.Purchase_ShippingTel.focus();
    return (false);
  }
    if(theForm.Purchase_ShippingEmail.value == "")
  {
    alert("Please enter a value for the \"Email\" field.");
    theForm.Purchase_ShippingEmail.focus();
    return (false);
  }
    if(theForm.PaymentOptions.value == "")
  {
    alert("Please enter a value for the \"PaymentOptions\" field.");
    theForm.PaymentOptions.focus();
    return (false);
  }
  return (true);
}