/* Standard Macromedia functions for rollovers */

function preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	var i,j=d.MM_p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
	if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function swap_back() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function swap() { //v3.0
  var i,j=0,x,a=swap.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
/* ====================================================================================== */
/* jQuery document-is-ready function. Place all calls here */
jQuery(document).ready(function() {

	// If javascript enabled, hide the article container. In fact, fade it out not hide it,
	// that way it takes up the same amount of vertical space -- you just can't see it....
	$("#article").fadeTo(0,0.85);
	
	$('#pt-menu').ptMenu();

    $('#article').corners("10px");

	$("a[rel^='prettyPhoto']").prettyPhoto();

	$(".taBlock strong").wrap("<a></a>").css("text-decoration","none");
	//$(".taBlock strong").prepend("<img align=\"bottom\" src=\"/images/arrow_down.png\" width=\"10\" height=\"12\" alt=\"arrow\" /> ");
	$(".taBlock a").click(function() {
		$(".taBlockContent").slideUp();
		$(".taBlock strong").text("More");
		if($(this).next(".taBlockContent").css('display') == 'none') {
			$(".taBlock strong").text("Less");
			$(this).next(".taBlockContent").slideDown(function() {
				//$.scrollTo($(this));
			});
		}
	});
	
	$("#button_login").click(function(){
		$("#loginForm").slideToggle();
	});
	$("#button_login_cancel").click(function(){
		$("#loginForm").slideUp();
	});
	
	// Any slider. Give it class 'jqslider' then name="1"
	// then a div of the text called id='jqslider_content1'
	// different number for different ones on the same page
	if($(".jqslider").length) {
		var sliderContent
		$(".jqslider").click(function() {
			sliderContent = $("#jqslider_content"+$(this).attr("name"));
			sliderContent.slideToggle("fast");
		});
	}
	
	// ...bring in Content area box after a short delay. This gives time for the background
	// picture behind to be seen
//	$("#article").pause(bgdelay).fadeTo("slow",0.85);
		
});

// Pause function
$.fn.pause = function(duration) {
	$(this).animate({ dummy: 1 }, duration);
	return this;
};

// *************************************************************************
function checkQT() {
	if (navigator.plugins) {
		for (i=0; i < navigator.plugins.length; i++ ) {
			if (navigator.plugins[i].name.indexOf("QuickTime") >= 0) {
				haveqt = true;
			}
		}
	}
	if ((navigator.appVersion.indexOf("Mac") > 0) && (navigator.appName.substring(0,9) == "Microsoft") && (parseInt(navigator.appVersion) < 5) ) {
		haveqt = true;
	}
}
// *************************************************************************
