﻿


$(document).ready(function() {

    //    $('.ddMarcas').combobox().bind('comboboxselect', function(e, ui) {
    //    var selectValue = $(".ddMarcas").val();
    //    alert(selectValue);
    //        if (selectValue != null && selectValue.length > 0) {
    //           $(".ddMarcas select").val(""); 
    //        }
    //  });


    $(".TimelineAno").hover(
  function() {

      var _pos = $(this).offset();

      var _width = $(this).width();
      var _height = $(this).height();
      $("#TimelinePointer").css({ "left": (_pos.left + 9) + "px", "top": _pos.top + _height + 1 + "px" });
      $("#TimelinePointer").show();
      $("#TimelineDescricao").html("<span>" + $(this).attr("rel") + "</span>");
      $("#TimelineDescricao").show();
  },
  function() {
      $("#TimelineDescricao").html("");
      $("#TimelineDescricao").hide();
      $("#TimelinePointer").hide();
  }
);


    $("ul.sf-menu").superfish({
        pathClass: 'current'
    });


    //Scroller
//    $("#slider").easySlider({
//        auto: true,
//        continuous: true,
//        numeric: true
//    });

    //Tooltip


    //Tooltip
//    var config = {
//        sensitivity: 3, // number = sensitivity threshold (must be 1 or higher)    
//        interval: 200, // number = milliseconds for onMouseOver polling interval    
//        over: ShowTooltip, // function = onMouseOver callback (REQUIRED)    
//        timeout: 500, // number = milliseconds delay before onMouseOut    
//        out: HideTooltip // function = onMouseOut callback (REQUIRED)    
//    };

//    $("ol#controls li").hoverIntent(config)
//    function HideTooltip() {
//        $(this).qtip("destroy");
//    }
//    var arrTooltipDesc = new Array();

//    $('#slider li').each(function() {
//        //alert($(this).attr("id"));
//        arrTooltipDesc.push($(this).find(".tooltiptext").html());
//    });


//    function ShowTooltip() {
//        // If counter reaches maximum, reset

//        // Destroy currrent tooltip if present
//        if ($(this).data("qtip")) $(this).qtip("destroy");
//        var _tooltipID = $(this).attr("id");
//        //alert(_tooltipID);
//        _tooltipID = _tooltipID.replace("controls", "");
//        //alert(_tooltipID);
//        var _tooltipdesc = arrTooltipDesc[_tooltipID];
//        // alert(_tooltipdesc);
//        $(this).qtip({
//            content: _tooltipdesc, // Set the tooltip content to the current corner
//            position: {
//                corner: {
//                    tooltip: 'bottomMiddle', // Use the corner...
//                    target: 'topMiddle' // ...and opposite corner
//                }
//            },
//            show: {
//                when: false, // Don't specify a show event
//                ready: true // Show the tooltip when ready
//            },
//            //hide: {
//            //event: 'mouseover'
//            //}, // Don't specify a hide event
//            style: {
//                border: {
//                    width: 1,
//                    radius: 10
//                },
//                padding: 10,
//                textAlign: 'center',
//                tip: true, // Give it a speech bubble tip with automatic corner detection
//                name: 'light' // Style it according to the preset 'cream' style
//            }
//        });

//    };


    HideExpansao()

    $(".FecharModal").click(function() {
        $.unblockUI();
        return false;
    });
    
    $(".fancyBoxLink").fancybox({
    'overlayOpacity': 0.7,
    'overlayColor': '#FFF'
 });

 
 

});

function HideExpansao() {

    $(".DescExpansao").hide();
    $(".TitExpansao").click(function() {
        if ($(this).hasClass('open')) {
            $(this).parent().find(".DescExpansao").toggle("slow");
            $(this).removeClass("open");
        } else {
            $(".DescExpansao").hide("slow");
            $(".TitExpansao").removeClass("open");
            $(this).addClass("open");
            $(this).parent().find(".DescExpansao").toggle("slow");
        }

    });
}
function getURLParam(strParamName) {
    var strReturn = "";
    var strHref = window.location.href;
    if (strHref.indexOf("?") > -1) {
        var strQueryString = strHref.substr(strHref.indexOf("?")).toLowerCase();
        var aQueryString = strQueryString.split("&");
        for (var iParam = 0; iParam < aQueryString.length; iParam++) {
            if (
  aQueryString[iParam].indexOf(strParamName.toLowerCase() + "=") > -1) {
                var aParam = aQueryString[iParam].split("=");
                strReturn = aParam[1];
                break;
            }
        }
    }
    return unescape(strReturn);
}

