$(document).ready(function(){

//Modal Initiate
	// Load dialog on page load
	//$('#basic-modal-content').modal();

	// Load dialog on click
	$('#basic-modal .basic').click(function (e) {
		$('#basic-modal-content').modal();

		return false;
	});
	

$( "#tabs" ).tabs();


$("button").click(function () {
      var text = $(this).text();
});


$("#tabs").find('li a').css({fontSize:'12px',padding:'.5em 0.7em'});


 var $tabs = $('#tabs').tabs();

$(".ui-tabs-panel").each(function(i){

              var totalSize = $(".ui-tabs-panel").size() - 1;


              if (i != 0) {
                  prev = i;
                  $(this).append("<a href='#' id='prev' class='prev-tab mover' rel='" + prev + "'><span>&#171; Prev</span></a>");
              }
              
              if (i != totalSize) {
                  next = i + 2;
                  $(this).append("<a href='#' id='next' class='next-tab mover' rel='" + next + "'><span>Next &#187;</span></a>");
              }

            });

            $('.next-tab, .prev-tab').click(function() { 
                   $tabs.tabs('select', $(this).attr("rel"));
                   return false;
});



$('#totwo').click(function() { // bind click event to link
    $tabs.tabs('select', 1); // switch to third tab

});
$('#toone').click(function() { // bind click event to link
    $tabs.tabs('select', 0); // switch to third tab

});
$('#tothree').click(function() { // bind click event to link
    $tabs.tabs('select', 2); // switch to third tab

});  

	
	$('#vid_box .vid-1').click(function (e) {
		$('#vid-1').modal({overlayClose:true});//load modal
		return false;
	}); 
	$('#vid_box .vid-2').click(function (e) {
		$('#vid-2').modal({overlayClose:true});//load modal
		return false;
	}); 
	$('#vid_box .vid-3').click(function (e) {
		$('#vid-3').modal({overlayClose:true});//load modal
		return false;
	});
  
  $("#vid_box  .vid-1").hover(function() {
	$("#play-1").addClass('hover');
	}, function() {
	$("#play-1").removeClass('hover');
	});  
	$("#vid_box  .vid-2").hover(function() {
	$("#play-2").addClass('hover');
	}, function() {
	$("#play-2").removeClass('hover');
	});
	$("#vid_box  .vid-3").hover(function() {
	$("#play-3").addClass('hover');
	}, function() {
	$("#play-3").removeClass('hover');
	});

/*Simple Slider------------*/
//("#slider").easySlider();

//("#slider").find("li").css('float','none');

//$("#slider").find("ul").css('width','500px');


//Remove site description below logo
$("#site-description").remove();

//Remove Homepage Title
$("#post-4,#post-135,#post-133,#post-131").find(".entry-header").remove();
$("#post-131").find(".entry-content").css('padding','5px 25px');
// $("#post-4").find(".entry-content").css('width','945px');
// $("#post-4").find(".entry-content").css('padding','30px 15px 15px 15px');
//  
//ONLY PDF Download
$("#post-157,#post-123,#post-149,#post-209").find("#download li a.pdf").css('width','390px');

//Load New Window
$("#menu-item-509,#menu-item-578,#menu-item-579,#menu-item-216").find('a').attr("target","_blank"); 


//Fix Large Header Title
$("#post-157,#post-151").find(".entry-title").css('font-size','32px');

//Insert Top Navigation
$("#tnav").insertAfter("#branding #s");

//Phone Icon
$("#tnav ul li a.phone,#tnav ul li a.mail").removeAttr("href");
$("#phonefax").hide();
$("#mailtoggle").hide();
$("#phonefax").insertAfter("tnav ul li a.phone");
$("#mailtoggle").insertAfter("tnav ul li a.mail");

$("#tnav ul li a.mail").toggle(function() {

/*if($("#phonefax").is(':visible')){
	$("#phonefax").hide();
	}  
*/
    $("#mailtoggle").show('fade');
}, function () {
    $("#mailtoggle").hide('fade').stop(true,true);
});

$("#tnav ul li a.phone").toggle(function() {

/*if($("#mailtoggle").is(':visible')){
	$("#mailtoggle").hide();
	}
*/
    $("#phonefax").show('fade');
}, function () {
    $("#phonefax").hide('fade').stop(true,true);
});

//DECA Intro
$("#decaintro span").hide();

$("#decaintro").hover(function() {
    $(this).find('span').show('fade').stop(true,true);
}, function () {
    $(this).find('span').hide('fade');
});


//Adjust Main Menu Navigation
$("#access li#menu-item-47, #access li#menu-item-46").find('ul a').css({
    width:'335px'
});
$("#access li#menu-item-46").find('ul a').css({
    width:'335px'
});
$("#access li#menu-item-48").find('ul a').css({
    width:'+=15px'
});
$("#access li#menu-item-45").find('ul a').css({
    width:'240px'
});
$("#access li#menu-item-44").find('ul a').css({
    width:'250px'
});

//Adjust Homepage

/*$("#post-4").find(".singular .entry-header, .singular .entry-content, .singular footer.entry-meta, .singular #comments-title").css({
		margin: '0 auto',
    	width: '980px'
		});
*/
		
//pdf icon hover
$("#rightclick").html("Right click / Save as if you're having troubles downloading");

$(".pdficon").hover(function(){
	$("#rightclick").show('fade').stop(true,true);
}, function() {
	$("#rightclick").delay('500').hide('fade');
});
  	

});
