function universal_popup(mylink, windowname, width, height, x_pos, y_pos)
// sets default
{
if (!window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window_handle = window.open(href, windowname, 'scrollbars=1,resizable=1');
if (!width) {
    width=400;  // default size
    height=400;
}
window_handle.resizeTo(width, height);
if (!x_pos) {
    x_pos=200;  // default position
    y_pos=100;
}
window_handle.moveTo(x_pos, y_pos);
window_handle.focus();
return false;
}
//  autoTab.js - from Medicare web site.
//
//  Example call:
//    <input type="text" id="firstname" name="" size=20 
//          onKeyup="autoTab(event, this, 'surname')" maxlength=20>
//    <input type="text" id="surname" name="" size=20 maxlength=20>
//
//  e is the current event, ie a keyPress
//  tabFrom is the current element with focus
//  tabTo is the element id to tab to (new focus)

function autoTab(e, tabFrom, tabTo) {

  switch (e.keyCode) {
    //Ignore navigation type Keys
    case 9:
      //Tab Key
      break
    case 16:
      //Shift Key (used with Tab to move backwards)
      break
    case 35:
      //End Key
      break
    case 36:
      //Home Key
      break
    case 37:
      //Up Arrow
      break
    case 38:
      //Right Arrow
      break
    case 39:
      //Down Arrow
      break
    case 40:
      //Left Arrow
      break
    default:
      //Check the tab field allows the Attribute property
      if (tabFrom.getAttribute) {

        //AutoTab for Text input field
        if (tabFrom.getAttribute("type") == "text" || tabFrom.getAttribute("type") == "password") {

          //Check the Input field maximum length
          if (tabFrom.value.length == tabFrom.getAttribute("maxlength")) {
            //AutoTab
            document.getElementById(tabTo).focus();
          }
        }
      }
  }
}
//  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *
function changeOption()
{
    x=document.getElementsByTagName('form')[0];
    x.id='changed';
}
//  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *
function formSubmit()
{
    x=document.getElementsByTagName('form')[0];
    if (x.id=='changed') {
        r=alert('One or more of the action options have been changed.\nUpdate the settings before returning.');
    }
    else {
        window.location.assign("admin_class.php");
    }
}
//  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *
function popup_cart_delivery(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window_handle = window.open(href, windowname, 'width=420,height=450,scrollbars=1,resizable=1');
window_handle.focus();
return false;
}
//  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *
function popup_grain_mills_large(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window_handle = window.open(href, windowname, 'width=900,height=800,scrollbars=1,resizable=1');
window_handle.moveTo(50,50);
window_handle.focus();
return false;
}
//  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *
function popup_small(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window_handle = window.open(href, windowname, 'width=400,height=300');
window_handle.focus();
return false;
}
//  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *
function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window_handle = window.open(href, windowname, 'width=820,height=550');
window_handle.focus();
return false;
}
//  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *
function popup_portrait(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window_handle = window.open(href, windowname, 'width=420,height=620');
window_handle.focus();
return false;
}
//  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *
function popup_delivery(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window_handle = window.open(href, windowname, 'width=840,height=620,scrollbars=1,resizable=1');
window_handle.focus();
return false;
}

function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0');");
}
//  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *
function popup505_300(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
    window_handle = window.open(href, windowname, "location=0,status=0,width=505,height=255,menubar=0,resizable=1,scrollbars=1,titlebar=0,left=500,top=300");

    window_handle.focus();

return false;
}
//  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *
function popup800_600(mylink1, windowname1)
{
if (! window.focus)return true;
var href;
if (typeof(mylink1) == 'string')
   href=mylink1;
else
   href=mylink1.href;
    window_handle1 = window.open(href, windowname1, "location=0,status=0,width=800,height=700,menubar=0,resizable=1,scrollbars=1,titlebar=0,left=400,top=0");

    window_handle1.focus();

return false;
}



