function getSAHeight() {
    h = (document.body.scrollHeight > document.body.offsetHeight)?document.body.scrollHeight:document.body.offsetHeight;    
    document.getElementById('sa').style.height = h + "px";
}

function hideRe() {
    $('#sa').animate({ opacity: "0" }, 500);
    $('#sa').hide();
    $('#advance').html('<div class="top"></div><div class="mid" id="adcontent"></div><div class="btm"></div>');
    $('#advance').hide();
    
}


function showPopUp(mode, idComm, type, a, b, c, d, e) {
    $('#advance').html('<div class="top"></div><div class="mid" id="adcontent"></div><div class="btm"></div>');    
    $('#sa').show();
    $('#sa').animate({ opacity: "0.5" }, 100);
    $('#advance').show();    
    $('#adcontent').append('<div class="pre"></div>');
    $.ajax({
    url: sHomePath + '/_content/popup_'+type+'.php',
    type: 'POST',
    data: {mode: mode, idComm: idComm, type: type, a: a, b: b, c: c,d: d,e: e},
    success: function(request) {
        $('#advance').html(request);
        var wrapper=document.documentElement.clientHeight-134;
        document.getElementById('popupwrapper').style.maxHeight=wrapper+'px';
  }
}); 
}
//jCarousel functions  - start
function mycarousel_itemVisibleInCallback(carousel, item, i, state, evt)
{
    var idx = carousel.index(i, mycarousel_itemList.length);
    carousel.add(i, mycarousel_getItemHTML(mycarousel_itemList[idx-1]));
}; 
function mycarousel_itemVisibleOutCallback(carousel, item, i, state, evt)
{
    carousel.remove(i);
};
 
function mycarousel_getItemHTML(item)
{
    
    return '<a href="'+item.link+'"><img src="' + item.url + '" width="216" height="138" alt="' + item.title + '" /></a><span class="carouselTitle">'+item.title+'</span>';
    
    

};
//jCarousel functions  - end

