	$(window).load(function(){ 
	$('.inputrepeat, .searchin, textarea').focus(function() {
		if (this.value == this.title) {
			$(this).val("");
		}
	}).blur(function() {
		if (this.value == "") {
			$(this).val(this.title);
		}
	});	});

function theRotator() {
	//Set the opacity of all images to 0
	$('#rotator ul li').css({opacity: 0.0});
	//Get the first image and display it (gets set to full opacity)
	$('#rotator ul li:first').css({opacity: 1.0});
	//Call the rotator function to run the slideshow, 6000 = change to next image after 6 seconds
	setInterval('rotate()',6000);
}
function rotate() {	
	//Get the first image
	var current = ($('#rotator ul li.show')?  $('#rotator ul li.show') : $('#rotator ul li:first'));
	//Get next image, when it reaches the end, rotate it back to the first image
	var next = ((current.next().length) ? ((current.next().hasClass('show')) ? $('#rotator ul li:first') :current.next()) : $('#rotator ul li:first'));	
	//Set the fade in effect for the next image, the show class has higher z-index
	next.css({opacity: 0.0})
	.addClass('show')
	.animate({opacity: 1.0}, 1000);
	//Hide the current image
	current.animate({opacity: 0.0}, 1000)
	.removeClass('show');
};
$(document).ready(function() {		
	//Load the slideshow
	theRotator();
});

	function togglediv(id) {
		 hideAll();
		 document.getElementById(id).style.display='';
	}
	
	function hideAll()
	{
		var displayDivs = document.getElementsByTagName('div');
		for(var e=0; e<displayDivs.length; e++)
		{
			if(displayDivs[e].className=='status')
			{
				displayDivs[e].style.display='none';
			}
			if(displayDivs[e].className=='livechat')
			{
				var li = displayDivs[e].getElementsByTagName('a');
				for(var l=0; l<li.length; l++)
				{
					var cls = li[l].className.split(' ');
					li[l].className = cls[0];
				}
			}
		}
	}
	function defaultDisplay()
	{
		hideAll();
		document.getElementById('defaultContact').className = 'mobile active';
		document.getElementById('div1').style.display='';
	}

var previous_subdiv = document.getElementById('divsubtab1');
var previous_sublink =document.getElementById('asubtab1');
var previous_div = document.getElementById('tab1');
var previous_link = document.getElementById('atab1');

	function toggle(_this,temp_id) {
		if(previous_div != null)
		{
			previous_div.style.display = "none";
			previous_link.parentNode.className = '';
		}
	_this.parentNode.className = 'active';
	previous_link = _this;
	previous_div = document.getElementById(temp_id);
	previous_div.style.display = "block";
								
	previous_subdiv.style.display = "none";
	previous_sublink.parentNode.className = '';
	previous_sublink = null;
	previous_subdiv = null;
	toggleSub( previous_div.getElementsByTagName("a")[0]);
	}
	
	function toggleSub(_this) {
		var temp_id = _this.id.replace('a','div');
		if(previous_subdiv != null)
		{
			previous_subdiv.style.display = "none";
			previous_sublink.parentNode.className = '';
		}
	_this.parentNode.className = 'active';
	previous_sublink = _this;
	previous_subdiv = document.getElementById(temp_id);
	previous_subdiv.style.display = "block";
	}

	$("#quicklink").click(function () {
	  $(".quicklink").slideToggle("slow");
	  $("#quicklinkarrow").toggleClass("active");
	});

$(".exploremore, .exploremorebutton").click(function () {
	$(".loader").show();
	$(".flashbanner").show();
	$('.flashbanner').css({top:'50%',left:'50%',margin:'-'+($('.flashbanner').height() / 2)+'px 0 0 -'+($('.flashbanner').width() / 2)+'px'});
	//$('.flashbanner').css({left:'50%',margin:'-'+'0 0 0 -'+($('.flashbanner').width() / 2)+'px'});
});
$(".close").click(function(){
	$(".loader").hide();
	$(".flashbanner").hide();
});


