/*
	-> Thumb Nav
	a simply thumb-based navigation...
	
	coded in january 2007 by pinit.
	http://me.pinit.it

	(feel free to use but please keep this comment!)
*/
var thumbnav = {
	mydivs : 0,
	refer : null,
	fire : function() {
		var ua = window.navigator.userAgent;
		var msie = ua.indexOf ( "MSIE " );
		var mytags = document.getElementsByTagName("a");
		for (i=0; i<mytags.length; i++) {
			if (mytags[i].className.indexOf("tvid") != -1) {
				mytags[i].mydiv = mytags[i].className.substr((mytags[i].className.search("d"))+1);
				if (location.href.indexOf("-") < 0) mytags[i].onclick = function() {thumbnav.show(this.mydiv);};
				var lnk = mytags[i];		
				if (msie > 0) { // append damn proprietary ie opacity attribute!
					lnk.onmouseover= function(){this.parentNode.nextSibling.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=75)";};
					lnk.onmouseout = function(){this.parentNode.nextSibling.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=100)";};
				} else { // append valid css3 opacity attribute for standard-compliant browsers
					lnk.onmouseover = function(){this.parentNode.parentNode.style.opacity='.75555';};
					lnk.onmouseout = function(){this.parentNode.parentNode.style.opacity='1';};
				}
				thumbnav.mydivs++;
			}
		}
		hash = window.location.hash;
		if (hash.indexOf("#") != -1) {thumbnav.refer = hash.substr((hash.search("#"))+1);}
		if (location.href.indexOf("-") < 0) thumbnav.show(thumbnav.refer);
	},
	show : function(id) {
		if (videoclips.opened != null) {videoclips.close(videoclips.opened);} // job for videoclips();
		for (i=0; i<thumbnav.mydivs; i++) {
			mydiv = 'd'+ String(i+1);
			div = document.getElementById(mydiv);
			if (String(i+1) == String(id)) {div.style.display = "block";}
			else {div.style.display = "none";}
		}
	}
}