$(document).ready(function(){ 
     /* Custom Tab*/
     $("div.productFeatures ul#tabs li:first").addClass("selected"); 
     $("div.productFeatures div.tabsContent:first").show(); 
     $("ul#tabs li").click(function()
     {
        $(this).addClass("selected");  
        $(this).siblings().removeClass("selected");  
        var valueClick = $(this).index();  
        $("div.tabsContent").eq(valueClick).show();
        $("div.tabsContent").eq(valueClick).siblings('div.tabsContent').hide();
        return false;    
     });    
     /* Banner Links Hover*/
     $("div.bannerproductLink a").hover(function()
         {
            $("div.bannerproductRoll").show();
         }); 
     $("div.sbFeatureLink a").hover(function()
         {
            $("div.sbfeaturesRoll").show();
         }); 
     $("div.bannerproductRoll").hover(function()
     {
        $(this).show();
     },function()
     {
        $(this).hide();
     }); 
     $("div.sbfeaturesRoll").hover(function()
     {
     $(this).show();
     },function()
     {
        $(this).hide();
     });  
       /*set/Clear form Textbox default values*/
      
       $("div.formRow textarea.formTxt").each(function()
      {
        $(this).focus(function() {
            if(this.value==this.defaultValue)
            {
                this.value='';
            }
        });
        $(this).blur(function() {
            if(this.value=='')
            {
                this.value=this.defaultValue;
            }
        });
      });

      
      $("div.formRow input.formTextBox").each(function()
      {
        $(this).focus(function() {
            if(this.value==this.defaultValue)
            {
                this.value='';
            }
        });
        $(this).blur(function() {
            if(this.value=='')
            {
                this.value=this.defaultValue;
            }
        });
      });
      $("div.formRow input.formTxt").each(function()
      {
        $(this).focus(function() {
            if(this.value==this.defaultValue)
            {
                this.value='';
            }
        });
        $(this).blur(function() {
            if(this.value=='')
            {
                this.value=this.defaultValue;
            }
        });
      });
      /* Ellipsis for content Sripping*/     
     $("div.quotes").show();  
     $("div.quotes").ThreeDots({ max_rows: 13 });  
     $("div.newprodDesc").show();
     $("div.newprodDesc").ThreeDots({ max_rows: 2 });  
     $("div.thmbnailDesc").show();
     $("div.thmbnailDesc").ThreeDots({ max_rows: 3 }); 
     $("div.listTxt").show();
     $("div.listTxt").ThreeDots({ max_rows: 4 });  
     
      /* Event Calendar Links Tooltip*/
     $("a.eventLink").hover(function()
     { 
        $(this).next("div.eventDesc").show();
     },function()
     {
         $(this).next("div.eventDesc").hide();
     });
     
    /* Home Page Columns equalise */
    $("div.sections div.thumbnailBlk, div.mapWrap").equalizeCols(); 
    
      /* Product List Mouseover*/
     $("a.listLink").hover(function()
     { 
        $(this).next("div.shortDesc").show();
     },function()
     {
         $(this).next("div.shortDesc").hide();
     });     
      
      /* Fake Button for File upload in Profile*/
   $('input.browseBtn').change(getStats); 			     
    function getStats()
    {	
        realPath = this.value;
        fakePath = realPath.match(/[^\/\\]+$/);		
        $('input.fakeTxt').val(fakePath);
        $('input#faketxtBox').removeAttr('disabled'); 
   }
   /* forgot Password */
   $("a.forgotPwd").click(function()
   {
        $("div.forgotWrap").toggle();
        return false;
   });
    $("div.formPanel").each(function()
    {
        if($(this).attr("formButtonId"))
        {
            $(this).bind("keypress", function(e){
                if (e.keyCode == 13)
                {
                    e.returnValue = false;
                    e.cancel = true;
                    var button = $("#" + $(this).attr("formButtonId"));
                    
                    var retValue = button.triggerHandler("click");
                    if(retValue == undefined || retValue == true)
                        eval(button.attr("href"));
                    
                    return false;
                }
            });
        }
    });
});
function controlEnterButton (btnId, evt) 
{   
    btn = document.getElementById(btnId);
    if (btn)
    {
        if (evt.keyCode == 13)
        {
            evt.returnValue = false;
            evt.cancel = true;
            btn.click();
        } 
    } 
}
