document.write('<scri'+'pt src="/includes/jquery.selectBox.js" type="text/javascript"></sc'+'ript>');
document.write('<scri'+'pt src="/includes/validation.js" type="text/javascript"></sc'+'ript>');
document.write('<scri'+'pt src="/includes/tweet/jquery.tweet.js" type="text/javascript"></sc'+'ript>');
// JavaScript Document
$(document).ready(function(){
	$("input[default], textarea[default]").each(function(){
		var holder = $(this).attr("default");
		$(this).removeAttr("default");
		if($(this).val() == ''){ $(this).val(holder); }
		$(this)
		.focus(function(){
			if($(this).val() == holder){
				$(this).val('');
			}
		})
		.blur(function(){
			if($(this).val() == '' || $(this).val() == ' '){
				$(this).val(holder);
			}
		});
	});
});


testimonials = new Array();
testimonials[0] = new Array("<p><b><i>\"I have thoroughly enjoyed this visit and the overall experience.\"</i></b></p>");
testimonials[1] = new Array("<p><b><i>\"What I also like about Bodyfit NT is the team that Kia has recruited. They are always full of smiles and friendly and nothing is too much trouble for them.\"</i></b></p>");
testimonials[2] = new Array("<p><b><i>\"There is nothing like hitting the treadmill at 6am and looking out across the waterfront to see pods of dolphins playing in the water.\"</i></b></p>");
testimonials[3] = new Array("<p><b><i>\"I can see this is the start of a long-term relationship!</i></b></p>");
testimonials[4] = new Array("<p><b><i>\"We know of no single intervention with greater promise than physical exercise to reduce the risk of virtually all chronic diseases simultaneously\" Booth et al</i></b></p>");
var i = 0;
$(document).ready(function() {
						   
	setInterval(function() {
						 i++;
				    if (i>=testimonials.length) { i=0;}
					$("#text_banner").fadeOut('slow',function() {
					$("#text_banner").html(testimonials[i][0]);
					//$("#text_banner").html('<span id="quote"><h3>'+testimonials[i][0]+'</h3><p>'+testimonials[i][1]+'</p></span>');
					//if (i>0) {$("#quote").prepend('<img src="/Images/quote_open.png"/>');}
					//if (i>0) {$("#quote").append('<img src="/Images/quote_close.png"/>');}
					$("#text_banner").fadeIn('slow');
													  });
	},3000);
});


$(document).ready(function(){
        $(".tweet").tweet({
            username: "Bodyfitnt",
            join_text: "auto",
            //avatar_size: 32,
            count: 2,
            auto_join_text_default: "we said,",
            auto_join_text_ed: "we",
            auto_join_text_ing: "we were",
            auto_join_text_reply: "we replied to",
            auto_join_text_url: "we were checking out",
            loading_text: "loading tweets...",
			template: "{text}<br/>{time} | <a href='{reply_url}'>reply</a> | <a href='{retweet_url}'>retweet</a> "
        });
 });


$(document).ready(function() {
 // $("select.fixed_width").sb({ fixedWidth:true });
 
 //
// Enable selectBox control and bind events
//
$("#create").click( function() {
$("SELECT").selectBox();
});
$("#destroy").click( function() {
$("SELECT").selectBox('destroy');
});
$("#enable").click( function() {
$("SELECT").selectBox('enable');
});
$("#disable").click( function() {
$("SELECT").selectBox('disable');
});
$("#serialize").click( function() {
//$("#console").append('<br />-- Serialized data --<br />' + $("FORM").serialize().replace(/&/g, '<br />') + '<br /><br />');
//$("#console")[0].scrollTop = $("#console")[0].scrollHeight;
});
$("#value-1").click( function() {
$("SELECT").selectBox('value', 1);
});
$("#value-2").click( function() {
$("SELECT").selectBox('value', 2);
});
$("#value-2-4").click( function() {
$("SELECT").selectBox('value', [2, 4]);
});
$("#options").click( function() {
$("SELECT").selectBox('options', {
'Opt Group 1': {
'1': 'Value 1',
'2': 'Value 2',
'3': 'Value 3',
'4': 'Value 4',
'5': 'Value 5'
},
'Opt Group 2': {
'6': 'Value 6',
'7': 'Value 7',
'8': 'Value 8',
'9': 'Value 9',
'10': 'Value 10'
},
'Opt Group 3': {
'11': 'Value 11',
'12': 'Value 12',
'13': 'Value 13',
'14': 'Value 14',
'15': 'Value 15'
}
});
});
$("#default").click( function() {
$("SELECT").selectBox('settings', {
'menuTransition': 'default',
'menuSpeed' : 0
});
});
$("#fade").click( function() {
$("SELECT").selectBox('settings', {
'menuTransition': 'fade',
'menuSpeed' : 'fast'
});
});
$("#slide").click( function() {
$("SELECT").selectBox('settings', {
'menuTransition': 'slide',
'menuSpeed' : 'fast'
});
});
$("SELECT")
.selectBox()
.focus( function() {
//$("#console").append('Focus on ' + $(this).attr('name') + '<br />');
//$("#console")[0].scrollTop = $("#console")[0].scrollHeight;
})
.blur( function() {
//$("#console").append('Blur on ' + $(this).attr('name') + '<br />');
//$("#console")[0].scrollTop = $("#console")[0].scrollHeight;
})
.change( function() {
//$("#console").append('Change on ' + $(this).attr('name') + ': ' + $(this).val() + '<br />');
//$("#console")[0].scrollTop = $("#console")[0].scrollHeight;
});


});


$(function() {
	$(".hover")
						   .mouseover(function() {
											   		var src = $(this).attr("src");
													var parts = src.split(".");
													var hover_src = parts[0]+"_hover."+parts[1];
													$(this).attr("src",hover_src);	 
							})
						   .mouseout(function() {
											  
									
											   		var hover_src = $(this).attr("src");
											  		var re = new RegExp(/_hover/);
													src = hover_src.replace(re,"");
													$(this).attr("src",src)	; 
						   });
})
//$(document).ready(function() {
//						   $(".banner_rotator").innerfade({speed : 'slow', timeout : '5000'});
//						   });

