﻿g_strUrl = '/ajahhandler.aspx';
 var INIT_TIMEOUT=100;
 var g_initArgs = null;
 var g_strTarget='';
function GetAjahContent2(id)
{
  if(!g_initArgs)
  {
    g_initArgs=id;
  }                
  if(typeof document.readyState == 'undefined' || document.readyState  == 'complete')
  {
    GetAjahContent(g_initArgs) ;
  }
  else 
  {
    setTimeout('GetAjahContent2()',INIT_TIMEOUT);
  }
}
function GetAjahContentAll2(ids)
{
  if(!g_initArgs)
  {
    g_initArgs=ids;
  }        
  if(typeof document.readyState == 'undefined' || document.readyState  == 'complete')
  {
    GetAjahContentAll(g_initArgs) ;
  }
  else 
  {
    setTimeout('GetAjahContentAll2()',INIT_TIMEOUT);
  }        
}

function GetAjahContent(id)
{               
  var strRequest='BEHANDCTid=' + id + '&' + g_strTarget;        
  MBForm_DoCallback(
      '__Page',
      strRequest,
      ProcessAjah,
      null,
      CallbackError,
      true
    ) ;		        	
  return true;
}


  function GetAjahContentAll(ids)
{                     
  var strRequest='BEHANDALids=' + ids + '&' + g_strTarget;
  MBForm_DoCallback(
      '__Page',
      strRequest,
      ProcessAjah,
      null,
      CallbackError,
      true
    ) ;		        	
  return true;
}

function GetLightBoxHtml(id)//called from lightbox
{      
  var div=document.getElementById('lightbox-image-details');//div within lightbox for html
  div.innerHTML='';      
  var strRequest='LIGHTBOXid=' + id + '&target=lightbox-image-details&rnd=' + Math.random();
    MBForm_DoCallback(
        '__Page',
        strRequest,
        ProcessAjah ,
        null ,
        CallbackError,
        true
      ) ;		                 
}
function CallbackError(responseText,context)
{
  alert(responseText);
}


    
    

function LoadLightBox()
{
  if  (window.navigator.appVersion.indexOf("MSIE 6") < 0)      
  {
  	  $('a[@rel*=lightbox]').lightBox();   
  }      
}

LoadLightBox();


function CallPlaceFooterDivs()
{
  if(typeof PlaceFooterDivs == 'function')
  {    
    PlaceFooterDivs(true); 
  }
}

 function reloadjs()
 {
  var elems=null;
  var elem=null;
  $(".faqText").hide();
 
  $("h3").click(function() {
 if($('img',this).attr("src").indexOf("arrow_list_submenu.gif") > -1)
 {
  $('img',this).attr("src", $('img',this).attr("src").replace(/_submenu./, "_submenu_down."));  
 }
 else {
  if($('img',this).attr("src")!=null) {
    $('img',this).attr("src",$('img',this).attr("src").replace(/_submenu_down./, "_submenu."));  
  }
 }
    $(this).next(".faqText").slideToggle();
 });
 
 
 elems=$("#subMenu ul li a");
 if(elems)
 {
  for(var i=0;i < elems.length;i++)
  {
    elem=elems[i];
    elem.onclick=function(){ setActiveItem(this,this.getAttribute('href').substring(1))};
  }
 }
 
  LoadLightBox() ;
  //reposition footer divs if necessary
  CallPlaceFooterDivs() ;
}

function setActiveItem(obj, id)
{  
  var hidItem = document.getElementById('hidActiveItem');
  
  if(obj.parentNode) { obj.parentNode.className = 'selectedSubItem'; }
  
  if(hidItem) {
    if(hidItem.value.length>0)
    {
      var oLink = document.getElementById('hyp' + hidItem.value);
      
      if(oLink&&oLink.parentNode) { oLink.parentNode.className = ''; }
    }
    
    hidItem.value = id;
  }
}
