
$(function() {
    swapValues = [];
    $(".swap_value").each(function(i){
        swapValues[i] = $(this).val();
        $(this).focus(function(){
            if ($(this).val() == swapValues[i]) {
                $(this).val("");
            }
        }).blur(function(){
            if ($.trim($(this).val()) == "") {
                $(this).val(swapValues[i]);
            }
        });
    });
});

// JavaScript Code to show or hide flash content.

function showlayer(layer){
var myLayer = document.getElementById(layer).style.display;
if(myLayer=="none"){
	document.getElementById(layer).style.display="block";
	} else {
	document.getElementById(layer).style.display="none";
	}
}
	


// FaceBox initialization

	jQuery(document).ready(function($) {
      $('a[rel*=facebox]').facebox({
        loading_image : '../img/loading.gif',
        close_image   : '../img/closelabel.gif'
      }) 
    })

	
	
	
var headline_count;
var headline_interval;
var old_headline = 0;
var current_headline=0;

$(document).ready(function(){
  headline_count = $("li.headline").size();
  $("li.headline:eq("+current_headline+")").css('top','5px');
  
  headline_interval = setInterval(headline_rotate,6000); //time in milliseconds
  $('#scrollup').hover(function() {
    clearInterval(headline_interval);
  }, function() {
    headline_interval = setInterval(headline_rotate,6000); //time in milliseconds
    headline_rotate();
  });
});

function headline_rotate() {
  current_headline = (old_headline + 1) % headline_count; //remainder will always equal old_headline until it reaches headline_count - at which point it becomes zero. clock arithmetic
  $("li.headline:eq(" + old_headline + ")").animate({top: -205},"slow", function() {
    $(this).css('top','210px');
    });
  $("li.headline:eq(" + current_headline + ")").show().animate({top: 5},"slow");  
  old_headline = current_headline;
}








