﻿$(document).ready(function() {
    //jQuery.PictureSlides.init();
    $("#header-facebook img[title]").tooltip({

        // tweak the position
        offset: [5, 2],

        // use the "slide" effect
        effect: 'slide'

        // add dynamic plugin with optional configuration for bottom edge
    }).dynamic({ bottom: { direction: 'down', bounce: true} });
    /*********************
    ** AppWaste Tab **
    *********************/
    $('#wasteTap').tabs({ fx: { opacity: 'toggle'} });
    /*********************
    ** Other Equipment Tab **
    *********************/
    $('#OtherEquipment').tabs({ fx: { opacity: 'toggle'} });
    /*********************
    ** ToolTip **
    *********************/
    // Use the each() method to gain access to each elements attributes
    //    $('map.area').each(function() {
    //    $(this).SetBubblePopup({
    //        innerHtml: '<p>Bubble Popup!</p>'
    //    });
    //});
    //    $("#ImageMapctl00_MainContent_ImageMap1 *").tooltip({ positionLeft: true });
    //    $("#ImageMapctl00_MainContent_ImageMap1 *").SetBubblePopup({
    //    innerHtml: '<p>Bubble Popup!</p>',
    //    bubbleAlign: 'center',
    //    tailAlign: 'center',
    //    color: 'green',
    //    contentStyle: 'font-size:16px;'
    //});
    $('area').mouseover(function() {
        var contents = $(this).attr('alt');
        if (contents == 'TY') {
            $("#PopupD").html("2275 E. Francis Street Ontario, CA 91761<br/> Office: 909-230-5141<br/> Fax: 909-230-5149<br/> Toll Free: 888-870-9797");
            $('#PopupD').dialog({ hide: 'slide',
                position: 'middle', show: 'slide', title: 'TY Cushion Tire'
            });
        }
        if (contents == 'AT') {
            $("#PopupD").html("2275 E. Francis Street Ontario, CA 91761<br/> Office: 909-230-5141<br/> Fax: 909-230-5149<br/> Toll Free: 888-870-9797");
            $('#PopupD').dialog({ hide: 'slide',
                position: 'middle', show: 'slide', title: 'TY Cushion Tire'
            });
        }
        if (contents == 'SB') {
            $("#PopupD").html("PO Box 212465<br/> Royal Palm Beach,<br/> FL 33421<br/> Cell: 561-644-0949");
            $('#PopupD').dialog({ hide: 'slide',
                position: 'middle', show: 'slide', title: 'Stan Brown'
            });
        }
        if (contents == 'STTC') {
            //$("#PopupD").html("2255 Avenue A<br/> Bethlehem,<br/> PA 18017<br/> Cell: 610-954-8473<br/> Fax: 610-954-5985<br/> Email: info@sttc.com");
            $("#PopupD").html("2275 E. Francis Street Ontario, CA 91761<br/> Office: 909-230-5141<br/> Fax: 909-230-5149<br/> Toll Free: 888-870-9797");
            $('#PopupD').dialog({ hide: 'slide',
            position: 'middle', show: 'slide', title: 'TY Cushion Tire'
            });
        }
        if (contents == 'KAL') {
            $("#PopupDC").html("969 Cliveden Ave<br/> New Westminster,<br/> BC V3M 5R6<br/> Contact Person: Jerry<br> Cell: 604-524-5264");
            $('#PopupD').dialog({ hide: 'slide',
                position: 'middle', show: 'slide', title: 'KAL Tire'
            });
        }
        if (contents == 'ZA') {
            $("#PopupDC").html("<b>ZHEALT and Associates</b>120 RILEY St.<br/> Waterdown, ON L0R 2H6<br/> Contact Person: Al Tanguay<br> Cell: 905-730-6159 <br> Fax: 905-690-1027");
            $('#PopupD').dialog({ hide: 'slide',
                position: 'middle', show: 'slide', title: 'ZHEALT and Assiciates'
            });
        }
        if (contents == 'DT') {
            $("#PopupDC").html(" 12515 Pennsylvania AVenue<br/>  Savage, MN 55378<br/>  Tel: 952-895-5380<br/>   Fax: 952-895-8821<br/>www.dependabletires.com");
            $('#PopupD').dialog({ hide: 'slide',
                position: 'middle', show: 'slide', title: 'DEPENDABLE TIRE INC.'
            });
        }
    });

    $('.TY').click(function() {
    $("#PopupD").html("<table style='width: 100%;'><tr><td class='style1'><img alt='' src='Dealer/tylogo.bmp' /></td><td><b>TY Cushion Tire</b><br>2275 E. Francis Street Ontario, CA 91761<br/> Office: 909-230-5141<br/> Fax: 909-230-5149<br/> Toll Free: 888-870-9797</td></tr></table>");
        $('#PopupD').show('puff');
        //return false;
    });
    $('.AV').click(function() {
    $("#PopupD").html("<table style='width: 100%;'><tr><td class='style1'><img alt='' src='Dealer/tylogo.bmp' /></td><td><b>TY Cushion Tire</b><br>2275 E. Francis Street Ontario, CA 91761<br/> Office: 909-230-5141<br/> Fax: 909-230-5149<br/> Toll Free: 888-870-9797</td></tr></table>");
        $('#PopupD').show('scale');
    });
    $('.SB').click(function() {
        $("#PopupD").html("<b>Stan Brown</b><br>PO Box 212465<br> Royal Palm Beach,<br> FL 33421<br/> Cell: 561-644-0949");
        $('#PopupD').show('fold');
    });
    $('.STTC').click(function() {
        //$("#PopupD").html("<table style='width: 100%;'><tr><td class='style1'><img alt='' src='Dealer/STTC_LOGO.png' /></td><td><b>Service Tire Truck Centers</b><br />2255 Avenue A Bethlehem. <br />PA 18017<br />Cell: 610-954-8473<br/>Fax: 610-954-5985<br/>Email: info@sttc.com</td></tr></table>");
    $("#PopupD").html("<table style='width: 100%;'><tr><td class='style1'><img alt='' src='Dealer/tylogo.bmp' /></td><td><b>TY Cushion Tire</b><br>2275 E. Francis Street Ontario, CA 91761<br/> Office: 909-230-5141<br/> Fax: 909-230-5149<br/> Toll Free: 888-870-9797</td></tr></table>");
        $('#PopupD').show('fold');
    });
    $('.DT').click(function() {
        $("#PopupDC").html("<b>DEPENDABLE TIRE INC.</b><br> 12515 Pennsylvania AVenue<br/>  Savage, MN 55378<br/>  Tel: 952-895-5380<br/>   Fax: 952-895-8821<br/>www.dependabletires.com");
        $('#PopupDC').show('fold');
    });

    $('.KAL').click(function() {
        $("#PopupDC").html("<b>KAL Tire</b><br> 969 Cliveden Ave<br/> New Westminster,<br/> BC V3M 5R6<br/> Contact Person: Jerry<br> Cell: 604-524-5264");
        $('#PopupDC').show('fold');
    });

    $('.ZA').click(function() {
        $("#PopupDC").html("<b>ZHEALT and Associates</b><br>120 RILEY St.<br/> Waterdown, ON L0R 2H6<br/> Contact Person: Al Tanguay<br> Cell: 905-730-6159 <br> Fax: 905-690-1027");
        $('#PopupDC').show('fold');
    });
    /*********************
    ** Online Order CheckBox **
    *********************/
    $("[id$='chkSameBS']").click(function() {
        if ($("[id$='chkSameBS']").is(':checked')) {
            $('#ShipAdd').hide('slow');
        }
        else {
            $('#ShipAdd').show('slow');
        }
    });

    $("#newsdivHeader").click(function() {
        if ($("#newsdiv").is(":hidden")) {
            $("#newsdiv").slideDown('slow');
        }
        else {
            $("#newsdiv").slideUp('slow');
        }
    });
    /*********************
    ** Expand/Collapse div using jQuery **
    *********************/
    $("#news1").click(function(event) {
        event.preventDefault();
        $("#news1content").slideToggle();
    });

    $("#news2").click(function(event) {
        event.preventDefault();
        $("#news2content").slideToggle();
    });

    $("#leftmenu-sitemap").click(function(event) {
        event.preventDefault();
        $("#wireframemenu").slideToggle();
    });

    $("#leftmenu-news").click(function(event) {
        event.preventDefault();
        $("#leftmenu-newscontent").slideToggle();
    });

    //$("#mostrar").mouseover(function(event) {
    //event.preventDefault();
    //$("#caja").slideToggle();
    //});
    //$("#mostrar").mouseout(function(event) {
    //event.preventDefault();
    //$("#caja").slideUp();
    //});        

    //$("#caja a").click(function(event) {
    //event.preventDefault();
    //$("#caja").slideUp();
    //});	
    /*********************
    ** Date Picker **
    *********************/
    $("[id$='datepicker']").datepicker();
    /*********************
    ** accordion  **
    *********************/
    //$("#accordion").accordion();
    $("#accordion-ConditionSearch").accordion();
    $("#accordion-TirePatterns").accordion();
    /*********************
    ** accordion  **
    *********************/
    //$("[id$='MainMenu'] img").autoMouseOver({ outStr: "_ot", overStr: "_ov" });
    //$("[id$='LeftMenu'] img").autoMouseOver({ outStr: "_ot", overStr: "_ov" });
    /*********************
    ** Follow Scroll Menu  **
    *********************/
    //$( "#followLeftMenu" ).scrollFollow( { 
    //container: 'left-menu' 
    //} );
    /*********************
    ** Slider  **
    *********************/
    $("#SizeSlider").slider({
        'step': 1,
        'min': 0,
        'max': 30,
        'startValue': 0,
        'slide': function(e, ui) {
            $("[id$='txtSize']").val(ui.value);
        }
    });

    $("#RimSlider").slider({
        'step': 1,
        'min': 0,
        'max': 30,
        'startValue': 0,
        'slide': function(e, ui) {
            $("[id$='txtRim']").val(ui.value);
        }
    });
    $("#Loadslider").slider({
        'step': 50,
        'min': 1000,
        'max': 20000,
        'startValue': 1000,
        'slide': function(e, ui) {
            $("[id$='txtLoad']").val(ui.value);
        }
    });
    $('.slideshow').cycle({
        fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
    });
    $('.homeslideshow').cycle({
        fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
    });

    $('#example1 .kwicks').kwicks({
        max: 175,
        spacing: 5
    });
});
	 /*********************
     ** Search Tires  **
     *********************/ 
     function SearchOperationClick(){ 
     $("#SearchOperations").empty();
     $('[id$="cklOperations"] input[type=checkbox]:checked').each(function(){
     $("#SearchOperations").append($('label[for=' + this.id + ']').html()+"<br>")}); 
     }
          function SearchSurfaceClick(){ 
     $("#SearchSurfaces").empty();
     $('[id$="cklSurfaces"] input[type=checkbox]:checked').each(function(){
     $("#SearchSurfaces").append($('label[for=' + this.id + ']').html()+"<br>")}); 
     }
          function SearchRoadClick(){ 
     $("#SearchRoads").empty();
     $('[id$="cklRoad"] input[type=checkbox]:checked').each(function(){
     $("#SearchRoads").append($('label[for=' + this.id + ']').html()+"<br>")}); 
     }
      
     



