// JavaScript Document

$(document).ready(function() {
	$("#profiles").accordion({
		collapsible: true,
		autoHeight: false,
		active: false,
		animated: 'slide',
		clearStyle: true,
		header: "h3.header"
	});
	
$(".slider div").hide();
$(".slider.current div").show();

 
     $("#accordion .slider").hover(
	 
           function(){
                $(this).find("div").slideDown();
           },
          
           function(){
                $(this).find("div").slideUp();
           }
     );

	 
	
	 
	//Default Action
	$(".tabContent").hide(); //Hide all content
	$("ul.tabNav li:first").addClass("selected").show(); //Activate first tab 
	$(".tabContent:first").show(); //Show first tab content
		
	
	//On Click Event
	$("ul.tabNav li").click(function() {
		$("ul.tabNav li").removeClass("selected"); //Remove any "active" class
		$(this).addClass("selected"); //Add "active" class to selected tab
		$(".tabContent").hide(); //Hide all tab content
		var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active content
		return false;
	});
	
	var myLatlng = new google.maps.LatLng(52.4069,-1.5101);
    var myOptions = {
      zoom: 14,
      center: myLatlng,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    }
    var map = new google.maps.Map(document.getElementById("map"), myOptions);
	
	var contentString = '<div id="siteNotice">'+
    '</div>'+
    '<div id="bodyContent"><div>'+
    '<img src="../img/logo.jpg" alt="Newsome Vaughan" />'+
	'<p>Newsome Vaughan Solicitors LLP<br />'+
	'Greyfriars House<br />Greyfriars Lane<br />'+
	'Coventry<br /> CV1 2GW.</p>'+
    '</div></div>';
	
	var infowindow = new google.maps.InfoWindow({
		content: contentString 		
	});
	
    
    var marker = new google.maps.Marker({
        position: myLatlng, 
        map: map,
        title:"Newsome Vaughan LLP Solicitors"
    });   	
	
	google.maps.event.addListener(marker, 'click', function() {
		infowindow.open(map, marker);
	});
});
