var overlaid = false;
var current_portfolio = 0;
Event.addBehavior({
  'h2 a:click':function(){
    link = this.href.split('#')[1]
    if(link == 'lets-talk' && $('lets-talk').style.display == 'none')
    {
      link = 'contact-stuff'
    }
    new Effect.ScrollTo(link, {duration: .5});
    return false;
  },
  'div.the-bistoon:click': function(){
      if(overlaid)
      {
        overlaid = false;
        return false;
      }
      new Effect.ScrollTo('multimedia-graphic', {duration: .5});
      return false;
    },
  'div.lets-talk h2 a:click': function(){
    
    Element.show('contact-stuff');
    Element.hide('lets-talk');
    $('name').focus();
    return false;
  },
  'p.whoweare a:click':function(){
    overlaid = true
    new Effect.toggle('whoweare', 'blind', {duration: .5});
    return false;
  },
  'p#the-blog a:click':function(){
    overlaid = true
    location.href = this.href
  },
  'p.our-partners a:click':function(){
    if($('the-bisoton-footer').style.display == 'none')
    {
      $('the-bisoton-footer').show()
      new Effect.ScrollTo('the-bisoton-footer', {duration: .5});
    }
    else
    {
      new Effect.BlindUp('the-bisoton-footer', {duration: .5})
    }
    return false
  },
  'li.screen-shot a:click':function(){
    $$('div.screen-shot img').first().setAttribute('src', this.getAttribute('href'));
    $('guys-links').hide();
    $('screen-shot').show();
    return false;
  },
  'div.screen-shot img:click':function(){
    $$('div.screen-shot img').first().setAttribute('src', 'images/loading.png');
    $('guys-links').show();
    $('screen-shot').hide();
    return false;
  },
  'form#cForm:submit': function(e){
    if($F('posName').blank() || $F('posEmail').blank() || $F('posText').blank())
    {
      new Effect.Shake('cForm')
      return false;
    }
        return false;
    }
})
