$(function ()
{
	$('#txt_pin').val('Enter your pin...').focus(function()
	{
		$(this).addClass('focus');
		var txt = $(this).val();
		txt = jQuery.trim(txt);
		var newTxt = (txt == 'Enter your pin...') ? '' : txt;
		$(this).val(newTxt);
	}).blur(function()
	{
		$(this).removeClass('focus');
		var txt = $(this).val();
		txt = jQuery.trim(txt);
		var newTxt = (txt == '') ? 'Enter your pin...' : txt;
		$(this).val(newTxt);
	}).prev('label').hide();
	
	// Scroll nav
	$('#scrollNav a').click(function(e)
	{
		e.preventDefault();
	});
	
	// Home page tabs
	$('#home-search .ui-tabs-panel').hide();
	$('#tab-unlimited').addClass('activeContainer').show();	
	$('#home-search-tabs a').bind('click',switchTab);
});

function switchTab(e)
{
	e.preventDefault();
	if($('#home-search-tabs').hasClass('busy')) return;
	var container = $(this).attr('href');
	$('#home-search-tabs li').removeClass('ui-tabs-selected');
	$(this).parent().addClass('ui-tabs-selected');
	$('#home-search-tabs').addClass('busy');
	$('#home-search .activeContainer').hide('slide', { direction: 'left',easing:'easeInExpo' }, 400,function()
	{
		$(container).show('slide', { direction: 'right',easing:'easeOutExpo' }, 800).addClass('activeContainer');
		$('#home-search-tabs').removeClass('busy');
	}).removeClass('activeContainer');
}

$(document).ready(function() {

// choose text for the show/hide link - can contain HTML (e.g. an image)
var showText='(Show/Hide)';
var hideText='(Show/Hide)';

// append show/hide links to the element directly preceding the element with a class of "toggle"
$('.toggle').prev().append(' <a href="#" class="toggleLink">'+ showText +'</a>');

// hide all of the elements with a class of 'toggle'
//$('.toggle').hide();//

// capture clicks on the toggle links
$('a.toggleLink').click(function() {

// change the link depending on whether the element is shown or hidden
$(this).html ($(this).html()==hideText ? showText : hideText);

// toggle the display - uncomment the next line for a basic "accordion" style
//$('.toggle').hide();$('a.toggleLink').html(showText);
$(this).parent().next('.toggle').toggle('slow');

// return false so any link destination is not followed
return false;

});
});
