// JavaScript Document

$(document).ready(function() {
	//rounded corners:
	$('.sideasset, #featured').each(function() {
		$(this).corner("round 12px", "#000");
	});	
	
	//navigation trick:
	$('.current_page').parent().css("display", "block");
	/*
		-----------------
		- quotes -
		-----------------
	*/	
	/*if ( document.getElementById("featured") ) {
		var divs = $('#featured div');
		var randomStartNumber = Math.floor(Math.random()*divs.length);
		var cur = randomStartNumber;
		cur_plus_one = cur+1;//for display purposes
		divs[cur].style.display = "block";		
		$('#featured').append('<ul class="options"><li><a href="./" class="prevfeature">&laquo; Prev</a> |</li> <li class="paging">'+cur_plus_one+' of '+divs.length+'</li> <li>| <a href="./" class="nextfeature">Next &raquo;</a></li></ul>');

	}
	

	
	$('#featured .options a').click(function() {
		var no_of_divs = $("#featured div").length;
		//alert(no_of_divs);

		if (this.className == 'nextfeature') {
			if (cur == no_of_divs-1) {
				cur = 0;
				$('#featured .options .paging').html('1 of '+divs.length)
			}
	
			else {
				cur++;
				cur_plus_one = cur+1;
				$('#featured .options .paging').html(cur_plus_one+ ' of ' + divs.length)
			}
		}
		else {//previous button
			if (cur == 0) {
				cur = no_of_divs-1;
				$('#featured .options .paging').html(no_of_divs +' of '+divs.length)
			}
	
			else {
				cur--;
				cur_plus_one = cur+1;
				$('#featured .options .paging').html(cur_plus_one+ ' of ' + divs.length)
			}		
		}
		$("#featured div").css("display", "none");
		divs[cur].style.display = "block";
		

		

		
		
		$('#full_info').attr("href", newUrl);

		return false;	
	});*/
});

	//gmaps 
    function load() {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map"));
        map.setCenter(new GLatLng(51.452742, -1.149981), 11);
									// changed from 51.43xxx to move the marker lower (was overlapping "map satellite hybrid"	
      }
	var icon = new GIcon();
    icon.image = "http://labs.google.com/ridefinder/images/mm_20_red.png";
    icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
	icon.iconSize = new GSize(10, 16);
	icon.shadowSize = new GSize(22, 20);
	icon.iconAnchor = new GPoint(6, 20);
	icon.infoWindowAnchor = new GPoint(5, 1);	
	map.addControl(new GSmallMapControl());
	map.addControl(new GMapTypeControl());
	var point0 = new GPoint(51.432742, -1.149981);
	var marker0 = new GMarker(point0);
	map.addOverlay(marker0) 

    // Creates one of our tiny markers at the given point
    function createMarker(point) {
      var marker = new GMarker(point, icon);
      map.addOverlay(marker);
    marker.openInfoWindowHtml("The Village Montessori Nursery School<br>Cock Lane, Bradfield Southend <br> Reading RG7 6HW");
      GEvent.addListener(marker, "click", function() {
        marker.openInfoWindowHtml("The Village Montessori Nursery School<br>Cock Lane, Bradfield Southend <br> Reading RG7 6HW");
      });
    }



    createMarker(new GPoint(-1.149981, 51.432742));

    }