// JavaScript Document

var browserName=navigator.appName; 

 if (browserName=="Microsoft Internet Explorer")
 {
  //alert("IE browser");
   Cufon.replace('h1', { fontFamily: 'Grotesque MT Std-ExtraCond', fontSize: '22px',textShadow:'none' });
   Cufon.replace('.banner h1', { fontFamily: 'Grotesque MT Std-ExtraCond', fontSize: '56px', textShadow:'none' });
   
   Cufon.replace('.topmenu li a', { fontFamily: 'Grotesque MT Std-ExtraCond', fontSize: '22px',textShadow:'none' })
   Cufon.replace('.banner .tagline', { fontFamily: 'Grotesque MT Std-ExtraCond', fontSize: '33px',textShadow:'none' });
   
 }
 else
  {
    //alert("NONE - IE browser");
    Cufon.replace('h1', { fontFamily: 'Grotesque MT Std-ExtraCond', fontSize: '22px',textShadow:'0.1em 0.1em #000002' });
    Cufon.replace('.banner h1', { fontFamily: 'Grotesque MT Std-ExtraCond', fontSize: '56px', textShadow:'-1px -1px #000' });
    
    Cufon.replace('.topmenu li a', { fontFamily: 'Grotesque MT Std-ExtraCond', fontSize: '22px',textShadow:'0.1em 0.1em #000002' })
    Cufon.replace('.banner .tagline', { fontFamily: 'Grotesque MT Std-ExtraCond', fontSize: '33px',textShadow:'-1px -1px #000' });
   }
 
$(document).ready(function($)
{
    //select box  
  /*  $('#pricerangemin').selectbox();
		$('#pricerangemax').selectbox();
		$('#variety').selectbox();
		$('#country').selectbox();
		$('#vintage').selectbox();
		$('#region').selectbox();
    $('#state').selectbox();
    $('#cardtype').selectbox();*/
   
   

    
     //advance options
     if (browserName=="Microsoft Internet Explorer")
       {
       
        $(".advance-options #pricerangemin_input").mouseover(function () {
          $(this).addClass('hover');
        });
     
         $(".advance-options #pricerangemin_input").mouseleave(function () {
            $(this).removeClass('hover');
         });
         //-----------
         $(".advance-options #pricerangemax_input").mouseover(function () {
          $(this).addClass('hover');
        });
     
         $(".advance-options #pricerangemax_input").mouseleave(function () {
            $(this).removeClass('hover');
         });
        //-----------    
          $(".advance-options #variety_input").mouseover(function () {
          $(this).addClass('hover');
        });
     
         $(".advance-options #variety_input").mouseleave(function () {
            $(this).removeClass('hover');
         });
         //-----------
          $(".advance-options #country_input").mouseover(function () {
          $(this).addClass('hover');
        });
     
         $(".advance-options #country_input").mouseleave(function () {
            $(this).removeClass('hover');
         });
         //-----------
          $(".advance-options #vintage_input").mouseover(function () {
            $(this).addClass('hover');
         });
         
        $(".advance-options .input-box1 #vintage_input").mouseleave(function () {
            $(this).removeClass('hover');
        });
       //-----------
         $(".advance-options .input-box2 #region_input").mouseover(function () {
            $(this).addClass('hover');
         });
         
          $(".advance-options .input-box2 #region_input").mouseleave(function () {
            $(this).removeClass('hover');
         });
         
     
             
       }
       
     Cufon.replace('.tabs li a', { fontFamily: 'Grotesque MT Std-ExtraCond', fontSize: '22px'});
     
     $(".tabs li a").mouseover(function () {
           Cufon.replace(this, { fontFamily: 'Grotesque MT Std-ExtraCond', fontSize: '22px'});
     });
      
     $(".tabs li a").mouseout(function () {
             Cufon.replace(this, { fontFamily: 'Grotesque MT Std-ExtraCond', fontSize: '22px' });
     });
      
       
     //standard
     Cufon.replace('h2', { fontFamily: 'Grotesque MT Std-ExtraCond', fontSize: '18px' });
     Cufon.replace('h3', { fontFamily: 'Grotesque MT Std-Condensed', fontSize: '15px' });    
         
  
     //store location
     Cufon.replace('.store-location .label', { fontFamily: 'Grotesque MT Std-ExtraCond', fontSize: '18px' }); 
     
     Cufon.replace('.store-location li', { fontFamily: 'Grotesque MT Std-ExtraCond', fontSize: '18px' });
     
     $(".store-location li").mouseover(function () {
           Cufon.replace(this, { fontFamily: 'Grotesque MT Std-ExtraCond', fontSize: '18px', color:'#939393' });
     });
      
     $(".store-location li").mouseout(function () {
             Cufon.replace(this, { fontFamily: 'Grotesque MT Std-ExtraCond', fontSize: '18px', color:'#393939' });
     });
    
     //featured
     Cufon.replace('.featured h1', { fontFamily: 'Grotesque MT Std-ExtraCond', fontSize: '24px' });
     
     
    //login
     Cufon.replace('.login li', { fontFamily: 'Grotesque MT Std-Condensed', fontSize: '15px' });
     
    $(".login li").mouseover(function () {
           Cufon.replace(this, { fontFamily: 'Grotesque MT Std-Condensed', fontSize: '15px', color:'#393939' });
    });
    
     $(".login li").mouseout(function () {
           Cufon.replace(this, { fontFamily: 'Grotesque MT Std-Condensed', fontSize: '15px', color:'#939393' });
    });
      
  
     //wine types
     Cufon.replace('.wine-types-li', { fontFamily: 'Grotesque MT Std-Condensed', fontSize: '15px' });
     
          
     //topmenu
     Cufon.replace('.topmenu .label', { fontFamily: 'Grotesque MT Std-LightCond', fontSize: '13px' });
     
     //cart
     Cufon.replace('.subheader .cart .viewcart a.vtab', { fontFamily: 'Grotesque MT Std-Condensed', fontSize: '15px' });
     Cufon.replace('.subheader .cart .items', { fontFamily: 'Grotesque MT Std-Condensed', fontSize: '15px' });
     Cufon.replace('.subheader .cart .subtotal', { fontFamily: 'Grotesque MT Std-Condensed', fontSize: '15px' });
     
     $(".viewcart a.vtab").mouseover(function () {
            $(".viewcart .dropdown").fadeIn();
            $(".viewcart .dp-rbg").show();
            $(".viewcart .dp-lbg").show();
           
            if (browserName=="Microsoft Internet Explorer")
             {
             $(".moreoptions").hide();                         
             }
     });
    
     $(".viewcart .dropdown").mouseleave(function () {
           $(".viewcart .dropdown").fadeOut();
           $(".viewcart .dp-rbg").hide();
           $(".viewcart .dp-lbg").hide();
           
           if (browserName=="Microsoft Internet Explorer")
             {
             $(".moreoptions").show();
             }
     });
     
     $(".viewcart .hidecart").click(function () {
           $(".viewcart .dropdown").fadeOut();
           $(".viewcart .dp-rbg").hide();
           $(".viewcart .dp-lbg").hide();
           if (browserName=="Microsoft Internet Explorer")
             {
             $(".moreoptions").show();
           }
     });
     
    
         $(".childnavmore").click(function () {
           $(".advance_search").slideDown();
          if (browserName=="Microsoft Internet Explorer")
             {
               $(".banner .position").hide()
               $(".moreoptions").hide()
               $(".lblcalendar").hide(); 
               $(".availablity_box").hide();
               $(".details h1").hide();
               $(".returning_customer h1").hide();
               $(".new_customer h1").hide();
               $(".left-content .calendar h1").hide();
             }
     });
     
     //product search
     Cufon.replace('.moreoptions', { fontFamily: 'Grotesque MT Std-ExtraCond', fontSize: '18px' });
     Cufon.replace('.lessoptions', { fontFamily: 'Grotesque MT Std-ExtraCond', fontSize: '18px' });
     
     
     $(".moreoptions").click(function () {
           $(".advance_search").slideDown();
          if (browserName=="Microsoft Internet Explorer")
             {
               $(".banner .position").hide()
               $(".moreoptions").hide()
               $(".lblcalendar").hide(); 
               $(".availablity_box").hide();
               $(".details h1").hide();
               $(".returning_customer h1").hide();
               $(".new_customer h1").hide();
               $(".left-content .calendar h1").hide();
             }
     });
    
     $(".lessoptions").click(function () {
           $(".advance_search").slideUp();
          if (browserName=="Microsoft Internet Explorer")
             {
           $(".banner .position").show()
           $(".moreoptions").show()
           $(".lblcalendar").show(); 
           $(".availablity_box").show();
            $(".details h1").show();
            $(".returning_customer h1").show();
             $(".new_customer h1").show();
              $(".left-content .calendar h1").show();
             }
     });
     
     //product list 
     Cufon.replace('.viewmore', { fontFamily: 'Grotesque MT Std-ExtraCond', fontSize: '22px' });
      Cufon.replace('.productlbl', { fontFamily: 'Grotesque MT Std-ExtraCond', fontSize: '22px' });
     
     //event calendar
     Cufon.replace('ul.month-pager li', { fontFamily: 'Grotesque MT Std-ExtraCond', fontSize: '22px' });
      Cufon.replace('.lblcalendar',  { fontFamily: 'Grotesque MT Std-ExtraCond', fontSize: '22px' });
         
     
     //footer
     Cufon.replace('.bygroup div h1', { fontFamily: 'Grotesque MT Std-ExtraCond', fontSize: '18px' });
     
     
     //HOME TABS - to become dynamic, i temporarily put variable
    /*var tabname1 = "topstaff";
    $("#tab-" + tabname1).click(function () {
        alert(tabname1);
        $(".tabs li a").removeClass("active");
        $(this).addClass("active");
        $(".prodlist div").removeClass('active');
        $(".prodlist ." + tabname1).addClass('active');
      });
    
    var tabname2 = "topbeers";   
    $("#tab-" + tabname2).click(function () {
        alert(tabname2);
        $(".tabs li a").removeClass("active");
        $(this).addClass("active");
        $(".prodlist div").removeClass('active');
        $(".prodlist ." + tabname2).addClass('active');
      });
    
    var tabname3 = "topbordeaux";   
    $("#tab-" + tabname3).click(function () {
        alert(tabname3);
        $(".tabs li a").removeClass("active");
        $(this).addClass("active");
        $(".prodlist div").removeClass('active');
        $(".prodlist ." + tabname3).addClass('active');
      });*/
    
    $("#tab-topstaff").click(function () {
        Cufon.replace('#tab-topbeers', { fontFamily: 'Grotesque MT Std-ExtraCond', fontSize: '22px', color:'#514843' });
        Cufon.replace('#tab-topbordeaux', { fontFamily: 'Grotesque MT Std-ExtraCond', fontSize: '22px', color:'#514843' }); 
        $(".tabs li a").removeClass("active");
        $(this).addClass("active");
        $(".prodlist .topbeers").hide();
        $(".prodlist .topbordeaux").hide();
        $(".prodlist .topstaff").show();
      });
      
    $("#tab-topbeers").click(function () {
       Cufon.replace('#tab-topstaff', { fontFamily: 'Grotesque MT Std-ExtraCond', fontSize: '22px', color:'#514843' });
        Cufon.replace('#tab-topbordeaux', { fontFamily: 'Grotesque MT Std-ExtraCond', fontSize: '22px', color:'#514843' }); 
        $(".tabs li a").removeClass("active");
        $(this).addClass("active");
        $(".prodlist .topstaff").hide();
        $(".prodlist .topbordeaux").hide();
        $(".prodlist .topbeers").show();
      });
    
    $("#tab-topbordeaux").click(function () {
       Cufon.replace('#tab-topstaff', { fontFamily: 'Grotesque MT Std-ExtraCond', fontSize: '22px', color:'#514843' });
        Cufon.replace('#tab-topbeers', { fontFamily: 'Grotesque MT Std-ExtraCond', fontSize: '22px', color:'#514843' }); 
        $(".tabs li a").removeClass("active");
        $(this).addClass("active");
        $(".prodlist .topstaff").hide();
        $(".prodlist .topbeers").hide();
        $(".prodlist .topbordeaux").show();
      });
      
     //LOCATION
    $("#tab-staffpicks").click(function () {
        $(".tabs li a").removeClass("active");
        $(this).addClass("active");
        $(".prodlist .bestsellers").hide();
        $(".prodlist .bordeaux").hide();
        $(".prodlist .staffpicks").show();
      });
      
    $("#tab-bestsellers").click(function () {
        $(".tabs li a").removeClass("active");
        $(this).addClass("active");
        $(".prodlist .staffpicks").hide();
        $(".prodlist .bordeaux").hide();
        $(".prodlist .bestsellers").show();
      });
    
    $("#tab-bordeaux").click(function () {
        $(".tabs li a").removeClass("active");
        $(this).addClass("active");
        $(".prodlist .staffpicks").hide();
        $(".prodlist .bestsellers").hide();
        $(".prodlist .bordeaux").show();
      });
      
    
    //related-product-tabs
    $("#tab-related").click(function () {
        $(".tabs li a").removeClass("active");
        $("#tab-related").addClass("active");
        $(".related-items").show();
        $(".topshiraz").hide();
        $(".topcanberra").hide();
        $(this).attr("href", "09_PWS_ProductPage-FINAL.html#tab");
      });
    
    $("#tab-shiraz").click(function () {
        $(".tabs li a").removeClass("active");
        $("#tab-shiraz").addClass("active");
        $(".related-items").hide();
        $(".topshiraz").show();
        $(".topcanberra").hide();
        $(this).attr("href", "09_PWS_ProductPage-FINAL.html#tab");
      });
      
      
    $("#tab-canberra").click(function () {
        $(".tabs li a").removeClass("active");
        $("#tab-canberra").addClass("active");
        $(".related-items").hide();
        $(".topshiraz").hide();
        $(".topcanberra").show();
        $(this).attr("href", "09_PWS_ProductPage-FINAL.html#tab");
      });
    
     
 

});
