//IBB Solicitors JavaScript Functions File
//-------------------------------------------
//Created by MintTwist Ltd 
//Created: 10/05/2010
//-------------------------------------------
//Last Edited: 15:58
//Last Edited by: Andre Figueira
//-------------------------------------------

function RemoveText(InputID){
	
	var Input = document.getElementById(InputID);
	Input.value = '';
	
}

function CheckText(InputID){
	
	var Input = document.getElementById(InputID);
	
	if(Input.value == ''){
		
		Input.value = Input.getAttribute('title');
		
	}
	
}

function GoTo(Type){
	
	window.location.href = "/"+Type+"/"+document.getElementById('ddlSort').value;
	
}

function GoToSub(Type){
	if(document.getElementById('ddlSubSort').value != "-1")
	{
		window.location.href = "/"+Type+"/"+document.getElementById('ddlSubSort').value;
	}
	else
	{
		window.location.href = "/"+Type;
	}	
}

function GoToURL(){
	
	window.location.href = document.getElementById('ddlLooking').value;
	
}

//Home Page Banner

function slideSwitch()
{
	var $active = $('#banner-imgs IMG.active, #banner-titles p.active');
	
	if ( $active.length == 0 ) $active = $('#banner-imgs IMG:last, #banner-titles p:last');
	
	var $next = $active.next().length ? $active.next()
		: $('#banner-imgs IMG:first, #banner-titles p:first');
	
	$active.addClass('last-active');
	
	$next.css({opacity: 0.0}).addClass('active').animate({opacity: 1.0}, 600, function()
	{
		$active.removeClass('active last-active');
	});
}

$(function()
{
	setInterval( "slideSwitch()", 5500 );
});

$(document).ready(function(){
	
	$(".see-more-block-button").click(function() {
		
		hiddenID = $(this).attr("rel");
		
		$("."+hiddenID).slideToggle();
	});

});	


	
