// Consolidated scripts for various blogger hacks

//FreshTags v0.6 http://www.greg-hill.id.au
del_user = "thetan";
anchor = "";			// should be vent
archive = "vent_archive";
defs = "published";

FT_tags={"type": "flat-cloud", "row": "0", "prompt": "Select Tags", "custom":""};
FT_post={"type": "list", "row": "0", "prompt": "Please Select Post", "custom":""};
FT_arch={"type": "drop", "row": "0", "prompt": "&nbsp;&nbsp;&nbsp;&nbsp;- Select Month -", "custom":""};

tagsDiv="FT-tags";
postDiv="FT-post";
archDiv="FT-arch";

maxposts = 15;
sort='alpha';

// function to manually remove non-vent tags from delicious feed
// this is only due to a new bug in delicious 10/8/2006

tagdroplist=["vent", "footy", "prosecution", "bashing", "footy_archive", "spoilt_rotten", "rape", "drugs", "footy_shop", "speccy", "underworld", "vent_feeds", "vent_archive"];
function droptags()
{
if (typeof(Delicious.all_tags)=='undefined'||typeof(tagdroplist)=='undefined')
	return;
t=tagdroplist;
for (var i=0; i<t.length; i++)
	delete Delicious.all_tags[t[i]];
return;
}

writeScript( "http://ghill.customer.netspace.net.au/blog-nav/blog-nav-v03.js" );
function writeScript( src ) { document.write( '<script type="text/javascript" src=" '+ src +' "><\/script>')  }



// Blog Navigator v0.2
// http://www.greg-hill.id.au (Creative Commons)
// See http://blogfresh.blogspot.com for details

// Define archURL path 
 archURL = "http://vent-letters.blogspot.com/archives/";

if (typeof(archURL)=='undefined')
	archURL = "http://"+document.domain+"/archive/";
PageType = "Item";


function buildArchives()
{
// Archive building code 

FreshNav=true;  // Wait on FreshTags archive to be built

if (typeof(Delicious.arch_posts)!='undefined')
{
	var p=Delicious.arch_posts;
	archives=new Array();
	for(var i=p.length-1; i>=0; i--)
		archives.push(p[i].u);
}
else
	setTimeout('doNav();', 2000);
return;
}


// Markit Blog Bookmarker
// http://www.greg-hill.id.au
// See http://blogfresh.blogspot.com

PostItemDiv="post-body";
MarkUrl="http://del.icio.us/thetan?";
tempURL="";

buttonStr='" title="Bookmark This" target="_blank" onMouseOver="doMark(this);" onMouseOut="this.href=tempURL;"><img src="http://del.icio.us/static/img/delicious.small.gif"/></a>';


function list_post_tags(post_tags)
{
// included for legacy reasons only; not recommended!

	var selected, c, tags=post_tags.split(' ');

	document.write('<td align="center"><small>[&nbsp;');

	for(var i=0;i<tags.length;i++)
	{

		rexp = new RegExp( tags[i], 'i' );

		selected = (curr_tags.search(rexp)>=0);
		if (selected)
			document.write('<strong>');

		document.write('&nbsp;&nbsp;'+tags[i]);
		if (del_user) c = Delicious.all_tags[tags[i]];
		if (c && c>0)
			document.write('('+c+')');
		
		if (selected)
			document.write('</strong>');

	}
	document.write('&nbsp;&nbsp;&nbsp;]&nbsp;&nbsp;');

	var keep_curr_tags = curr_tags;
	curr_tags=post_tags.replace(/ +/gi,'+');
	document.write('<a href="'+makeURL(curr_tags)+'">&gt;&gt;</a></small></td>');
	curr_tags = keep_curr_tags;
	
	return;
}

function show_count(count)
{

// only show the count (in braces) if it exists

if (count>0)
	document.write(' ('+count+')');
return;
}

// AddLoadEvent
// via http://simon.incutio.com/archive/2004/05/26/addLoadEvent

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

