// STANDARD.JS


function init(){
	loadTextShadows();	
	
	
	if($('GoogleMap')){
		
		var myLatLng = new google.maps.LatLng(55.947001,-3.212686);
		var myOptions = {
			zoom: 14,
		   	center: new google.maps.LatLng(55.9525,-3.195),
	    	disableDefaultUI: true,
			panControl : true,
			zoomControl : true,
			scaleControl: true,
  		  	mapTypeId: google.maps.MapTypeId.HYBRID
		};
		var map = new google.maps.Map(document.getElementById("GoogleMap"), myOptions);

		marker = new google.maps.Marker({
			map:map,
			draggable:false,
			animation: google.maps.Animation.DROP,
			position: new google.maps.LatLng(55.947001,-3.212686),
			title : 'Optima Partners'
		});
		
		contentString = new String();
		contentString += '<table cellpadding=\"2\" cellspacing=\"2\" border=\"0\">';
		contentString += '<tr>';
		contentString += '<td><img height=\"84\" width=\"72\" title=\"Optima Partners\" alt=\"Optima Partners\" src=\"png/footer-logo.png\" align=\"left\" hspace=\"5\"></td>';
		contentString += '<td>';
		contentString += '<span class=\"infoWindowHTML\">';
		contentString += '<strong>Optima Partners</strong><br />';
		contentString += '14 Torphichen Street<br />';
		contentString += 'Edinburgh<br />';
		contentString += 'EH3 8JB<br />';
		contentString += 't:<strong>0131 272 2704</strong>';
		contentString += '</span>';			
		contentString += '</td>';
		contentString += '</tr>';
		contentString += '</table>';
		
		
		
		
		
		var infowindow = new google.maps.InfoWindow({
		    content: contentString
		});

		
		
		google.maps.event.addListener(marker, 'click', function() {
		  infowindow.open(map,marker);
		});
		
		 google.maps.event.addListenerOnce(map, 'idle', function(){
		   infowindow.open(map,marker);
		 });

		
//		google.maps.infowindow.open(map,marker);


		//55.947001,-3.212686
	}
}


//*************************
//loadTextShadows()
function loadTextShadows(){
	applyShortButtonShadows();
	applySpeachBubbleShadows();
	applyLongButtonShadows();
	applyShortButtonObservations();
}
//*************************

//*************************
//applySpeachBubbleShadows()
function applySpeachBubbleShadows(){
	//submenu shadows
	$$('.speachBubble .shadow').each(function(item){
	
		//create the clone
		shadow = item.cloneNode(true);
		shadow.setStyle({color:'#000'});
		
		//move it into place
		Element.insert($(item),{'after':shadow});
		
		//move it to the same position
		$(shadow).setStyle({
			marginTop:'-' + (item.getDimensions().height+1) + 'px',
			marginLeft : $(shadow).style.marginLeft - 1 + 'px'
		});
		
		item.setStyle({color:'#FFF'});
	});
}
//*************************

//*************************
//applyLongButtonShadows()
function applyLongButtonShadows(){
	//submenu shadows
	$$('.longButton .shadow').each(function(item){
	
		//create the clone
		shadow = item.cloneNode(true);
		shadow.setStyle({color:'#FFF'});
		
		//move it into place
		Element.insert($(item),{'after':shadow});
		
		//move it to the same position
		$(shadow).setStyle({
			marginTop:'-' + (item.getDimensions().height+1) + 'px',
			marginLeft : $(shadow).style.marginLeft - 1 + 'px'
		});
		
		item.setStyle({color:'#444'});
	});
}
//*************************

//*************************
//applyShortButtonShadows()
function applyShortButtonShadows(){
	//submenu shadows
	$$('.shortButton .shadow').each(function(item){
	
		//create the clone
		shadow = item.cloneNode(true);
		shadow.setStyle({color:'#FFF'});
		
		//move it into place
		Element.insert($(item),{'after':shadow});
		
		//move it to the same position
		$(shadow).setStyle({
			marginTop:'-' + (item.getDimensions().height+1) + 'px',
			marginLeft : $(shadow).style.marginLeft - 1 + 'px'
		});
		
		item.setStyle({color:'#444'});
	});
}
//*************************


//*************************
//applyShortButtonObservations()
function applyShortButtonObservations(){
	$$('.shortButton').each(function(item){
		$(item).observe('mouseover',function(){
			this.className = 'shortButton shortButtonOver';								 
		});									 
		$(item).observe('mouseout',function(){
			this.className = 'shortButton shortButtonUp';								 
		});									 		
		$(item).observe('mousedown',function(){
			this.className = 'shortButton shortButtonDown';								 
		});									 
	});
}
//*************************
