
var usingInternetExplorer= document.all;        // Sets identifiier for Internet Explorer
var usingNetscape4x = document.layers;        // Sets identifier for Netscape 4.x
                                        // All others will be handled by the else command

function revealRGB ( reveal ) {
var newColour, changeColour;

// Associate Variables with Objects
if ( usingInternetExplorer ){
        newColour = document.all.newcolour;
        changeColour = document.all.changecolour;
} else {
   if ( usingNetscape4x ) {
        newColour = document.newcolour;
        changeColour = document.changecolour;
   } else {
               newColour = document.getElementById ("newcolour");
               changeColour = document.getElementById ("changecolour");
}
}
        if ( reveal ){
                newColour.style.visibility = "visible";
                changeColour.style.visibility = "hidden";
        } else {
                newColour.style.visibility = "hidden";
                changeColour.style.visibility = "visible";
        }
}

function changeBackgroundColour ( colour) {
        var exp = new Date();
        exp.setTime(exp.getTime() + 31536000000);        // Set cookie for 1 year

        document.body.style.backgroundColor= colour;
        document.forms.theform.displaytxt.style.backgroundColor= colour;

        setCookie("bgcolour",colour, exp);

        revealRGB (false);
}


function populateManModel ( type ) {

var autoWeight, autoType, manType, manModel;        //User Inputs

// Associate Variables with Objects
if ( usingInternetExplorer ){
        autoWeight = document.all.autoWeight;
        autoType = document.all.autoType;
        manType = document.all.manType;
        manModel = document.all.manModel;
} else {
   if ( usingNetscape4x ) {
        autoWeight = document.autoWeight;
        autoType = document.autoType;
        manType = document.manType;
        manModel = document.manModel;
   } else {
               autoWeight = document.getElementById ("autoWeight");
               autoType = document.getElementById  ("autoType");
               manType = document.getElementById ("manType");
               manModel= document.getElementById  ("manModel");
}
}

manModel.length = 1;
switch ( type) {
        case "catamaran":
                manModel.length ++;
                manModel [manModel.length - 1] = new Option ("GM 6120 Cantalever", "GM 6120 Cantalever");
                break;
        case "pwc":
                manModel.length ++;
                manModel [manModel.length - 1] = new Option ("GM 1260 Cantalever", "GM 1260 Cantalever");
                manModel.length ++;
                manModel [manModel.length - 1] = new Option ("GM 1263V" , "GM 1263V");
                break;
        case "pontoon":
                manModel.length ++;
                manModel [manModel.length - 1] = new Option ("GM 35120P" ,"GM 35120P" );
                manModel.length ++;
                manModel [manModel.length - 1] = new Option ("GM 45120P" ,"GM 45120P" );
                break;
        case "vhull":
                manModel.length ++;
                manModel [manModel.length - 1] = new Option ("GM 1596" ,"GM 1596" );
                manModel.length ++;
                manModel [manModel.length - 1] = new Option ("GM 2096" ,"GM 2096" );
                manModel.length ++;
                manModel [manModel.length - 1] = new Option ("GM 35108" ,"GM 35108" );
                manModel.length ++;
                manModel [manModel.length - 1] = new Option ("GM 45108" ,"GM 45108" );
                manModel.length ++;
                manModel [manModel.length - 1] = new Option ("GM 45120" ,"GM 45120" );
                manModel.length ++;
                manModel [manModel.length - 1] = new Option ("GM 45120 Hydraulic" ,"GM 45120 Hydraulic" );
                manModel.length ++;
                manModel [manModel.length - 1] = new Option ("GM 55120" ,"GM 55120" );
                manModel.length ++;
                manModel [manModel.length - 1] = new Option ("GM 65120 Hydraulic" ,"GM 65120 Hydraulic" );
                break;
        case "small":
                manModel.length ++;
                manModel [manModel.length - 1] = new Option ("Single Keel Roller" ,"Single Keel Roller" );
                manModel.length ++;
                manModel [manModel.length - 1] = new Option ("8' Keel Roller" ,"8' Keel Roller" );
                manModel.length ++;
                manModel [manModel.length - 1] = new Option ("10' Keel Roller" ,"10' Keel Roller" );
                break;
        case "":         break;
}
}



function displayInfo ( product ) {        // Displays the technical Info for the requested product

var prodName, lbl1, lbl2, lbl3, lbl4, lbl5, width, capacity, weight, lift, price, displayPic; //Displayed Outputs

// Associate variables with Objects
if ( usingInternetExplorer ){
        prodName = document.all.prodName;
        lbl1 = document.all.lbl1;
        lbl2 = document.all.lbl2;
        lbl3 = document.all.lbl3;
        lbl4 = document.all.lbl4;
        lbl5 = document.all.lbl5;
        width = document.all.width;
        capacity = document.all.capacity;
        weight = document.all.weight;
        lift = document.all.lift;
        price = document.all.price;
        displayPic = document.all.displayPic;
} else {
   if ( usingNetscape4x ) {
        prodName = document.prodName;
        lbl1 = document.lbl1;
        lbl2 = document.lbl2;
        lbl3 = document.lbl3;
        lbl4 = document.lbl4;
        lbl5 = document.lbl5;
        width = document.width;
        capacity = document.capacity;
        weight = document.weight;
        lift = document.lift;
        price = document.price;
        displayPic = document.displayPic;
   } else {
        prodName = document.getElementById ("prodName");
        lbl1 = document.getElementById ("lbl1");
        lbl2 = document.getElementById ("lbl2");
        lbl3 = document.getElementById ("lbl3");
        lbl4 = document.getElementById ("lbl4");
        lbl5 = document.getElementById ("lbl5");
        width = document.getElementById ("width");
        capacity = document.getElementById  ("capacity");
        weight = document.getElementById ("weight");
        lift = document.getElementById  ("lift");
        price = document.getElementById  ("price");
        displayPic = document.getElementById ("displayPic");
   }
}

prodName.innerHTML = product;
lbl1.innerHTML = "Width:";
lbl2.innerHTML = "Capacity:";
lbl3.innerHTML = "Weight:";
lbl4.innerHTML = "Lift:";
lbl5.innerHTML = "Price:   $ ";
displayPic.src = "pics/blank.GIF";

switch ( product ) {
//        CATAMARAN LIFTS
        case "GM 6120 Cantalever":
             width.innerHTML = "120''";
             capacity.innerHTML  = "600lbs.";
             weight.innerHTML = "180lbs.";
             lift.innerHTML = "36''";
             price.innerHTML = "2395.00";
             displayPic.src = "pics/lifts/GM60120.GIF";
             break;

//        PWC LIFTS
        case "GM 1260 Cantalever":
             width.innerHTML = "60''";
             capacity.innerHTML   = "1200lbs.";
             weight.innerHTML = "140lbs. ";
             lift.innerHTML= "36''";
             price.innerHTML = "1395.00";
             displayPic.src = "pics/lifts/GM1060.GIF";
             break;
        case "GM 1263V":
             width.innerHTML = "63''";
             capacity.innerHTML  = "1200lbs.";
             weight.innerHTML = "160lbs.";
             lift.innerHTML = "48''";
             price.innerHTML = "1695.00";
             displayPic.src = "pics/lifts/GM1063V.GIF";
             break;

//        PONTOON LIFTS
       case "GM 35120P":
             width.innerHTML = "120''";
             capacity.innerHTML  = "3500lbs.";
             weight.innerHTML = "420lbs.";
             lift.innerHTML= "60''";
             price.innerHTML = "4695.00";
             displayPic.src = "pics/lifts/GM30120P.GIF";
             break;
        case "GM 45120P":
             width.innerHTML = "120''";
             capacity.innerHTML  = "4500lbs.";
             weight.innerHTML = "495lbs.";
             lift.innerHTML = "60''";
             price.innerHTML = "5495.00";
             displayPic.src = "pics/lifts/GM45120P.GIF";
             break;

//        V-HULL LIFTS
        case "GM 1596":
             width.innerHTML = "96''";
             capacity.innerHTML  = "1500lbs.";
             weight.innerHTML = "260lbs.";
             lift.innerHTML = "48''";
             price.innerHTML = "2495.00";
             displayPic.src = "pics/lifts/GM1596.GIF";
             break;
        case "GM 2096":
             width.innerHTML = "96''";
             capacity.innerHTML = "2000lbs.";
             weight.innerHTML = "340lbs.";
             lift.innerHTML = "60''";
             price.innerHTML = "3395.00";
             displayPic.src = "pics/lifts/GM2096.GIF";
             break;
       case "GM 35108":
             width.innerHTML = "108''";
             capacity.innerHTML  = "3500lbs.";
             weight.innerHTML = "390lbs.";
             lift.innerHTML = "60''";
             price.innerHTML = "4095.00";
             displayPic.src = "pics/lifts/GM30108.GIF";
             break;
        case "GM 35120":
             width.innerHTML = "120''";
             capacity.innerHTML  = "3500lbs.";
             weight.innerHTML = "450lbs.";
             lift.innerHTML = "60''";
             price.innerHTML = "4195.00";
             displayPic.src = "pics/lifts/GM30120.GIF";
             break;
        case "GM 45108":
             width.innerHTML = "108''";
             capacity.innerHTML  = "4500lbs.";
             weight.innerHTML = "435lbs.";
             lift.innerHTML = "60''";
             price.innerHTML = "4645.00";
             displayPic.src = "pics/lifts/GM30120.GIF";
             break;
        case "GM 45120":
             width.innerHTML = "120''";
             capacity.innerHTML  = "4500lbs.";
             weight.innerHTML = "460lbs.";
             lift.innerHTML = "60''";
             price.innerHTML = "4995.00";
             displayPic.src = "pics/lifts/GM45120.GIF";
             break;
         case "GM 45120 Hydraulic":
             width.innerHTML = "120''";
             capacity.innerHTML  = "4500lbs.";
             weight.innerHTML = "510lbs.";
             lift.innerHTML = "53''";
             price.innerHTML = "7995.00";
             displayPic.src = "pics/blank.GIF";
             break;
        case "GM 55120":
             width.innerHTML = "120''";
             capacity.innerHTML  = "5500lbs.";
             weight.innerHTML = "600lbs.";
             lift.innerHTML = "60''";
             price.innerHTML = "6495.00";
             displayPic.src = "pics/lifts/GM55120.GIF";
             break;
         case "GM 65120 Hydraulic":
             width.innerHTML = "120''";
             capacity.innerHTML  = "6500lbs.";
             weight.innerHTML = "650lbs.";
             lift.innerHTML = "53''";
             price.innerHTML = "9595.00";
             displayPic.src = "pics/blank.GIF";
             break;

//        SMALL LIFTS

        case "Single Keel Roller":
             prodName.innerHTML = "Corner Roller";
             width.innerHTML = "13 inches";
             capacity.innerHTML  = "600-800lbs.";
             weight.innerHTML = "10lbs.";
             lift.innerHTML = "n/a''";
             price.innerHTML = "69.95";
             displayPic.src = "pics/lifts/singleKeelRoller.GIF";
             break;
        case "8' Keel Roller":
             prodName.innerHTML = "8' Keel Roller";
             width.innerHTML = "???";
             capacity.innerHTML  = "400lbs.";
             weight.innerHTML = "???lbs.";
             lift.innerHTML = "flat on shore";
             price.innerHTML = "399";
             displayPic.src = "pics/lifts/8KeelRoller.GIF";
             break;
        case "10' Keel Roller":
             prodName.innerHTML = "10' Keel Roller";
             width.innerHTML = "???";
             capacity.innerHTML  = "400lbs.";
             weight.innerHTML = "???lbs.";
             lift.innerHTML = "flat on shore";
             price.innerHTML = "445";
             displayPic.src = "pics/lifts/10KeelRoller.GIF";
             break;

//        DEFAULTS
        case "BLANK":
             prodName.innerHTML = "";
             lbl1.innerHTML = "";
             lbl2.innerHTML = "";
             lbl3.innerHTML = "";
             lbl4.innerHTML = "";
             lbl5.innerHTML = "";
             width.innerHTML = "";
             capacity.innerHTML  = "";
             weight.innerHTML = "";
             lift.innerHTML = "";
             price.innerHTML = "";
             displayPic.src = "pics/blank.GIF";
             break;
        case "NONE":
             prodName.innerHTML = "";
             lbl1.innerHTML = "";
             lbl2.innerHTML = "";
             lbl3.innerHTML = "";
             lbl4.innerHTML = "";
             lbl5.innerHTML = "";
             width.innerHTML = "";
             capacity.innerHTML  = "No Models Available";
             weight.innerHTML = "Please <a href='contact.html'>contact us</a> about Special Orders";
             lift.innerHTML = "";
             price.innerHTML = "";
             displayPic.src = "pics/blank.GIF";
}
}

function suggestModel (weight, type) {

var manType, manModel;
weight *= 1.2;        // Adds 20% weight to accomodate fuel, lifejackets, paddles, etc.

if ( usingInternetExplorer ){
        manType = document.all.manType;
        manModel = document.all.manModel;

} else {
   if ( usingNetscape4x ) {
        manType = document.manType;
        manModel = document.manModel;
   } else {
               manType = document.getElementById ("manType");
               manModel= document.getElementById  ("manModel");
   }
}

manType.options[0].selected = "selected";
manModel.options[0].selected = "selected";

switch ( type ){
        case "catamaran":
                if (weight < 600) {displayInfo ("GM 6120 Cantalever");}
                else {displayInfo ("NONE");}
                break;
        case "pwc":
                if (weight < 1200) {displayInfo ("GM 1260 Cantalever");}
                else {displayInfo ("NONE");}
                break;
        case "pontoon":
                if (weight < 3500) {displayInfo ("GM 35120P");}
                else if (weight < 4500) {displayInfo ("GM 45120P");}
                else {displayInfo ("NONE");}
                break;
        case "vhull":
                if (weight < 1500) {displayInfo ("GM 1596");}
                else if (weight < 2000) {displayInfo ("GM 2096");}
                else if (weight < 3500) {displayInfo ("GM 35108");}
                else if (weight < 4500) {displayInfo ("GM 45108");}
                else if (weight < 4500) {displayInfo ("GM 45120");}
                else if (weight < 5500) {displayInfo ("GM 55120");}
                else if (weight < 6500) {displayInfo ("GM 65120 Hydraulic");}
                else {displayInfo ("NONE");}
                break;
}
}


//The following code is used in the customer pages to roll through pictures
// Code was used with permission from JavaScript Kit (http://javascriptkit.com)
/*
function changeimage(towhat,url){
if (document.images){
document.images.targetimage.src=towhat.src
gotolink=url
};
};
function warp(){
window.location=gotolink
};

var myimages=new Array()
var gotolink="#"

function preloadimages(){
for (i=0;i<preloadimages.arguments.length;i++){
myimages[i]=new Image()
myimages[i].src=preloadimages.arguments[i]
};
};
preloadimages("plane1.gif","plane2.gif","plane3.gif","plane4.gif","plane5.gif")

*/