$(document).ready(function(){
	
	//news sliding...
	$('div.items').cycle({ 
    fx:     'scrollHorz', 
    prev:   '#prev', 
    next:   '#next',
    timeout: 4000 ,
    speed:   800 
	});
	
	// swap text box
	var swap_text_boxes = [];
	
	function init_swap_text_boxes(){
	  //Store the default value for each box
	  $('input[type=text][value].swaptextbox').each(function() {
		swap_text_boxes[$(this).attr('id')] = $(this).attr('value');
	  });
	  //Add focus and blur events to set or clear the value
	  $('input[type=text][value].swaptextbox').bind('focus', function() {
		if($(this).val() == swap_text_boxes[$(this).attr('id')]) {
		  $(this).val('');
		}
	  });
	  $('input[type=text][value].swaptextbox').bind('blur', function() {
		if($(this).val() == '') {
		  $(this).val(swap_text_boxes[$(this).attr('id')]);
		}
	  });
	}	
	
	init_swap_text_boxes();

	//fancybox
	$("a.fancybox").fancybox({
		'overlayOpacity': .8,
		'zoomSpeedIn'	: 1000,
		'zoomSpeedOut'	: 900,
		'easingIn'		: 'easeOutBack',
		'easingOut'		: 'easeInBack',
		'hideOnContentClick' : false,
		'frameWidth' : 800,
		'frameHeight' : 600,
		'centerOnScroll' : true

	});

});