/* SGP INFRONT - Gerado em:16/06/2011 */
// Pop-Up Padrão do Site
function pop_master(url,a,l,sb)
{
        if (sb=="0"){
                saida_sb = "no";
        }else{
                saida_sb = "yes";
        }
        popupWin = window.open(url,'new_page','width=' + l + ',height=' + a + ',scrollbars=' + saida_sb + '');
}

// Crossbrowser GET ELEMENT BY ID
function returnObjById( id )
{
    if (document.getElementById)
        var returnVar = document.getElementById(id);
    else if (document.all)
        var returnVar = document.all[id];
    else if (document.layers)
        var returnVar = document.layers[id];
    return returnVar;
}

$(document).ready(function(){
$(".rounded-img, .rounded-img2").load(function() {
    $(this).wrap(function(){
      return '<span class="' + $(this).attr('class') + '" style="background:url(' + $(this).attr('src') + ') no-repeat center center; width: ' + $(this).width() + 'px; height: ' + $(this).height() + 'px;" />';
    });
    $(this).css("opacity","0");
  });
});
 
function equalHeight(group) {
   tallest = 0;
   group.each(function() {
      thisHeight = $(this).height();
      if(thisHeight > tallest) {
         tallest = thisHeight;
      }
   });
   group.height(tallest);
}


// Funcao de replace para avatares indisponiveis
function notfound(imagem){imagem.src = "/users/avatar_mini.jpg";}
function notfound_avatar_gr(imagem){imagem.src = "/users/avatar.jpg";}
function notfound_avatar_pg(imagem){imagem.src = "/users/avatar_pq.jpg";}

//Hover Padrão
  $(".hoverPadrao").hover(function(){$(this).fadeTo("fast", 0.5);},function(){$(this).fadeTo("fast", 1.0);});

//Inicialização do ShadowBox
Shadowbox.init();

function carrega_modal(url, largura, altura, titulo, modal){
  Shadowbox.open({ content: url, player: "iframe", title: titulo, height: altura, width: largura, options: { modal:   modal }
  });
}

function GerarCookie(strCookie, strValor, lngDias){ var dtmData = new Date();
    if(lngDias){ dtmData.setTime(dtmData.getTime() + (lngDias * 24 * 60 * 60 * 1000)); var strExpires = "; expires=" + dtmData.toGMTString();
    }else{var strExpires = "";} document.cookie = strCookie + "=" + strValor + strExpires + "; path=/";
}
function LerCookie(strCookie){
    var strNomeIgual = strCookie + "=";
    var arrCookies = document.cookie.split(';');
    for(var i = 0; i < arrCookies.length; i++){
        var strValorCookie = arrCookies[i];
        while(strValorCookie.charAt(0) == ' '){ strValorCookie = strValorCookie.substring(1, strValorCookie.length); }
        if(strValorCookie.indexOf(strNomeIgual) == 0){ return strValorCookie.substring(strNomeIgual.length, strValorCookie.length); }
    }return null;
}
function ExcluirCookie(strCookie){GerarCookie(strCookie, '', -1);}
