var objCom = new Com();

function goToByScroll() {
    $('#col_fotos').animate({ scrollTop: $("#fim").offset().top }, 'slow');
}

var index_reviews = 0;
/*
function AnteriorReviews() {
    if (index_reviews > 0) {
        index_reviews--;
        $('#reviews').animate({ scrollTop: $("#dj_" + index_reviews).offset().top - 158 }, 'slow');
    }
}

function ProximoReviews() {
    index_reviews++;
    try
    {
        if ($("#dj_" + index_reviews) != null) {
            $('#reviews').animate({ scrollTop: $("#dj_" + index_reviews).offset().top }, 'slow');
        }
        else {
            index_reviews--;
        }
    }catch(e)
    {
    index_reviews--;
    }
}
*/

function AnteriorReviews() {
    $("#reviews").animate({ scrollTop: "-=" + $("#reviews").outerHeight() + "px" }, "slow");
}

function ProximoReviews() {
    $("#reviews").animate({ scrollTop: "+=" + $("#reviews").outerHeight() + "px" }, "slow");
}

function AnteriorGaleria() {
  var iHChild = $('#Div1 > div > a:not([id^="dj_"]):not(.cima) > img').outerHeight(true);  
  $('#Div1').animate({ scrollTop: "-=" + (iHChild * 4) + "px" }, "slow");
}

function ProximoGaleria() {
  var iHChild = $('#Div1 > div > a:not([id^="dj_"]):not(.cima) > img').outerHeight(true);
  
  var iComplemento = 0;
   
  if(parseInt($('#Div1').scrollTop()) == 0)
      iComplemento = $('#Div1 > div > h2').outerHeight(true);   
  
  $("#Div1").animate({ scrollTop: "+=" + ((iHChild * 4) + iComplemento) + "px" }, "slow");
}

var menu_old = null;

function AbrirFecharMenu(obj) {
    if (obj != null) {
        var objCaixa = obj.parentNode.getElementsByTagName('ul')[0];

        if (menu_old != null)
            $(menu_old).toggle("fast");

        if (objCaixa != null) {
            $(objCaixa).toggle("fast");
            menu_old = objCaixa;
        }
    }
}
/*
$(document).ready(function () {
    $.getScript(('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js', function () {
        if (typeof (_gat) == 'object') {
            var pageTracker = _gat._getTracker('UA-16682946-1');
            pageTracker._initData();
            pageTracker._trackPageView();
        }
    });
});*/

function OnFocusBusca(obj, value) {
    if (obj.value == value) {
        obj.value = "";
    }
}

function OnBlurBusca(obj, value) {
    if (obj.value == "") {
        obj.value = value;
    }
}
