function replaceChars()
{
	var bodyHTML = document.body.innerHTML;
	//bodyHTML = bodyHTML.replace(/\<b\>S<\/b\>/gi, "<img src=\"images/spade.gif\">")
	bodyHTML = bodyHTML.replace(/Ş/gi, "<img src=\"images/spade.gif\">")
	bodyHTML = bodyHTML.replace(/©/gi, "<img src=\"images/heart.gif\">")
	bodyHTML = bodyHTML.replace(/¨/gi, "<img src=\"images/dimond.gif\">")
	bodyHTML = bodyHTML.replace(/§/gi, "<img src=\"images/club.gif\">") 
	document.body.innerHTML = bodyHTML;
} 

function WriteTopTools()
{
 			
 			document.write("<div id=\"toolsdiv\">");
			document.write("<span style=\"font-weight: bold;\">Breyta textastćrđ:</span> ");
 			document.write("<a href=\"\" onclick=\"dw_fontSizerDX.adjust(20); return false\" title=\"Stćkkka texta\"><span class=\"vibuttona\">+</span></a> ");
 			document.write("<a href=\"\" onclick=\"dw_fontSizerDX.reset(); return false\" title=\"Sjálfgefinn stćrđ\"><span class=\"vibuttona\">N</span></a> ");
 			document.write(" <a href=\"\" onclick=\"dw_fontSizerDX.adjust(-20); return false\" title=\"Minnka texta\"><span class=\"vibuttona\">-</span></a> ");

			document.write("<span style=\"margin-left:20px; font-weight: bold;\">Breyta litum:</span>");
			document.write(" <a name=\"buttona\" href=\"javascript:void(0)\" onclick=\"changeColor('white'); rememberStyle ('color', 365);\"><span class=\"vibuttona\" title=\"Sjálfgefnir litir, hvítur bakgrunnur\">A</span></a> ");
			document.write("<a name=\"buttonb\" href=\"javascript:void(0)\" onclick=\"changeColor('lightblue'); rememberStyle ('color', 365);\"><span class=\"vibuttonb\"  title=\"Ljósblár bakgrunnur, svartur texti og dókkbláir tenglar\">B</span></a> ");
			document.write("<a name=\"buttonc\" href=\"javascript:void(0)\" onclick=\"changeColor('darkblue'); rememberStyle ('color', 365);\"><span class=\"vibuttonc\" title=\"Dökkblár bakgrunnur, hvítur texti og gulir tenglar\">C</span></a> ");
			document.write("<a name=\"buttond\" href=\"javascript:void(0)\" onclick=\"changeColor('black'); rememberStyle ('color', 365);\"><span class=\"vibuttond\" title=\"Svartur bakgrunnur, hvítur texti og grćnir tenglar\">D</span></a>");
			document.write("<span style=\"margin-left:20px;\">&nbsp;</span>");
			document.write(" <a name=\"buttona\" href=\"javascript:void(0)\"  onclick=\"changeColor('default'); rememberStyle ('color', -1); dw_fontSizerDX.reset(); dw_fontSizerDX.setDefaults( '%', 68.75, 58.75, 100, ['body'] ); dw_fontSizerDX.init(); SetCookie('displaytype',1,365);\" title=\"Fara á vef í sjálfgefnum ham\"><span class=\"vibuttona\">Vefur í sjálfgefnum ham.</span></a>");

		document.write("</div>");
}

function getAllSheets() {
	if( !window.ScriptEngine && navigator.__ice_version ) { return document.styleSheets; }
	if( document.getElementsByTagName ) { var Lt = document.getElementsByTagName('link'), St = document.getElementsByTagName('style');

	} else if( document.styleSheets && document.all ) { var Lt = document.all.tags('LINK'), St = document.all.tags('STYLE');
	} else { return []; } for( var x = 0, os = []; Lt[x]; x++ ) {
		var rel = Lt[x].rel ? Lt[x].rel : Lt[x].getAttribute ? Lt[x].getAttribute('rel') : '';
		if( typeof( rel ) == 'string' && rel.toLowerCase().indexOf('style') + 1 ) { os[os.length] = Lt[x]; }
	} for( var x = 0; St[x]; x++ ) { os[os.length] = St[x]; } return os;
}
function rememberStyle( cookieName, cookieLife ) 
{
	
	for( var viewUsed = false, ss = getAllSheets(), x = 0; window.MWJss && ss[x]; x++ ) { if( ss[x].disabled != MWJss[x] ) { viewUsed = true; break; } }
	if( !window.userHasChosen && !viewUsed ) { return; }
	for( var x = 0, outLine = '', doneYet = []; ss[x]; x++ ) {
		if( ss[x].title && ss[x].disabled == false && !doneYet[ss[x].title] ) { doneYet[ss[x].title] = true; outLine += ( outLine ? ' MWJ ' : '' ) + escape( ss[x].title ); } }
	if( ss.length ) 
	{ document.cookie = escape( cookieName ) + '=' + escape( outLine ) + ( cookieLife ? ';expires=' + new Date( ( new Date() ).getTime() + ( cookieLife * 86400000 ) ).toGMTString() : '' ) + ';path=/'; }

}
function useStyleAgain( cookieName ) 
{
	for( var x = 0; x < document.cookie.split( "; " ).length; x++ ) {
		var oneCookie = document.cookie.split( "; " )[x].split( "=" );
		if( oneCookie[0] == escape( cookieName ) ) {
			var styleStrings = unescape( oneCookie[1] ).split( " MWJ " );
			for( var y = 0, funcStr = ''; styleStrings[y]; y++ ) { funcStr += ( y ? ',' : '' ) + 'unescape( styleStrings[' + y + '] )'; }
			eval( 'changeColor(' + funcStr + ');' ); break;
	} } window.MWJss = []; for( var ss = getAllSheets(), x = 0; ss[x]; x++ ) { MWJss[x] = ss[x].disabled; }
}
