function loadYouTubePlayer(divName,video,width,height)
{
	$(document).ready(function() {
			$(divName).tubeplayer({
				  width: width, // the width of the player
			      height: height, // the height of the player
				  autoPlay:true,
				  wmode: "transparent",
				  allowFullScreen: "true", // true by default, allow user to go full screen
				  initialVideo: video, // the video that is loaded into the player
				  preferredQuality: "hd720"// preferred quality: default, small, medium, large, hd720
			});
	});
	
}

function bounced(){
     $('#footerblock_1').effect("bounce", { times:3 }, 300);
}

function search_calendar(){

	if ($('#frmSearchArea').val() == 3) {
			$('#td1').css({display:'' });
			$('#td2').css({display:'' });		
			$('#td3').css({display:'' });
			$('#td4').css({display:'' });	
	}
	else{
		$('#td1').css({display:'none' });
		$('#td2').css({display:'none' });	
		$('#td3').css({display:'none' });	
		$('#td4').css({display:'none' });	


	}
	
}

function showprintdialog(printurl)
{
 window.open (printurl, "mywindow","status=0,toolbar=1,location=0,menubar=0,directories=0,resizable=1,scrollbars=1,width=1000,height=600");
}


function initialize() {
 	 var myLatlng = new google.maps.LatLng(55.945022,-3.043623);
	 var myLatlng2 = new google.maps.LatLng(55.9441606,-3.055064);
	 
  	
  	
  	if (document.getElementById("map_canvas") != null)
  	{	
	
 	 var myOptions = {
    	zoom: 11,
    	center: myLatlng,
    	mapTypeId: google.maps.MapTypeId.ROADMAP
  	}
	
	
	
  	 var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
    var marker1 = new google.maps.Marker({position:myLatlng,map:map});
	var marker2 = new google.maps.Marker({position:myLatlng2,map:map});
	

	
  	
   }
   
   
  	if (document.getElementById("map_canvas1") != null)
  	{	
	
	
		
 	 var myOptions = {
    	zoom: 11,
    	center: myLatlng,
    	mapTypeId: google.maps.MapTypeId.ROADMAP
  	}
	
   var map = new google.maps.Map(document.getElementById("map_canvas1"), myOptions);
   var  marker2 = new google.maps.Marker({position:myLatlng,map:map});
   
   
   	var contentString = '<div style="width:400px;height:80px;overflow:hidden;">'+
    		'<table cellpadding="0" cellspacing="0" style="padding:0;margin:0"><tr><td valign="top"><strong>Loretto Senior School and Loretto Golf Academy </strong><br />Linkfield Road, Musselburgh, East Lothian <br />EH21 7RE,Scotland, UK <br />Enquiries +44(0)131 653 4444<br />Admissions +44(0)131 653 4455<br />' +
   		'</td></tr></table>'+
   		'</div>';

		var infowindow = new google.maps.InfoWindow({
    			content: contentString,
			MaxWidth:300
		});

		google.maps.event.addListener(marker2, 'click', function() {
  			infowindow.open(map,marker2);
		});
	
   
      var  marker31 = new google.maps.Marker({position:myLatlng2,map:map});
   
   
   	var contentString3 = '<div style="width:400px;height:80px;overflow:hidden;">'+
    		'<table cellpadding="0" cellspacing="0" style="padding:0;margin:0"><tr><td valign="top"><strong>Loretto Junior School</strong><br />North Esk Lodge, North High Street, Musselburgh, East Lothian <br />EH21 6JA, Scotland, UK <br />Enquiries +44(0)131 653 4570<br />Admissions +44(0)131 653 4455' +
   		'</td></tr></table>'+
   		'</div>';

		var infowindowNew = new google.maps.InfoWindow({
    			content: contentString3,
			MaxWidth:300
		});

		google.maps.event.addListener(marker31, 'click', function() {
  			infowindowNew.open(map,marker31);
		});
  	
   }
      
 
   
	
}
  
function loadScript() {
 var script = document.createElement("script");
  
  
  script.type = "text/javascript";
  script.src = "http://maps.google.com/maps/api/js?sensor=false&callback=initialize";
  document.body.appendChild(script);
}


 
 function highlitetopmenu(contentid){
		
		var valuelist = contentid.split(',');
		
		
		for(i=0; i<= valuelist.length; i++ ){
			menuName = '#nav_holder_' + valuelist[i];
			
			if($(menuName).length){
				$('.nav_holder_on').removeClass('nav_holder_on').addClass('nav_holder');
				$(menuName).removeClass('nav_holder').addClass('nav_holder_on');
			}
			
			hMenuName = '#innermenu_horizontal_1_' + valuelist[i];
			
			if($(hMenuName).length){
				$('.innermenu_horizontal_up').removeClass('innermenu_horizontal_up').addClass('innermenu_horizontal_1');
				$(hMenuName).removeClass('innermenu_horizontal_1').addClass('innermenu_horizontal_up');
			}
			
			
			vMenuName = '#vertmenu_1_' + valuelist[i];
	
			
			if($(vMenuName).length){
				$('.vertmenu_up').removeClass('vertmenu_up').addClass('vertmenu_1');
				$(vMenuName).removeClass('vertmenu_1').addClass('vertmenu_up');		
			}	
			
			
		}
		
				
 }
  


function forceLink(obj,srcpath,hoverstate)
{



 obj.style.background = "url("+srcpath+") no-repeat"; 

 
 if (hoverstate == 1)
 {
  obj.style.color = 'white';
 
 }
 else
 {
 obj.style.color = '#7B7B6A';
 
 }
 
}

function footerstrip(num){
	
	switch(num){
	
	 case 1:
	 	imageUrl  = '/images/footer/royal1.png';
	 	$('.footerstrips').css({
			'background-image':'url(' + imageUrl + ')',
			'background-repeat':'no-repeat',
			marginLeft: '570px'
		})
	 break;
	
	
	 case 2:
	 	imageUrl  = '/images/footer/scis.png';
	 	$('.footerstrips').css({
			'background-image':'url(' + imageUrl + ')',
			marginLeft: '620px'
		})
	 break;
	 
	 case 3:
	 	imageUrl  = '/images/footer/edinburgh.png';
	 	$('.footerstrips').css({
			'background-image':'url(' + imageUrl + ')',
			marginLeft: '680px'
		})
	 break;
	 
	 case 4:
	 	imageUrl  = '/images/footer/bsa.png';
	 	$('.footerstrips').css({
			'background-image':'url(' + imageUrl + ')',
			marginLeft: '730px'
		})
	 break;
	 
	 case 5:
	 	imageUrl  = '/images/footer/scottishgolf.png';
	 	$('.footerstrips').css({
			'background-image':'url(' + imageUrl + ')',
			marginLeft: '772px'
		})
	 break;
	 
	 case 6:
	 	imageUrl  = '/images/footer/steinway.png';
	 	$('.footerstrips').css({
			'background-image':'url(' + imageUrl + ')',
			marginLeft: '817px'
		})
	 break;
	 
	  case 7:
	 	imageUrl  = '/images/footer/alevelperform.png';
	 	$('.footerstrips').css({
			'background-image':'url(' + imageUrl + ')',
			marginLeft: '860px'
		})
	 break;
	 
	
	
	 case 10:
	 
		$('.footerstrips').css({
			'background-image':'none',
			marginLeft: '400px'
		})
	 break;
	 
	 
	 }
	 
	
}

