var OldDesc;

// Check for IE4+ CSS Support
(navigator.userAgent.indexOf("MSIE")!=-1)?IE=true:IE=false;
Ver = parseInt(navigator.appVersion);
if (IE) { IE = Ver; }

function Help(num) {                // Popup a help window
  var win1 = window.open("rm.cgi?help="+num,"HelpWin","width=240,height=350,toolbar=no,resizable=yes,scrollbars=yes,directories=no");
  }


// *******************************************************
function confirmLink(theLink, theSqlQuery)
{
    //  var is_confirmed = confirm(confirmMsg + ' :\n' + theSqlQuery);
    var is_confirmed = confirm(confirmMsg + theSqlQuery + '?');
    if (is_confirmed) {
        theLink.href += '&is_js_confirmed=1';
    }

    return is_confirmed;

} // end of the 'confirmLink()' function
var confirmMsg  = 'Do you really want to ';

// *******************************************************
function openPrint(path)
{
     window.open(path,'detail','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,width=550,height=350,resizable=yes');
}

// *******************************************************
function TabNext(obj,event,len,next_field) {
        if (event == "down") {
                phone_field_length=obj.value.length;
                }
        else if (event == "up") {
                if (obj.value.length != phone_field_length) {
                        phone_field_length=obj.value.length;

                        if (phone_field_length == len) {
                                next_field.focus();
                                }
                        }
                }
        }

// *******************************************************
function openHelp(path)
{
     window.open(path,'detail','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,width=550,height=450,resizable=yes');
}

// *******************************************************
function openPhotoWindow(path) {
         self.name="opener";
         window.open(path, 'photos', 'toolbar=no,scrollbars=yes,resizable=yes,width=500,height=400');
}


//******************************************************
function enableUpload()
{
document.form1.imagefile.disabled=false;
}

//*********************************************************
function openDetail(path)
{
    if (document.all)
        var xMax = screen.width, yMax = screen.height;
    else
        if (document.layers)
            var xMax = window.outerWidth, yMax = window.outerHeight;
        else
            var xMax = 640, yMax=480;
    var xOffset = (xMax - 200)/2, yOffset = (yMax - 200)/2;
                self.name="opener";
                window.open(path,'detail','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,width=250,height=250,resizable=yes,screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+'');
}

function closeRemote() {
timer = setTimeout('window.close();', 10);
}

function openItemDetail(path)
{
    if (document.all)
        var xMax = screen.width, yMax = screen.height;
    else
        if (document.layers)
            var xMax = window.outerWidth, yMax = window.outerHeight;
        else
            var xMax = 640, yMax=480;
    var xOffset = (xMax - 200)/2, yOffset = (yMax - 200)/2;
                self.name="opener";
                window.open(path,'detail','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,width=350,height=350,resizable=yes,screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+'');
}


//***********************************************************
function verify() {
var themessage = "The following fields are required:\n";
if (document.cust_info.first.value=="") {
themessage = themessage + " - First Name\n";
}
if (document.cust_info.last.value=="") {
themessage = themessage + " - Last Name\n";
}
if (document.cust_info.email.value=="") {
themessage = themessage + " - E-mail\n";
}
if (document.cust_info.phone1.value=="") {
themessage = themessage + " - Phone Number\n";
}
if (document.cust_info.phone2.value=="") {
themessage = themessage + " - Phone Number\n";
}
if (document.cust_info.phone3.value=="") {
themessage = themessage + " - Phone Number\n";
}
if (document.cust_info.address1.value=="") {
themessage = themessage + " - Street Address\n";
}
if (document.cust_info.city.value=="") {
themessage = themessage + " - City\n";
}
if (document.cust_info.state.value=="") {
themessage = themessage + " - State\n";
}
if (document.cust_info.zip.value=="") {
themessage = themessage + " - Zip Code\n";
}
if (document.cust_info.cc_no.value=="") {
themessage = themessage + " - Credit Card Number\n";
}
if (document.cust_info.exp_mo.value=="") {
themessage = themessage + " - CC Exipration Month\n";
}
if (document.cust_info.exp_yr.value=="") {
themessage = themessage + " - CC Expiration Year\n";
}
if (document.cust_info.cc_code.value=="") {
themessage = themessage + " - CC Verification Code\n";
}


//alert if fields are empty and cancel form submit
if (themessage == "The following fields are required:\n") {
document.cust_info.submit();
}
else {
alert(themessage);
return false;
   }
}
