/*****************************
*     Functions use in       *
*     Multiple Places        *
*****************************/
function fadeaway()
{
  $('boxinfo').toggle();
  $('box').fold({ duration: .3 });
  $('mask').fade({queue: 'end', speed: .5});
}
function ma(req)
{
    $(req).appear();
}

/*****************************
*     Functions use in       *
*       the home page        *
*****************************/
function over()
{
Effect.multiple([$('d2'),$('d3'),$('d4'),$('d5')], Effect.Morph, {style: 'width: 120px; height: 20px;'});
}
function out()
{
Effect.multiple([$('d2'),$('d3'),$('d4'),$('d5')], Effect.Morph, {style: 'width: 0px; height:20px;'});
}
/*****************************
*     Functions use in       *
*      The portfolio         *
*****************************/
 function vp()
{
  $('boxinfo').innerHTML='Loading Portfolio... Please Wait.';
  new Ajax.Updater($('boxinfo'), '/ajax/portfolio.php');
  $('mask').appear({to: .8});
  Effect.BlindDown('box',{queue: 'end'});
  $('boxinfo').appear({queue: 'end'});
}
function fadeaway2()
{
 $('viewportinfo').fold({ duration: .3 });
}
function portinfo(req)
{
    new Ajax.Updater('boxinfo2', '/ajax/portinfo.php?act='+req);
    $('viewportinfo').appear();
}
function getbigger(req)
{
   $(req).morph('height: 65px;');
}
function getsmaller(req)
{
   $(req).morph('height: 50px;');
}
function makebig(req)
{
  $('mainimage').innerHTML = "<img src='"+req+"' style='display: none;' onload='ma(this);' id='bigimage' />";
}
/*****************************
*     Functions use in       *
*     the sample scripts     *
*****************************/
function code(type)
{
    $('boxinfo3').innerHTML = 'Retriving Content...';
    new Ajax.Updater('boxinfo3', '/ajax/Code.php?type='+type);
    Effect.BlindDown('box3');
}
function fadeaway3()
{
 $('box3').fade({ duration: .3 });
}
/*****************************
*     Functions use in       *
*     About/Contact me       *
*   Some for sample scripts  *
*****************************/
function boxinfo(req)
{

  $('boxinfo').innerHTML = 'Retrieving Data...';
  var message = 'Were sorry, there was an error retrieving the data. Please try again later.';
  if(req == 'contact')
  {
    new Ajax.Updater('boxinfo', '/ajax/contact.php', {method: 'get'});
  }
  else if(req == 'about')
  {
     new Ajax.Updater('boxinfo', '/ajax/about.php', {method: 'get'});
  }
  else if(req == 'coding')
  {
    new Ajax.Updater('boxinfo', '/ajax/Code.php', {method: 'get'});
  }
  else
  {
    $('boxinfo').innerHTML = message;
  }
  $('mask').appear({to: .8});
  $('box').appear();
  $('boxinfo').appear({queue: 'end'});
}
