$(function(){
$(".toolbottom").tipTip({maxWidth: "200px", edgeOffset: 10, defaultPosition:"bottom"});
$(".tooltop").tipTip({maxWidth: "200px", edgeOffset: 3, defaultPosition:"top"});
$(".toolleft").tipTip({maxWidth: "200px", edgeOffset: 3, defaultPosition:"left"});
$(".toolright").tipTip({maxWidth: "200px", edgeOffset: 3, defaultPosition:"ritht"});

$(".tooltopbar").tipTip({maxWidth: "200px", edgeOffset: 10, defaultPosition:"bottom"});


//clbutton button hover
$(".clbutton").hover(function(){
    var clb         = $(this);
    var clbw        = clb.width();
    clbw = clbw+15;
    var clbb= clbw+7;
    clbb=clbb+"px 0px";
    clbw = clbw+"px 0px";
    //alert(clbw);
    clb.css({background:"url('http://localhost/fol/clnewsite/css/img/b_1.jpg') #ff4500 no-repeat"});
    clb.css('background-position', clbw);

    clb.animate({width:"+=25px",backgroundPosition:clbb});
    
    
},function(){
    var clb         = $(this);
    var clbw        = clb.width();
    var clbb= clbw-15;
    clbb=clbb+"px 0px";

    clb.animate({width:"-=25px",backgroundPosition:clbb},function(){
        clb.css({background:"#ff4500"})
    });
});



$(".clbutton2").hover(function(){
    var clb         = $(this);
    var clbw        = clb.width();
    clbw = clbw+15;
    var clbb= clbw+7;
    clbb=clbb+"px 0px";
    clbw = clbw+"px 0px";
    //alert(clbw);
    clb.css({background:"url('http://localhost/fol/clnewsite/css/img/b_2.jpg') #a5d02f no-repeat"});
    clb.css('background-position', clbw);

    clb.animate({width:"+=25px",backgroundPosition:clbb});


},function(){
    var clb         = $(this);
    var clbw        = clb.width();
    var clbb= clbw-15;
    clbb=clbb+"px 0px";

    clb.animate({width:"-=25px",backgroundPosition:clbb},function(){
        clb.css({background:"#a5d02f"})
    });
});
//=================================
//brands hover========================
$("#repair").hover(function(){
    $("#repair").animate({backgroundPosition:"-231px 0px"},300);
},function(){    
    if($("#repair_cont").height()<=10){
        $("#repair").animate({backgroundPosition:"0px 0px"},300);
    }
});

$("#repair").click(function(){
    $("#repair_cont").animate({height:"35px"},200);
});
$("#tox").click(function(){
    $("#repair_cont").animate({height:"0px"},200,function(){
        $("#repair").animate({backgroundPosition:"0px 0px"},300);
    });
});
//=====================================
//news letter============================
$("#subsnews").click(function(){
    if (validate($("#subsemail").val())==false){
        $("#newsmsg").text("Enter valid mail id");
    }
    else{
        $.get("mail-func.php", { topic:"newsletter" ,email:$("#subsemail").val() },
           function(data){
             $("#newsmsg").html(data);
             $("#subsemail").val("");
           });
    }
});
$("#sendbrand").click(function(){
    if ($("#lapbrand").val()==""){
    }
    else{
        var brnd = $("#lapbrand").val();
        window.location.href = "laptop-repair-by-service/?brand="+ brnd; 
        closebrand();
    }
});


$("#header_logo").click(function(){
    window.location.href ="http://www.clublaptop.com/";
});

function validate(email) {

   var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
   var address = email;
   if(reg.test(address) == false) {
      return false;
   }
   else{
       return true;
   }
}
//==========================================

        $('#discl').click(function() {
            $.blockUI({ message: $('#question'), css: { width: '550px', border:"1px gray solid"} });
        });
        $('.disclclose').click(function() {
            $.unblockUI(); 
        });
        $('#track').click(function() {
            $.get("func.php", { fc:$("#fcx").val(), jno:$("#lrsx").val(), srch:"t" },
           function(data){
             $("#trackout").html(data);
             $.blockUI({ message: $('#trackdisp'), css: { width: '550px', border:"1px gray solid"} });
           });
        });

   $('.probox').mouseenter(function() {
       $(this).css("border","1px white solid;");
   });
   $('.probox').mouseleave(function() {
       $(this).css("border","1px #e0dfdf solid");
   });
});

