// 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);
			}
		});
	});
});*/
document.write('<scr'+'ipt type="text/javascript" src="/includes/validation.js"></scr'+'ipt>');
document.write('<scri'+'pt type="text/javascript" src="/includes/jquery.selectBox.js"></sc'+'ript>');
document.write('<scri'+'pt type="text/javascript" src="/includes/jquery.crossSlide.js"></sc'+'ript>');

$(document).ready(function() {
 // $("select.fixed_width").sb({ fixedWidth:true });
 
 //
// Enable selectBox control and bind events
//
$("#create").click( function() {
$(".selectBox").selectBox();
});
$("#destroy").click( function() {
$(".selectBox").selectBox('destroy');
});
$("#enable").click( function() {
$(".selectBox").selectBox('enable');
});
$("#disable").click( function() {
$(".selectBox").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() {
$(".selectBox").selectBox('value', 1);
});
$("#value-2").click( function() {
$(".selectBox").selectBox('value', 2);
});
$("#value-2-4").click( function() {
$(".selectBox").selectBox('value', [2, 4]);
});
$("#options").click( function() {
$(".selectBox").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() {
$(".selectBox").selectBox('settings', {
'menuTransition': 'default',
'menuSpeed' : 0
});
});
$("#fade").click( function() {
$(".selectBox").selectBox('settings', {
'menuTransition': 'fade',
'menuSpeed' : 'fast'
});
});
$("#slide").click( function() {
$(".selectBox").selectBox('settings', {
'menuTransition': 'slide',
'menuSpeed' : 'fast'
});
});
if($(".selectBox").length != 0){
	$(".selectBox").selectBox();
}


});


// initialise the partners animation
// this first line is for pre 1.4 jQuery
// this is being called now via home_top.php
//$.isEmptyObject = function(obj) { for (var name in obj) return false; return true; };
//$(document).ready(function() {
//	if ($("#placeholder").length > 0) {				   
//		$('#placeholder').crossSlide({
/// 			sleep: 3,
//			fade: 1
//		}, [
//  			{ src: '/partners/fitnessaustralia.png', href: '/partners/fitness_australia' },
//  			{ src: '/partners/kinect.png', href: '/partners/kinect'   }
//		]);
//	}
//})


//$(document).ready(function() {
//	if($("#placeholder").length != 0){
//	$("#placeholder").innerfade({			   
//			animationtype: 'fade',
//			speed: 'slow',
//			timeout: 4000,
//			type: 'sequence',
//			containerheight: '65px'			   
//	})
//	}
//});

// button hovers
$(function() {
						   $("#enquire_location")
						   .mouseover(function() {
													$("#enquire_location").attr("src","/Images/btn_enquire_location_hover.png");	 
																  })
						   .mouseout(function() {
													$("#enquire_location").attr("src","/Images/btn_enquire_location.png")	; 
																  });
						   
						   $(".btn_learn_more")
						   .mouseover(function() {
													$(this).attr("src","/Images/btn_learn_more_hover.png");	 
																  })
						   .mouseout(function() {
													$(this).attr("src","/Images/btn_learn_more.png")	; 
																  });
						   $(".btn_buy_now")
						   .mouseover(function() {
													$(this).attr("src","/Images/btn_buynow_hover.png");	 
																  })
						   .mouseout(function() {
													$(this).attr("src","/Images/btn_buynow.png")	; 
																  });
						   
						   $(".btn_buy_ticket")
						   .mouseover(function() {
													$(this).attr("src","/Images/btn_buy_ticket_hover.png");	 
																  })
						   .mouseout(function() {
													$(this).attr("src","/Images/btn_buy_ticket.png")	; 
																  });
						   
						   $(".btn_register_interest")
						   .mouseover(function() {
													$(this).attr("src","/Images/btn_register_interest_hover.png");	 
																  })
						   .mouseout(function() {
													$(this).attr("src","/Images/btn_register_interest.png")	; 
																  });
						   $(".btn_view")
						   .mouseover(function() {
													$(this).attr("src","/Images/btn_view_hover.png");	 
																  })
						   .mouseout(function() {
													$(this).attr("src","/Images/btn_view.png")	; 
																  });
});

$(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)	; 
						   });
});

function scrolldown() {
		$('html,body').animate({scrollTop: 1000}, 1000);
}

