$(document).ready(
	function() {
		$("a.fancy").fancybox({
			'overlayShow': true,
			'overlayOpacity': .5,
			'titlePosition': 'over'
		});
		$("a.iframe").fancybox({
			'width' : 480,
			'height' : 540,
			'autoScale' : false,
			'type' : 'iframe' 
		});
	
		stripeAllTables();
		externalLinks();
		
		$("a.plus").click( function() {
			$(this).hide();
			$(this).siblings("a.minus").show();
		});
		$("a.minus").click( function() {
			$(this).hide();
			$(this).siblings("a.plus").show();
		});

	}
);

function stripeTable(t) {
	var i, odd = true;
	for (i=0; i<t.rows.length; i++) {
		t.rows[i].className += odd ? ' odd' : ' even';
		odd = !odd;
	}
}
function stripeTableById(id) {
	var t = document.getElementById(id);
	if (t) stripeTable(t);
}

function stripeAllTables() {
	var t = document.getElementsByTagName('TABLE');
	for (var i=0; i<t.length; i++) stripeTable(t[i])
}

function externalLinks() {
	if (!document.getElementsByTagName) return; 
	var anchors = document.getElementsByTagName("a"); 
	for (var i=0; i<anchors.length; i++) { 
		var anchor = anchors[i]; 
		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") {
			anchor.target = "_blank";
		}
	} 
}

function onoff(el) {
	var e = el;
	if ($("#"+e).is(":hidden")) {
		$("#"+e).slideDown("slow");
	} else {
		$("#"+e).hide();
	}
}

