var D6=window,C6=document;function showMessage(id){$$('.minimailTextBoxes').each(function(ele){if(ele.style.display !="none"){Effect.toggle(ele,'blind',{duration: 0.5});}});Effect.toggle("msg_"+id,'blind',{duration: 0.5});}function changePage(page,type){$('minimail_content').innerHTML="loading..";new Ajax.Request("minimail?start="+page,{parameters:{"do": type},onSuccess: function(text){$('minimail_content').innerHTML=text.responseText;}});}function checkusername(){var updater=$('foundornot');var value=$('username').value;if(value.length > 2){new Ajax.Request("checkUsername",{parameters:{username: value},onSuccess: function(text){if(text.responseText !="found"){updater.innerHTML="<em>'nt</em>";}else{updater.innerHTML=" ";}}});}else{updater.innerHTML="<em>'nt</em>";}}function switchPage(page){$('minimail_content').innerHTML="loading..";switch(page){case 1:
var page="compose";break;case 2:
var page="sent";break;case 3:
var page="recieved";break;default:
var page="recieved";break;}new Ajax.Request("minimail",{parameters:{"do": page},onSuccess: function(text){$('minimail_content').innerHTML=text.responseText;}});}function sentMessage(){new Ajax.Request("minimail",{parameters:{submitMiniMail: true,username: $('username').value,title: $('title').value,msg: $('message').value},onSuccess: function(text){if(text.responseText !="Message sent"){alert(text.responseText);}else{alert(text.responseText);switchPage(2);}}});}function deleteItem(id,type){new Ajax.Request("minimail",{parameters:{doneDelete: true,id: id,sent: type},onSuccess: function(text){Effect.Pulsate("main_"+id);Effect.Fade("main_"+id,{delay:2});}});}function replytoitem(id){new Ajax.Request("minimail",{parameters:{"do": "compose",id: id},onSuccess: function(text){$('minimail_content').innerHTML=text.responseText;}});}Event.observe(D6,'load',function(){switchPage(3);});function textCounter(field,countfield,maxlimit){if(field.value.length > maxlimit)field.value=field.value.substring(0,maxlimit);else 
countfield.value=maxlimit - field.value.length;}