
function showEvent(event) {
	event.stop();
	new Effect.toggle('Ibox','appear', { duration: .7, afterFinish:function(){} }); 
}

function hide(){
  $('Ibox').morph('opacity:0', { duration: 0 }).hide();
}


function target(){
    $$('a[rel="external"]').each(function(link){
        if(link.readAttribute('href') != '' && link.readAttribute('href') != '#'){
            link.writeAttribute('target','_blank');
        }
    });
}

function gotoLocation(){
    
    var url = location.href;
    var id = url.split('#')[1];
    
    if(( id != undefined ) && ( id !='' ) ) {
        new Effect.toggle(id, 'blind', { duration: .6, afterFinish:function(){ $(id).scrollTo(); } });
        
        //{ duration: .7, afterFinish:function(){ } }
    }

}

document.observe('dom:loaded', function() {
  
  if($('info_icon') != null) {

     hide();
     $('info_icon').observe('click', showEvent);
  }

  if($$('.faqText') != null) { 
     
     $$('.faqText').each(function(s) { s.hide(); });
  }

  target();

  gotoLocation();
  
  
});

function slide(el, id) {
   new Effect.toggle(id, 'blind', { duration: .5 }); 
}
