// --------------------------------------------------------------------
//
// This is a Greasemonkey user script.
//
// To install, you need Greasemonkey: http://greasemonkey.mozdev.org/
// Then restart Firefox and revisit this script.
// Under Tools, there will be a new menu item to "Install User Script".
// Accept the default configuration and install.
//
// To uninstall, go to Tools/Manage User Scripts,
// select this script, and click Uninstall.
//
// --------------------------------------------------------------------
//
// ==UserScript==
// @name          Pænere Amino
// @namespace     http://labs.genstart.dk/ting/
// @description   example script to alert "Hello world!" on every page
// @include       http://www.amino.dk/*
// exclude		  nothing, nada
// ==/UserScript==



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);
}

addGlobalStyle('body, .annstyle, .annstyleheader, td, p, td, table, .smallp, .smallbold, .bodyFont, a, .smallthinlinkbold {  font-family:lucida grande, arial, helvetica, verdana ! important;  color:#000;}');
addGlobalStyle('.smallbold { color:#000; font-size:30px;}');
addGlobalStyle('.fontonbodylarge { font-size:10px;}');
addGlobalStyle(' .tableStyle > tbody > tr > td {sheight:30px !important; background-color:white !important;}')                                               
addGlobalStyle('.tableStyle, tbody, table, tr, td { border-width:0px !important; border-color:#FFF; }');
addGlobalStyle('.tableStyle > tbody > tr > td > div, .tableStyle > tbody > tr > td > div > table { width:200px; font-size:10px; color:#777; text-align:right;padding:10px}');                
addGlobalStyle('.tableStyle > tbody > tr > td > div .smallp  { font-color:#777;}');
addGlobalStyle('.tableStyle > tbody > tr > td > div > table > tr > td {  width:200px; text-align:right; }');
addGlobalStyle('html > body  { width:780px; margin:0 auto; }')                                                      
addGlobalStyle('table tr { border:3px solid #aaa;}');


for (var i=0; i<document.images.length; i++)
{
	// save current image
	var image = document.images[i];
	          

	                                        
	if(image.src.match(/.*amino_bulb_comic.*/i))
	{	//  laver nyt billede og fjerner det gamle
	var p = document.createElement("p");
	var newimage = document.createElement("img");
	newimage.src = "http://labs.genstart.dk/ting/amino_logo.gif";
	newimage.style.borderStyle = "none";
	p.appendChild(newimage);
	image.parentNode.appendChild(p);
	
	// fjerner
   image.parentNode.removeChild(image);     
 } // if logo

	 if(image.src.match(/.*eader.right.*/i))
	{	// ud med lårtet
   		image.parentNode.removeChild(image);     
	}

	 if(image.src.match(/.*post*/i))
	{	// ud med lårtet
   		image.parentNode.removeChild(image);     
	}


	 if(image.src.match(/.*header.left.*/i))
	{	// ud med lårtet
   		image.parentNode.removeChild(image);     
	}
	
	 if(image.src.match(/.*announcement.icon*/i))
	{	// ud med lårtet
   		image.parentNode.removeChild(image);     
	}




    
}