// Rollover Object version 1.0
// written by: Jon M. Toribio

function Rollover(tgt, on_img) {
   arg = Rollover.arguments;
   if (arg.length < 2) {
      alert("new Rollover: wrong number of parameters passed. Expecting at least 2.");
      return null;
   }

   // Properties
   this.active = true;

   imgObj = eval("document."+tgt);
   if (imgObj && imgObj.length) { 
      this.tgt = "document."+tgt+"[0]"; 
   }
   else { 
      this.tgt = "document."+tgt; 
   }
   
   // if a Layer ID has been specified change this.tgt
   if (arg[4]) {
      if (document.layers) {
         this.tgt = "document.layers['" + arg[4] + "'].document.images['"+tgt+"']";
      } 
      if (document.all) {
         this.tgt = "document."+tgt; 
      }
   }

   if (document.images) {
      this.on_image = new Image();
      this.on_image.src = on_img;
      if (arg[2]) {
         this.off_image = new Image();
         this.off_image.src = arg[2];
      }
      if (arg[3]) {
         this.down_image = new Image();
         this.down_image.src = arg[3];
      }
   }
   return this;
}

// ===========================================================================
// Methods
// ===========================================================================

function Rollover_on() {
   if (document.images && this.on_image && this.active) {
      theObj = eval(this.tgt);
      if (theObj) { theObj.src = this.on_image.src; }
   }
}

function Rollover_off() {
   if (document.images && this.off_image && this.active) {
      theObj = eval(this.tgt);
      if (theObj) { theObj.src = this.off_image.src; }
   }
}

function Rollover_down() {
   if (document.images && this.down_image && this.active) {
      theObj = eval(this.tgt);
      if (theObj) { theObj.src = this.down_image.src; }
   }
}

function Rollover_activate() { this.active = true; }
function Rollover_deactivate() { this.active = false; }

// Assigning the methods to the prototype
Rollover.prototype.on         = Rollover_on;
Rollover.prototype.off        = Rollover_off;
Rollover.prototype.down       = Rollover_down;
Rollover.prototype.activate   = Rollover_activate;
Rollover.prototype.deactivate = Rollover_deactivate;


// ===========================================================================
// RolloverMenu Object version 0.1
// written by: Jon M. Toribio
// ===========================================================================

function RolloverMenu() {
        this.menuItems = new Array();
        return this;
}

RolloverMenu.prototype.addMenuItem    = RolloverMenu_addMenuItem;
RolloverMenu.prototype.selectMenuItem = RolloverMenu_selectMenuItem;
RolloverMenu.prototype.selectMenuItemLed = RolloverMenu_selectMenuItemLed;
RolloverMenu.prototype.resetMenu      = RolloverMenu_resetMenu;

function RolloverMenu_addMenuItem(rollover_object) {
        this.menuItems[this.menuItems.length] = rollover_object;
}

function RolloverMenu_selectMenuItem(idx) {
        for (i = 0 ; i < this.menuItems.length ; i++) {
                if (i == idx) {
                        this.menuItems[i].on();
                        this.menuItems[i].deactivate();
                }
                else {
                        this.menuItems[i].activate();
                        this.menuItems[i].off();
                }
        }
}

function RolloverMenu_selectMenuItemLed(idx) {
        for (i = 0 ; i < this.menuItems.length ; i++) {
                if (i == idx) {
                        this.menuItems[i].down();
                        this.menuItems[i].deactivate();
                }
                else {
                        this.menuItems[i].activate();
                        this.menuItems[i].off();
                }
        }
}

function RolloverMenu_resetMenu() {
        for (i = 0 ; i < this.menuItems.length ; i++) {
                this.menuItems[i].activate();
                this.menuItems[i].off();
        }
}
// ===========================================================================
// End Rollover script
// ===========================================================================

county_img = new Rollover("countyImg","/images/our_wines/r_sonoma_county_on.gif","/images/our_wines/r_sonoma_county_off.gif", "", "");
twinvalley_img = new Rollover("twinvalleyimg","/images/new/RightWinesNav/r_twin_valley_on.gif","/images/new/RightWinesNav/r_twin_valley_off.gif", "", "");
bar_img = new Rollover("barImg","/images/our_wines/r_barrelli_creek_on.gif","/images/our_wines/r_barrelli_creek_off.gif", "", "");
barb_img = new Rollover("barbImg","/images/our_wines/r_barbera_on.gif","/images/our_wines/r_barbera_off.gif", "", "");
cab2_img = new Rollover("cab2Img","/images/our_wines/r_cabernet2_on.gif","/images/our_wines/r_cabernet2_off.gif", "", "");
cab_img = new Rollover("cabImg","/images/our_wines/r_cabernet_on.gif","/images/our_wines/r_cabernet_off.gif", "", "");
zin_img = new Rollover("zinImg","/uploadedImages/rt_zinfandel_nav_on.gif","/uploadedImages/rt_zinfandel_nav_off.gif", "", "");
bczin_img = new Rollover("bczinImg","/images/our_wines/r_zinfandel_on.gif","/images/our_wines/r_zinfandel_off.gif", "", "");
lag_img = new Rollover("lagImg","/images/our_wines/r_laguna_on.gif","/images/our_wines/r_laguna_off.gif", "", "");
stef_img = new Rollover("stefImg","/images/our_wines/r_stefani_on.gif","/images/our_wines/r_stefani_off.gif", "", "");
two_img = new Rollover("twoImg","/images/our_wines/r_two_rock_on.gif","/images/our_wines/r_two_rock_off.gif", "", "");
frei_img = new Rollover("freiImg","/images/our_wines/r_frei_ranch_on.gif","/images/our_wines/r_frei_ranch_off.gif", "", "");
estate_img = new Rollover("estateImg","/images/our_wines/r_estate_on.gif","/images/our_wines/r_estate_off.gif", "", "");
tastegs_img = new Rollover("tastegsImg","/images/our_wines/r_taste_of_sonoma_on.gif","/images/our_wines/r_taste_of_sonoma_off.gif", "", "");
vtw_img = new Rollover("vtwImg","/images/our_wines/r_vine_to_wine_on.gif","/images/our_wines/r_vine_to_wine_off.gif", "", "");
wl_img = new Rollover("wlImg","/images/our_wines/r_wine_list_on.gif","/images/our_wines/r_wine_list_off.gif", "", "");
char_img = new Rollover("charImg","/images/our_wines/r_chardonnay_on.gif","/images/our_wines/r_chardonnay_off.gif", "", "");
char2_img = new Rollover("char2Img","/images/our_wines/r_chardonnay2_on.gif","/images/our_wines/r_chardonnay2_off.gif", "", "");
merlot_img = new Rollover("merlotImg","/images/our_wines/r_merlot_on.gif","/images/our_wines/r_merlot_off.gif", "", "");
gris_img = new Rollover("grisImg","/images/our_wines/r_pinot_gris_on.gif","/images/our_wines/r_pinot_gris_off.gif", "", "");
noir_img = new Rollover("noirImg","/images/our_wines/r_pinot_noir_on.gif","/images/our_wines/r_pinot_noir_off.gif", "", "");
sang_img = new Rollover("sangImg","/images/our_wines/r_sangiovese_on.gif","/images/our_wines/r_sangiovese_off.gif", "", "");
syrah_img = new Rollover("syrahImg","uploadedImages/rt_syrah_on.gif","uploadedImages/rt_syrah_off.gif", "", "");
single_img = new Rollover("singleImg","/images/our_wines/r_single_vineyard_on.gif","/images/our_wines/r_single_vineyard_off.gif", "", "");
bc_img = new Rollover("bcImg","/images/our_wines/2-3_barelli_creek_b_on.gif","/images/our_wines/2-3_barelli_creek_b_off.gif", "", "");
fr_img = new Rollover("frImg","/images/our_wines/2-3_frei_ranch_b_on.gif","/images/our_wines/2-3_frei_ranch_b_off.gif", "", "");
l_img = new Rollover("lImg","/images/our_wines/2-3_laguna_b_on.gif","/images/our_wines/2-3_laguna_b_off.gif", "", "");
s_img = new Rollover("sImg","/images/our_wines/2-3_stefani_b_on.gif","/images/our_wines/2-3_stefani_b_off.gif", "", "");
tr_img = new Rollover("trImg","/images/our_wines/2-3_two_rock_b_on.gif","/images/our_wines/2-3_two_rock_b_off.gif", "", "");
welcome_img = new Rollover("welcomeImg","/images/our_wines/r_welcome_insider_on.gif","/images/our_wines/r_welcome_insider_off.gif", "", "");
where_img = new Rollover("whereImg","/images/our_wines/r_where_to_buy_b_on.gif","/images/our_wines/r_where_to_buy_b_off.gif", "", "");
fawm_img = new Rollover("fawmImg","/images/our_wines/food_wine_matchkr_orange_on.gif","/images/our_wines/food_wine_matchkr_orange_off.gif", "", "");
bvb_img = new Rollover("bvbImg","/images/our_wines/barelli_vine_barbera_b_on.gif","/images/our_wines/barelli_vine_barbera_b_off.gif", "", "");
sccs_img = new Rollover("sccsImg","/images/our_wines/sonoma_cabernet_b_on.gif","/images/our_wines/sonoma_cabernet_b_off.gif", "", "");
scc_img = new Rollover("sccImg","/images/our_wines/sonoma_chardonnay_b_on.gif","/images/our_wines/sonoma_chardonnay_b_off.gif", "", "");
scs_img = new Rollover("scsImg","/images/our_wines/stefani_cabernet_b_on.gif","/images/our_wines/stefani_cabernet_b_off.gif", "", "");
frcs_img = new Rollover("frcsImg","/images/our_wines/frei_ranch_b_on.gif","/images/our_wines/frei_ranch_b_off.gif", "", "");
ecs_img = new Rollover("ecsImg","/images/our_wines/estate_cabernet_b_on.gif","/images/our_wines/estate_cabernet_b_off.gif", "", "");
lc_img = new Rollover("lcImg","/images/our_wines/laguna_chardonnay_b_on.gif","/images/our_wines/laguna_chardonnay_b_off.gif", "", "");
sc_img = new Rollover("scImg","/images/our_wines/stefani_chardonnay_b_on.gif","/images/our_wines/stefani_chardonnay_b_off.gif", "", "");
bcc_img = new Rollover("bccImg","/images/our_wines/barrelli_cabernet_b_on.gif","/images/our_wines/barrelli_cabernet_b_off.gif", "", "");
trc_img = new Rollover("trcImg","/images/our_wines/two_rock_chardonnay_b_on.gif","/images/our_wines/two_rock_chardonnay_b_off.gif", "", "");
ec_img = new Rollover("ecImg","/images/our_wines/estate_chardonnay_b_on.gif","/images/our_wines/estate_chardonnay_b_off.gif", "", "");
scm_img = new Rollover("scmImg","/images/our_wines/sonoma_merlot_b_on.gif","/images/our_wines/sonoma_merlot_b_off.gif", "", "");
scpg_img = new Rollover("scpgImg","/images/our_wines/sonoma_pinot_gris_b_on.gif","/images/our_wines/sonoma_pinot_gris_b_off.gif", "", "");
scpn_img = new Rollover("scpnImg","/images/our_wines/sonoma_pinot_noir_b_on.gif","/images/our_wines/sonoma_pinot_noir_b_off.gif", "", "");
scsang_img = new Rollover("scsangImg","/images/our_wines/sonoma_sangiovese_b_on.gif","/images/our_wines/sonoma_sangiovese_b_off.gif", "", "");
bcz_img = new Rollover("bczImg","/images/our_wines/barelli_zinfandel_b_on.gif","/images/our_wines/barelli_zinfandel_b_off.gif", "", "");
frz_img = new Rollover("frzImg","/images/our_wines/frei_ranch_zinfandel_b_on.gif","/images/our_wines/frei_ranch_zinfandel_b_off.gif", "", "");
fvtw_img = new Rollover("fvtwImg","/images/our_wines/lft_wine_to_vine_b_on.gif","/images/our_wines/lft_wine_to_vine_b_off.gif", "", "");

recipe_img = new Rollover("recipeImg","/images/recipes/lft_recipe_index_b_on.gif","/images/recipes/lft_recipe_index_b_off.gif", "", "");
tasterecipe_img = new Rollover("tasterecipeImg","/images/taste_gallo/lft_recipe_index_b_on.gif","/images/taste_gallo/lft_recipe_index_b_off.gif", "", "");
rectgos_img = new Rollover("rectgosImg","/images/recipes/lft_taste_sonoma_b_on.gif","/images/recipes/lft_taste_sonoma_b_off.gif", "", "");
recfvtw_img = new Rollover("recfvtwImg","/images/recipes/lft_wine_to_vine_b_on.gif","/images/recipes/lft_wine_to_vine_b_off.gif", "", "");
recwl_img = new Rollover("recwlImg","/images/recipes/lft_wine_list_b_on.gif","/images/recipes/lft_wine_list_b_off.gif", "", "");
recinsd_img = new Rollover("recinsdImg","/images/recipes/lft_insider_b_on.gif","/images/recipes/lft_insider_b_off.gif", "", "");

single21_img = new Rollover("single21Img","/images/new/OurWinesPage/Roll_singleVin_on.gif","/images/new/OurWinesPage/Roll_singleVin_off.gif", "", "");
estate21_img = new Rollover("estate21Img","/images/new/OurWinesPage/Roll_estate_on.gif","/images/new/OurWinesPage/Roll_estate_off.gif", "", "");
county21_img = new Rollover("county21Img","/images/new/OurWinesPage/Roll_sonomaReserve_on.gif","/images/new/OurWinesPage/Roll_sonomaReserve_off.gif", "", "");
twinvalley21_img = new Rollover("twinvalley21Img","/images/new/OurWinesPage/Roll_twinvalley_on.gif","/images/new/OurWinesPage/Roll_twinvalley_off.gif", "", "");

twinvalleytext_img = new Rollover("textImg","/images/new/OurWinesPage/Roll_twinValley_text.gif","/images/new/OurWinesPage/Roll_instructions_text.gif", "", "");
singletext_img = new Rollover("textImg","/images/new/OurWinesPage/Roll_singlevin_text.gif","/images/new/OurWinesPage/Roll_instructions_text.gif", "", "");
estatetext_img = new Rollover("textImg","/images/new/OurWinesPage/Roll_estate_text.gif","/images/new/OurWinesPage/Roll_instructions_text.gif", "", "");
countytext_img = new Rollover("textImg","/images/new/OurWinesPage/Roll_reserve_text.gif","/images/new/OurWinesPage/Roll_instructions_text.gif", "", "");

awrd_img = new Rollover("awrdImg","/images/vine_to_wine/r_awards_b_on.gif","/images/vine_to_wine/r_awards_b_off.gif", "", ""); 
btn1_obj = new Rollover("btn1_img","/images/taste_gallo/lft_questions_b_on.gif","/images/taste_gallo/lft_questions_b_off.gif","","");
btn2_obj = new Rollover("btn2_img","/images/taste_gallo/lft_about_wines_b_on.gif","/images/taste_gallo/lft_about_wines_b_off.gif","","");
btn3_obj = new Rollover("btn3_img","/images/taste_gallo/lft_insider_b_on.gif","/images/taste_gallo/lft_insider_b_off.gif","","");

cwq_obj = new Rollover("cwq_img","/images/vine_to_wine/lft_common_questions_b_on.gif","/images/vine_to_wine/lft_common_questions_b_off.gif","","");
