/*
Site:          pcs.org
Page:          /assets/js/pcs-functions.js
Last Modified: Dec 11 2009
=========================================================== */
$(document).ready(function() {
	
	$(".tikt-txt ul").hover(
		function () {
			$(this).addClass("maximus");
		},
		function () {
			$(this).removeClass("maximus");
		}
	);

	 var slideIndex = 0;
	 var slideBlock = $('.tikt-txt');
	 var slideMax = slideBlock.length - 13; // leaves 13 slides showing in the window
 
	 $('.galprev2').click(function(){
	  slideIndex--;
	  changeSlide();
	 });
	 $('.galnext2').click(function(){
	  slideIndex++;
	  changeSlide();
	 });
	 $('#slideshow2').bind('mousewheel', function(e,d){
	  var speed = Math.floor(Math.abs(d));
	  if (d > 0) {
	    slideIndex = slideIndex - speed; 
	  } else {
	    slideIndex = slideIndex + speed; 
	  }
	  changeSlide();
	 });


	 function changeSlide(){
	  if (slideIndex > slideMax) {
	   slideIndex = slideMax;
	  }
	  if (slideIndex < 0) {
	   slideIndex = 0;
	  }
	  $('#slideshow2').stop().scrollTo(slideBlock[slideIndex],300) 
	 }


  $("ul.production-nav").superfish({
		autoArrows:  false,
    onShow: function(){
      $('a.nav-social').addClass('sup-active');
    },
    onHide: function(){
      $('a.nav-social').removeClass('sup-active');
    },
    dropShadows: false
  }); 
 
	// var hide = false;
	// $(".sm-link").hover(function(){
	//     if (hide) clearTimeout(hide);
	//     $("#sm-element").fadeIn();
	// }, function() {
	//     hide = setTimeout(function() {$("#sm-element").fadeOut("slow");}, 250);
	// });
	// $("#sm-element").hover(function(){
	//     if (hide) clearTimeout(hide);
	// }, function() {
	//     hide = setTimeout(function() {$("#sm-element").fadeOut("slow");}, 250);
	// });


	// var hide = false;
	// $(".cal-link").hover(function(){
	//   if (hide) clearTimeout(hide);
	//   $("#cal-box-down").fadeIn();
	// }, function() {
	//   hide = setTimeout(function() {$("#cal-box-down").fadeOut("slow");}, 250);
	// });
	// $("#cal-box-down").hover(function(){
	//   if (hide) clearTimeout(hide);
	// }, function() {
	//   hide = setTimeout(function() {$("#cal-box-down").fadeOut("slow");}, 250);
	// });



	// var text = 'Your name';
	// var srchField = $("#search #searchText");
	// srchField.attr("value", text); 
	// srchField.focus( function(){if(srchField.val() == text){srchField.attr("value", '');}});
	// srchField.blur( function(){if(srchField.val() == ''){srchField.attr("value", text); }});


}); /* close doc ready */
      

function zero(field){
if (field.defaultValue==field.value)
field.value = "";
}


function changeLink()
{
  document.getElementById('myAnchor').innerHTML="BUY TICKETS";
}

function changeme(id, action) 
{
  if (action=="hide") {
   document.getElementById(id).style.display = "none";
  } else {
   document.getElementById(id).style.display = "block";
  }
}

/**
* bigTarget.js - A jQuery Plugin
* Version 1.0.1
* Written by Leevi Graham - Technical Director - Newism Web Design & Development
* http://newism.com.au
*/
;(function($){$.fn.bigTarget=function(options){debug(this);var opts=$.extend({},$.fn.bigTarget.defaults,options);return this.each(function(){var $a=$(this);var href=$a.attr('href');var title=$a.attr('title');var o=$.meta?$.extend({},opts,$a.data()):opts;$a.parents(o.clickZone).hover(function(){$h=$(this);$h.addClass(o.hoverClass);if(typeof o.title!='undefined'&&o.title===true&&title!=''){$h.attr('title',title);}},function(){$h.removeClass(o.hoverClass);if(typeof o.title!='undefined'&&o.title===true&&title!=''){$h.removeAttr('title');}}).click(function(){if(getSelectedText()=="")
{if($a.is('[rel*=external]')){window.open(href);return false;}
else{window.location=href;}}});});};function debug($obj){if(window.console&&window.console.log)
window.console.log('bigTarget selection count: '+$obj.size());};function getSelectedText(){if(window.getSelection){return window.getSelection().toString();}
else if(document.getSelection){return document.getSelection();}
else if(document.selection){return document.selection.createRange().text;}};$.fn.bigTarget.defaults={hoverClass:'hover',clickZone:'li:eq(0)',title:true};})(jQuery);
