$(document).ready(function(){
	jQuery("#archives").hide();
	jQuery("#aswitcher").click(function(){
		jQuery("#archives").slideToggle();
		return false;
	});

	jQuery("ul.blog-listing a").each(function(i, el){
		var img = jQuery(el).find("img.blog_image")[0];
		if (img)
		{
			el.img = img;
		}
	});
	jQuery("ul.blog-listing a").hover(function() {
		if (this.img)
		{
			if (!this.img._src){
				this.img._src = this.img.src;
			}
			this.img.src = "/images/transparent.gif";
			jQuery(this.img).css({'background-position': '0 0'});
		}
	}, function() {
		if (this.img && this.img._src)
		{
			this.img.src=this.img._src;
		}
	});
	
	initTabs();
});

function initTabs()
{
	var _box = document.getElementById("tp1");
	if (_box) {
		var tp1 = new Spry.Widget.TabbedPanels("tp1", { defaultTab: 0 });
	}

	var _box = document.getElementById("tp2");
	if (_box) {
		var tp2 = new Spry.Widget.TabbedPanels("tp2", { defaultTab: 0 });
	}
}

/* var _aswitcher = null;
var _archives = null; 

function initAswitcher() {
	_aswitcher = document.getElementById("aswitcher");
	_archives = document.getElementById("archives");
	if(_archives)
	{
		if(_aswitcher.className.indexOf("open") != -1)
		{
			Effect.SlideDown(_archives);
		}
		_aswitcher.onclick = function() {
			if (this.className.indexOf("open") == -1)
			{
				Effect.SlideDown(_archives);
				this.className += " open";
			}
			else
			{
				Effect.SlideUp(_archives);
				this.className = this.className.replace("open", "");
			}
			return false;
		}
	}
}
*/


if (window.addEventListener) {
	//window.addEventListener("load", initTabs, false);
	//window.addEventListener("load", initAswitcher, false);
}
else if (window.attachEvent) {
	//window.attachEvent("onload", initTabs);
	//window.attachEvent("onload", initAswitcher);
}







