var hac,hai;
function minmaxshoutbox() {
 if (document.getElementById('shoutboxminimize').innerHTML=='Minimize') {
   hac=400;
   minc('shoutboxcontent',hac,0);
   hai=110;
   mini('shoutboxinput',hai,0);
   document.getElementById('shoutboxminimize').innerHTML='Maximize';
 }
 else if (document.getElementById('shoutboxminimize').innerHTML=='Maximize') {
   hac=0;
   maxc('shoutboxcontent',hac,400);
   hai=0;
   maxi('shoutboxinput',hai,110);
   document.getElementById('shoutboxminimize').innerHTML='Minimize';
 }
}

function minc(object,hs,he) {
 hac-=hs/20;
 if (hac>=he) {
   document.getElementById(object).style.height=hac+'px';
   setTimeout(function () {minc(object,hs,he);},10);
 } else {
   clearTimeout(function () {minc(object,hs,he);});
   document.getElementById(object).style.height=he+'px';
 }
}

function maxc(object,hs,he) {
 hac+=he/20;
 if (hac<=he) {
   document.getElementById(object).style.height=hac+'px';
   setTimeout(function () {maxc(object,hs,he);},10);
 } else {
   clearTimeout(function () {maxc(object,hs,he);});
   document.getElementById(object).style.height=he+'px';
 }
}

function mini(object,hs,he) {
 hai-=hs/20;
 if (hai>=he) {
   document.getElementById(object).style.height=hai+'px';
   setTimeout(function () {mini(object,hs,he);},10);
 } else {
   clearTimeout(function () {mini(object,hs,he);});
   document.getElementById(object).style.height=he+'px';
 }
}

function maxi(object,hs,he) {
 hai+=he/20;
 if (hai<=he) {
   document.getElementById(object).style.height=hai+'px';
   setTimeout(function () {maxi(object,hs,he);},10);
 } else {
   clearTimeout(function () {maxi(object,hs,he);});
   document.getElementById(object).style.height=he+'px';
 }
}

