jQuery.noConflict();

jQuery(document).ready(function() {
 
  jQuery("#ctn_foot li.bookmark").click(function() {
    jQuery("#bookmark_container").toggle();
  });
  
  jQuery(".lang_field_bg").click(function() {
    if (jQuery(this).attr("class") == "lang_field_bg") {
      jQuery(this).addClass("lang_field_bg_active");
      jQuery("#language_container").attr("style", "display:block;");
    } else {
      jQuery(this).removeClass("lang_field_bg_active");
      jQuery("#language_container").attr("style", "display:none;");
    }
  });
  
  if (window.navigator.userAgent.indexOf("MSIE ") > -1 && parseFloat(navigator.appVersion) < 7) {
    windowHeight();
  }

});

function windowHeight() {
  if (window.innerHeight) {
    jQuery("#scroll_content").attr("style", "height:" + ((window.innerHeight-80) + 'px'));
  } else if (document.body && document.body.offsetHeight) {
    jQuery("#scroll_content").attr("style", "height:" + ((document.body.offsetHeight-80) + 'px'));
  } else {
    jQuery("#scroll_content").attr("style", "height:100%");
  }
}

function renderSingleLightbox(id)
{
  if(!jQuery(id).get(0))
    return;
  
  jQuery(id).lightBox({
    overlayBgColor: '#CCCFCE',
    overlayOpacity: 0.7,
    imageLoading: '/typo3conf/ext/av_lightbox/res/images/loading.gif',
    imageBtnClose: '/typo3conf/ext/av_lightbox/res/images/close.gif',
    imageBtnPrev: '/typo3conf/ext/av_lightbox/res/images/prev.gif',
    imageBtnNext: '/typo3conf/ext/av_lightbox/res/images/next.gif',
    containerResizeSpeed: 350
  });
}

  //workaround for ie select - divLayer problem
  //iframe is dynamically generated and put underneath the layer --> blocks selects from beneath
  var iFrames=new Array();
  function hideIFrame(parentId)
  {
    parentDiv=document.getElementById(parentId);
    iFrameId=parentId+'_iframe';
    parentDiv.removeChild(iFrames[iFrameId]);
    iFrames[iFrameId]=null;
  }

  function showIFrame(divId,parentId)
  {
    var objTipLayer=document.getElementById(divId);
   
    //Increase default zIndex of div by 1, so that DIV appears before IFrame
    //objTipLayer.style.zIndex=objTipLayer.style.zIndex+10;
    iFrameId=parentId+'_iframe';
    
    if(typeof(iFrames[iFrameId]) != 'object')
      iFrames[iFrameId]=null;
     
    if(iFrames[iFrameId]==null)
    {
      iFrame=document.createElement('IFRAME');
      iFrame.setAttribute('src', "javascript:'<html></html>';");
      iFrame.setAttribute('frameborder', 1);
      iFrame.setAttribute('border', 1);
      //Match IFrame position with objTipLayer
      iFrame.style.position='absolute';
      iFrame.style.border='0';
      iFrame.style.left=objTipLayer.offsetLeft + 'px';
      iFrame.style.top=objTipLayer.offsetTop + 'px';
      width=objTipLayer.offsetWidth-4;
      iFrame.style.width=width + 'px';
      iFrame.style.height=objTipLayer.offsetHeight + 'px';
      parentDiv=document.getElementById(parentId);
      parentDiv.appendChild(iFrame);
      iFrames[iFrameId]=iFrame;
    }
    else
    {
      hideIFrame(parentId);
    }
  }