// ==UserScript==
// @name          MinimalGmail
// @namespace     http://www.codejacked.com
// @description	  Cleans up the Gmail interface to be barebones.
// @include       http://gmail.google.com/*
// @include       http://mail.google.com/*
// @include       https://gmail.google.com/*
// @include       https://mail.google.com/*
// ==/UserScript==
// Notes:
// Compiled by Kyle Pott
// Version .1
// The purpose of this script is to clean up the Gmail Interface.  This is a compilation of existing code.  If you see your code, thank you for contributing.

// Removes Labels Box
document.getElementById('nb_0').style.display="none";

// Removes the invites Box
document.getElementById('nb_1').style.display="none";

// Removes the contacts Box
document.getElementById('nb_2').style.display="none";

document.getElementsByTagName('head')[0].style.display="none";
//


ss = document.styleSheets[0];

ss.insertRule('#ds_spam b {visibility: hidden;}', ss.cssRules.length);
ss.insertRule('#ds_spam b::before {content: "Spam"; visibility: visible; font-weight: normal;}', ss.cssRules.length);

(function(){
	function addGlobalStyle(css) {
		var head, style;
		head = document.getElementsByTagName('head')[0];
		if (!head) { return; }
		style = document.createElement('style');
		style.type = 'text/css';
		style.innerHTML = css;
		head.appendChild(style);
	}



var newFontStyle = 'a, a:link, a:visited, a:active, a:hover, div.mxs,div.mxf, div.fq,.lk,div.tbcs,td.trb,td.trb,span.l,tr.rr, tr.rr, span.l, div#tt, div.mb, div.cb, div.mb, div.cb, table.rtab, div#tbcs, div.tbcp, table.ccc, .ctsm, .lk, #shwn, .tlc, .cln, #ra, #rp,.lc,    tr.rr, tr.s,.xs,.sxs,td.trb,.ab,.ct,table.ccc,.vtb,.ml,.mxt,#mt2 td,#mt2 button, #mt2 .mxd,.trc td,.rcvr,.phd table,.nl,.cv,.ib td,#aca span,.cs,.co,.fv,.fcs,.th td,.thm,.tlc col,.tlc td,.ctn,.ctcn,#cit,.cted,.cln,.clct,.cled,.cllf,.clac col,.clac td,.cll col,.cll td,.tf,.ctmcc td,.ctmec,.ctmccsel,.mb,#mm td,.att td,.ea span,#ap,.si,.sy,.ac span,.pu,.puf,.pun,#pm,table.pe td,.pct,.pfs button,.pfh,.pfl td,.cfa button,.rh,.rhs .rh,.evi,.eei,.evt,.on td,.ce,.nt td,.mno,.tbc,#fbc,#fbl,.fbb,.fbs,#fbz,.cf td,.cg td,.rtab td,.cd button,.cl,.chc,.chc td,#ctf,.bz_qa,.bz_meie,.bz_meff,.bzia,.bzea,.bzra,.wackbody,.wackinfomsg,.ivhead,.ivtop,.ivtop td,.ivbuttons,.bz_cb_text {font-family:Arial;font-size:13px;font-weight:normal;color: #333399; text-decoration: none;}';

var newFormsStyle = 'input,select,textarea, button{font-family: Arial;font-size: 14px;color:#336699;background-color: #FFFFFF;border: 1px solid #336699;margin: 0px 0px 0px 0px;padding: 0px 0px 0px 0px;}';

var newMessagesListStyle = 'td.sc{height:22px;} .rr{background-color: #FFFFFF}.cg,.rr{background-color: #FFFFFF} a:hover{text-decoration: underline}';

var newHiddenStyle = 'div.ft,div.fv,div.fcs,div.fp{display: none}';

var newHoverStyle = 'table.tlc tr.ur:hover, table.tlc tr.rr:hover{background-color: #EEEEEE;} table.tlc tr.sr:hover {background-color: #EEEEEE;}';

	//Apply Styles
	addGlobalStyle(newMessagesListStyle);
	addGlobalStyle(newFontStyle);
	addGlobalStyle(newFormsStyle);
	addGlobalStyle(newHiddenStyle);
	addGlobalStyle(newHoverStyle);


	// remove labels box
	//document.getElementById('nb_0').style.display="none";
})()




var prefHideLabels		= 1 // Hide Labels Menu ?
var prefHideInvites		= 1 // Hide Invites Menu ?
var prefNewLogo			= 1 // Show the new Gmail Logo ?



// Script

if(prefNewLogo==1)
{
	setTimeout("document.images['su_s_l'].src='http://services.google.com/images/gmail/logo1.gif';", 100);
}



var htmlGeneral = document.createElement("div");

htmlGeneral.innerHTML = '<style type="text/css">.fq,.fv,.fv .lk,.tf,.tf .lk{color:#666666 ! important;}.fcs,.ft,.lc,#ra{display:none;}.thm{padding:10px;}</style>';

document.body.insertBefore(htmlGeneral, document.body.firstChild);



if(prefHideLabels==1)
{
	var htmlHideLabels = document.createElement("div");

	htmlHideLabels.innerHTML = '<style type="text/css">#nb_1{display:none;}</style>';
	document.body.insertBefore(htmlHideLabels, document.body.firstChild);
}



if(prefHideInvites==1)
{
	var htmlHideInvites = document.createElement("div");

	htmlHideInvites.innerHTML = '<style type="text/css">#nb_0{display:none;}</style>';
	document.body.insertBefore(htmlHideInvites, document.body.firstChild);
}



var css = "/** GOOGLE's TABLE **/ table.ccc, table.cornerBookmarks { top: 5px !important; left: 5px !important; -moz-opacity: .6 !important; position: absolute; padding: 0 !important; display: block !important; width: 16px !important; height: 18px !important; } table.ccc:hover, table.cornerBookmarks:hover { -moz-opacity: .85 !important; width: 430px !important; height: 25px !important; padding-top: 5px !important; padding-left: 5px !important; -moz-border-radius: 7px; border: 1px solid #666; background-color: #f1f1fa !important; } /** Span Elements **/ table.ccc *, table.cornerBookmarks * { display:none } table.ccc:hover *, table.cornerBookmarks:hover * { display:inline; } /** CALENDAR FIXES **/ div.cornerBookmarks { position: relative !important; top: -2px !important; left: 3px !important; } /** REPLACED ELEMENT **/ table.ccc::before, table.cornerBookmarks::before { margin: 0 !important; display: block; content: \" \"; width: 16px !important; height: 16px !important; background: transparent url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/w D/AP+gvaeTAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAB3RJTUUH1gEECzsZ7j1DbAAAAu1JREFUOMulkz tsW3UUxn////Xb1684NXbzsOskA6UiklWCCOmCCiKwsCDBjBShThVCDICYgCIxMHgCBhYYkbJAhaIoIB CKKvUBhArHGLexaar4/bj2ffjey0CboagTZ/l0jo5+Ovp0PvifJR4c5F64NOMX7kcoyrppOwmBwOcRHT GZXBk7YuPW5bfrDwWcWv/gdSFlcWEp55mZyxCJhBGAruvcqd+lXKpOsMxLpW/ffe8/gNz6h6/FYuFP18 4VlNO5E8yfTJEKu2QSQbojk51rt7nxZ4Pr124Sks7HP3918S0ACfDJlz+ueBRZfPaZJ5R3Xinw3HKKx7 MRCgtTzCaDRAMKwjJoN1qcWX6Uu93xm/nn358/Bmzt7r+RX8wG4kGFdm+MGo3h93lojaCnO5RrbZpjQX YmSSrqY2EpJ7zC/QLAA1Ctt5568lxeDHULTYaYQtLUwCOh3dX47Osr9EcG0qOgjUzyi1lq1drKMWBs2u l4LMLiXJxkSHLQNvB5PWiWzfZuid5wjGnZGMMxXr+faFTFmNihY4DANXyK9L28NkejM6J5NET4VSa2ja qGkIrEtWxsx0EfaAC47r/my3vN3mg4sAcjk0wyTLvR4vL31zls9FG8Pp5eXWZm9hEmtoMQgn5/iILbPr 4AIbaq1b+Xd/ZmQ/WDO5QPWmSmIzQ6A8aWjTY2SSdVMoVTBFSVq7/XXOHY3wEoAPGl8+VWq3fBDai+W0 ea2K8c0hxa5OdPoOAQUCRnl6bZeKnASLf49ZdSM51OvvrH7mZXAeiWtweR3FrvqNF7Mb8wh5QSfzjEYV ujdtRnYtuczk4xHQ3gdQwrEZxs39j6fKdSqbSU+5/Y++uHsieateuHg9VYPCpTqSSp6QSJmIqhm+z9Vn JuV6o9Jv2beq++WywWf3IcZ/hgmNKh9JnVk4+d31CCyRXDljEAx9T6zrC+dzYrribCcn9zc/ObTqdzAL jiIQmNArF76gcMYAB0gT7g3l/+ByWIP9hU8ktfAAAAAElFTkSuQmCC\") top left no-repeat !important; } table.ccc:hover::before, table.cornerBookmarks:hover::before {display:none}";
if (typeof GM_addStyle != "undefined") {
	GM_addStyle(css);
} else if (typeof addStyle != "undefined") {
	addStyle(css);
} else {
	var heads = document.getElementsByTagName("head");
	if (heads.length > 0) {
		var node = document.createElement("style");
		node.type = "text/css";
		node.innerHTML = css;
		heads[0].appendChild(node); 
	}
}
// End