// Function: openWindow
// Description:
//   Open a URL in a new browser window.
// Parameters:
//   theURL     the URL of the window content
function openWindow(theURL) {
  window.open(theURL);
  return false;
}

// Function: openPopupWindow
// Description:
//   Open a URL in a popup browser window.
// Parameters:
//   theURL     the URL of the window content
function openPopupWindow(theURL) {
  window.open(theURL,'','width=875,height=650');
  return false;
}

// Function: openInquirryWindow
// Description:
//   Open a URL in a popup browser window. The window is sized
//   to fit the inquiry text.
// Parameters:
//   theURL     the URL of the window content
function openInquiryWindow(theURL) {
  window.open(theURL,'','width=650,height=600');
  return false;
}

// Function: closeWindow
// Description:
//   Closes the current window.
function closeWindow() {
  window.close();
}

// Function: back
// Description:
//   Go to the previous page in the browser history
function back() {
  window.history.back();
}

// Function: changeBorder
// Description:
//   Changes the border color of an element.
// Parameters:
//   theURL     the event that triggered the border change
//   color      the new border color
function changeBorder(evt, color) {
  if (evt.target)
  {
    target=evt.target;
  }
  else if (evt.srcElement)
  {
    target=evt.srcElement;
  }
  if (target.nodeType==3) // defeat Safari bug
  {
    target = target.parentNode;
  }
  target.style.borderColor = color;
}

// Function: restoreBorder
// Description:
//   Restores the border color of an element.
// Parameters:
//   theURL     the event that triggered the border change
//   color      the new border color
function restoreBorder(evt, color) {
  if (evt.target)
  {
    target=evt.target;
  }
  else if (evt.srcElement)
  {
    target=evt.srcElement;
  }
  if (target.nodeType==3) // defeat Safari bug
  {
    target = target.parentNode;
  }
  target.style.borderColor = color;
}

function getShoppingURL(form){
  form.shopping_url.value = window.location.href;
}

// Script Source: CodeLifter.com
// Copyright 2003
// Do not remove this header.

// ----------- Setups ------------------
// Set the address, width, height, top
// and left dimensions for the popup
// window below.
// -------------------------------------

PopUpLeft   =  100;
PopUpTop    =  100;
PopUpWidth  =  500;
PopUpHeight =  280;

// -------------------------------------
// Do not edit anything below this line.
// -------------------------------------

if (PopUpURL)
{
  isIE=document.all;
  isNN=!document.all&&document.getElementById;
  isN4=document.layers;
  popO='left='+PopUpLeft+',top='+PopUpTop+',width='+PopUpWidth+',height='+PopUpHeight
  
  if (isIE||isNN){
  document.oncontextmenu=checkV;
  }else{
  document.captureEvents(Event.MOUSEDOWN || Event.MOUSEUP);
  document.onmousedown=checkV;}
}

function checkV(e){
if (isN4){
if (e.which==2||e.which==3){
dPUW=window.open(PopUpURL,'nrc',popO);
return false;
}}else{
dPUW=window.open(PopUpURL,'nrc',popO);
return false;}}

var isOrderForm = false;

function changeOrderType()
{
  orderType = document.getElementById("ordertype");
  if (orderType.value=='online')
    orderType.value = "email";
  else
    orderType.value = "online";
  document.getElementById("form").submit();
}
