/*
 * label2value
 * jquery based script for using form labels as text field values
 * more info on http://cssglobe.com/post/1500/using-labels- 
 *
 * Copyright (c) 2008 Alen Grakalic (cssglobe.com)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 */

this.label2value = function(){	

	// CSS class names
	// put any class name you want
	// define this in external css (example provided)
	var inactive = "inactive";
	var active = "active";
	var focused = "focused";
	
	// function
	$("label").each(function(){		
		obj = document.getElementById($(this).attr("for"));
		if(($(obj).attr("type") == "text") || (obj.tagName.toLowerCase() == "textarea")){			
			$(obj).addClass(inactive);			
			var text = $(this).text();
			$(this).css("display","none");			
			$(obj).val(text);
			$(obj).focus(function(){	
				$(this).addClass(focused);
				$(this).removeClass(inactive);
				$(this).removeClass(active);								  
				if($(this).val() == text) $(this).val("");
			});	
			$(obj).blur(function(){	
				$(this).removeClass(focused);													 
				if($(this).val() == "") {
					$(this).val(text);
					$(this).addClass(inactive);
				} else {
					$(this).addClass(active);		
				};				
			});				
		};	
	});		
};
// on load
$(document).ready(function(){	
	label2value();	
});

$(document).ready(function() {
		$("a#fancy1").fancybox({ 'centerOnScroll' : true, 'padding' : 20, 'overlayOpacity' : '0.8', 'overlayColor' : '#000000', 'padding' : '0', 'onComplete' : applySifr
});
	$("a#fancy2").fancybox({ 'centerOnScroll' : true, 'padding' : 20, 'overlayOpacity' : '0.8', 'overlayColor' : '#000000', 'padding' : '0', 'onComplete' : applySifr
});
	$("a#fancy3").fancybox({ 'centerOnScroll' : true, 'padding' : 20, 'overlayOpacity' : '0.8', 'overlayColor' : '#000000', 'padding' : '0', 'onComplete' : applySifr
});

$(".fancybox").fancybox({ 'centerOnScroll' : true, 'padding' : 20, 'overlayOpacity' : '0.8', 'overlayColor' : '#000000', 'padding' : '0', 'onComplete' : applySifr
});

function applySifr(){
	 sIFR.replace(futura, {
	     selector: '.fancy-header'
	     ,css: [
	       '.sIFR-root { font-size:36px; color:#ffffff; text-transform:uppercase; }',	
	 		'.sIFR-root a:link { color:#999999; text-decoration:none;}',
	 		'.sIFR-root a:hover{ color:#999999; text-decoration:underline;}',
	 		'.sIFR-root a:active { color:#999999; text-decoration:none;}'
	     ]
	 	 
	 	,tuneHeight : -5
	 	,tuneWidth : 2
	 	,fitExactly: true
	 	,forceSingleLine: true
	 	,wmode: 'transparent'
	 });
	 }

	
});

$(document).ready(function() {
    $('#flash_int .accomodations').cycle({
		fx: 'fade',
		timeout:         4000,  // milliseconds between slide transitions (0 to disable auto advance) 
		timeoutFn:       null,  // callback for determining per-slide timeout value:  function(currSlideElement, nextSlideElement, options, forwardFlag) 
		continuous:      0,     // true to start next transition immediately after current one completes 
		speed:           2500,  // speed of the transition (any valid fx speed value)
		fit: 			 1
	});
});

$(function () {
    var tabContainers = $('div.tabs > div');
    
    $('div.tabs ul.tabNavigation a').click(function () {
        tabContainers.hide().filter(this.hash).show();
        
        $('div.tabs ul.tabNavigation a').removeClass('selected');
        $(this).addClass('selected');

        return false;
    }).filter(':first').click();
});

