/*====
 * replace search box input with label text
 *================================================ */

/*
$(document).ready(function() {
	var searchLabel = $('#searchBox label').remove().text();
	if ($('#searchSite').val() == '') {
		$('#searchSite').addClass('placeholder').val(searchLabel).focus(function() {
			if (this.value == searchLabel) {
				$(this).removeClass('placeholder').val('');
			};
		}).blur(function() {
			if (this.value == '') {
				$(this).addClass('placeholder').val(searchLabel);
			};
		});
		$('#search form').submit(function() {
			if ($('#searchSite').val() == searchLabel) {
				$('#searchSite').val('');
			}
		});
	}
});
*/

/*====
 * popUp script
 *================================================ */
$(document).ready(function() {
	$('a.popup').click(function() {
		this.target = "_blank";
	});
});

/*====
 * dropdown code ( taken from http://test.learningjquery.com/scripts/dropdown.js)
 *================================================ */
/*
$(document).ready(function(){
  $('#topNav > ul > li').each(function(i) {
	var timeOut;
	if ($('> ul', this).size() > 0) {
	  $(this).hover(function(){
		clearTimeout(timeOut);
		$('#topNav > ul > li > ul').css('display','none');
		$('> ul', this).css('display','block');
		if ($.browser.msie) {
		  var $this_ul = $('> ul', this);
		  $this_ul.prepend("<iframe></iframe>");
		  $('iframe', this).height($this_ul.get(0).offsetHeight + 'px');
		};
	  },function(){  // on mouseOut
		var self = this;
		timeOut = setTimeout(function() {
		  $('> ul', self).css('display','none');
		  if ($.browser.msie) {
			$(self).find('iframe').remove();  
		  };
		},300);
	  });
	}
  });

  $('#topNav > ul > li ul > li').each(function(i) {
	var timeOutSub;
	if ($('> ul', this).size() > 0) {
	  $('> a', this).addClass('has-subnav');
	  $('> a.active', this).removeClass('has-subnav').addClass('active-has-subnav');

	  $(this).hover(function(){ //this part is for mouseOver
		clearTimeout(timeOutSub);
		$(this).parent().find('li:not(this) ul').css('display','none');
		$('> ul', this).css({display:'block',visibility:'visible'});
		if ($.browser.msie) {
		  var $this_ul = $('> ul', this);
		  $this_ul.prepend("<iframe></iframe>");
		  $('iframe', this).height($this_ul.get(0).offsetHeight + 'px');
		};
	  },function(){ // on mouseOut
		var self = this;
		timeOutSub = setTimeout(function() {
		  $('> ul', self).css({display:'none',visibility:'hidden'});
		  if ($.browser.msie) {
			$(self).find('iframe').remove();  
		  };
		},300); // end setTimeout
	  }); // end mouseOut
	} // end if
  }); // end .each
}); // end document ready
*/
/*
addLoadEvent(dropdown);
*/
addLoadEvent(autoCycleContent);