/* Action Menu */

function actionMenu(items, items_act, id) {
  
  jQuery('span[@id^="' + items + '"]').each( function() { jQuery(this).show(); });
  jQuery('span[@id^="' + items_act + '"]').each( function() { jQuery(this).hide(); });
   
  $('#' + items + id).hide();   
  $('#' + items_act + id).show();   
   
}

function triangle(id) { 
  var height = document.getElementById(id).offsetHeight; 
  div = document.createElement('div');
  div.style.position = "absolute";
  div.style.right = "-1px";
  div.style.top = "0";
  div.style.fontSize = "0";
  div.style.borderBottom = (height/2) + 'px #fff solid';
  div.style.borderTop = (height/2) + 'px #fff solid';
  div.style.borderLeft = '50px #f2efda solid';
  document.getElementById(id).appendChild(div);
};

$(document).ready(function() { 
  
   $("#showShort").click(function(){
     showShort();
     return false;
   });
   $("#showShort_title").click(function(){
     showShort();
     return false;
   });
   
   
   $("#showLarge").click(function(){      
     showLarge();
     return false; 
   });
   $("#showLarge_title").click(function(){      
     showLarge();
     return false; 
   });  
   
   
   $.fn.searchform = function(option) {

    sformFocus = function() {
      if ($(this).val() == option['fraze']) {
        $(this).val('');
      }
    }

    sformBlur = function() {
      if (!$(this).val()) {
        $(this).val(option['fraze']);
      }
    }

    $(this).focus(sformFocus);
    $(this).blur(sformBlur);
  }
  
});

function showShort() {
  //$('#scrollable').hide();//.animate({     opacity: "hide" }, "fast"); 
  $('#showShort_body').show();//.animate({ opacity: "show" }, "fast");
  $('#scrollRules').hide();
  
  $('#showShort_title').addClass('red');
  $('#showLarge_title').removeClass('red');
  $('#showShort_title').removeClass('grey2');
  $('#showLarge_title').addClass('grey2');
}

function showLarge() {
  $('#showShort_body').hide();//.animate({ opacity: "hide" }, "fast");
  $('#scrollable').show();//.animate({     opacity: "show" }, "fast");
  $('#scrollRules').show();

  $('#showShort_title').removeClass('red');
  $('#showLarge_title').addClass('red');
  $('#showShort_title').addClass('grey2');
  $('#showLarge_title').removeClass('grey2');
}

function getBodyScrollTop(){
  return self.pageYOffset || (document.documentElement && document.documentElement.scrollTop) || (document.body && document.body.scrollTop);
}
