/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*onload function call for the mega menu for product navigation*/
jQuery.noConflict();
jQuery(document).ready(function() {

    /*mega drop down visibility in link mouse over*/
    jQuery("li.mega").bind("mouseover",this, function (){

        jQuery(this).addClass("hovering");
       
        id= jQuery(this).attr("id");
      
        try{
           
            refEdge = Math.round(jQuery("#facebook").offset().left);
            
            actualEdge = Math.round(jQuery("#edgeAnchorPoint_"+id).offset().left);
      
            if(refEdge<actualEdge){
                jQuery("#"+id+" div.menu_item_div").css('left', jQuery("#top_nav_0").offset().left);
            }
           
            if( jQuery("#"+id+" div.menu_item_div .quick_shop_links").css('height')=='120px'){
                jQuery("#"+id+" div.menu_item_div .quick_shop_links").css('height', jQuery("#"+id+" div.menu_item_div").height());
            }
              
        }catch(e){
            
        }
      
    });

    jQuery("li.mega").bind("mouseout",this, function (){
        jQuery(this).removeClass("hovering");
    });


    /*drop down cart hover pop down div start*/
    jQuery("#cart_count").bind("mouseover",this, function (){
        jQuery(".shopping_cart_hover_div").addClass("shopping_cart_hover_div_show");
        var x = jQuery('#cart_count').offset().left;
        //var y = $("#wrapper2").offset().top;
        jQuery(".shopping_cart_hover_div").css('left', x-72);
    });

    jQuery("#cart_count").bind("mouseout",this, function (){
        jQuery(".shopping_cart_hover_div").removeClass("shopping_cart_hover_div_show");
    });

    jQuery(".shopping_cart_hover_div ").bind("mouseover",this, function (){
        jQuery(this).addClass("shopping_cart_hover_div_show");
    });

    jQuery(".shopping_cart_hover_div ").bind("mouseout",this, function (){
        jQuery(this).removeClass("shopping_cart_hover_div_show");
    });
    /*drop down cart hover pop down div end*/


    /*drop down cart on mouseover item color change*/
    jQuery(".item_dropdown_cart").bind("mouseover",this, function (){
        jQuery(this).addClass("item_drop_down_hover");
    });

    jQuery(".item_dropdown_cart").bind("mouseout",this, function (){
        jQuery(this).removeClass("item_drop_down_hover");
    });

    jQuery(".focus_clear").bind("focus",this, function (){
        if(jQuery(this).val()=='Search' || jQuery(this).val()=='Email Address' )
            jQuery(this).val('');
    });

});


function selectRadio(){
    var valToCheck = jQuery("#ship_options_dd").val();
    if(valToCheck==""){
        jQuery(".radio").attr('checked','');
    }
    jQuery("#s_method_"+valToCheck).attr('checked','checked');
}
