function formatText(index, panel) {
		  return index + "";
	    }
    
$(function () {

    $('.anythingSlider').anythingSlider({
        easing: "easeInOutExpo",        // Anything other than "linear" or "swing" requires the easing plugin
        autoPlay: false,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
        delay: 8000,                    // How long between slide transitions in AutoPlay mode
        startStopped: false,            // If autoPlay is on, this can force it to start stopped
        animationTime: 600,             // How long the slide transition takes
        hashTags: false,                 // Should links change the hashtag in the URL?
        buildNavigation: true,          // If true, builds and list of anchor links to link to each slide
		pauseOnHover: true,             // If true, and autoPlay is enabled, the show will pause on hover
		startText: "",             // Start text
        stopText: "",               // Stop text
        navigationFormatter: formatText,       // Details at the top of the file on this use (advanced use)
        defaultThumb: '../site_images/slider1.jpg'    //set the default thumbnail if no other are found
    });
    
    $("#slide-jump").click(function(){
        $('.anythingSlider').anythingSlider(6);
    });
    
    /*$('#primary-menu a.off').mouseover(function(){
		$(this).animate({ color: '#d17125' }, 'fast');
		$(this).parent().animate({ borderTopColor: '#d17125' }, 'fast');
	});
	$('#primary-menu a.off').click(function(){
		$(this).animate({ color: '#333333' }, 'slow');
		$(this).parent().animate({ borderTopColor: '#333333' }, 'slow');
	});
	$('#primary-menu a.off').mouseout(function(){
		$(this).animate({ color: '#333333' }, 'fast');
		$(this).parent().animate({ borderTopColor: '#333333' }, 'fast');
	});*/
	
	$('#customform-subscribe #Field1').val('E-MAIL ADDRESS');
	$('#customform-subscribe #Field1').focus(function() {
		if($('#customform-subscribe #Field1').val()=='E-MAIL ADDRESS'){
			$('#customform-subscribe #Field1').val('');
		};
	});
	$('#customform-subscribe #Field1').blur(function() {
		if($('#customform-subscribe #Field1').val()== ''){
			$('#customform-subscribe #Field1').val('E-MAIL ADDRESS');
		};
	});
	
	$('.column.first .pagecontent img').each(function(index){
		var caption = $(this).attr('alt');
		var detail = $(this).attr('title');
		var side = $(this).attr('class');
		var width = $(this).attr('width') + 2;
		$(this).wrap('<div class="image-wrap ' + side + '" style="width:' + width + 'px" />');
		if($(this).attr('title') != ""){
			$(this).after('<span class="detail">' + detail + '</span>');
		}
		$(this).after('<span class="caption">' + caption + '</span>');
		$(this).removeClass();
	});
	
    
});
    
Cufon.replace('h1, #primary-menu a, h2.item-title, .textSlide h2, .module h3');
			
function validate_email(field,alerttxt) {
	with (field) { 
		apos=value.indexOf("@");
		dotpos=value.lastIndexOf(".");
		if (apos<1||dotpos-apos<2) {
			alert(alerttxt);
			return false;
		}
		else { return true; }
	}
}
function validate_form(thisform,fieldtovalidate)
{
	with (thisform)
	{
	if (validate_email(fieldtovalidate,"Not a valid e-mail address!")==false)
	  { return false;}
	}
}


function getPassword(thisTable,thisId){ 
	  var retVal = "" 
	  retVal = prompt("A password is required to view this video.", ""); 
	  thisURL="/video.cfm";
	  $.post(thisURL, { variable: thisTable, variable2: thisId, variable3: retVal }, function(data){
	    newAnswer=data.replace(/^\s*/, "").replace(/\s*$/, "");
		if (newAnswer == "No") {
	 	 	alert("Incorrect Password!");
		  	window.location.reload();
		  	return false;
		  }
		  else {
		  	return true;
		  } 
	  });
}

function popUp1(message) {



var x = 20;

var y = 20;



	var windowparam = "width=" + 500 + ",height=" + 700 + ",scrollbars=yes,menubar=no,left="+x+",top="+y+",screenX="+x+",screenY="+y;

	popwin = window.open(message, "popwin", windowparam)

	popwin.opener = self;

	popwin.focus()

}
