jQuery(document).ready(function() {
	 //if(navigator.userAgent.indexOf('Mac') != -1 && navigator.userAgent.indexOf('Firefox')!=-1 || navigator.userAgent.indexOf('MSIE')!=-1) {
	 //	 jQuery("#nav .main-menu").css("width","16.51%");
     //}
	
	if (jQuery('#map_canvas').length > 0) {
		//var latlng = new google.maps.LatLng(38.708461, -9.147406);
		var latlng = new google.maps.LatLng(38.721487, -9.152352);		 
		var myOptions = {
		  zoom: 16,
		  center: latlng,
		  panControl: false,
		  zoomControl: true,
		  zoomControlOptions: {
			    style: google.maps.ZoomControlStyle.SMALL,
			    position: google.maps.ControlPosition.TOP_LEFT
			  },
		  mapTypeControl: false,
		  scaleControl: false,
		  streetViewControl: false,
		  mapTypeId: google.maps.MapTypeId.ROADMAP
		};
		var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
		var image = 'http://odd-school.com/themes/beta/images/map_icon.png';

		/*
		var contentString = 
		'<div id="content">'+
		'<div id="siteNotice">'+
		'</div>'+
		'<h6>TITULO</h6>'+
		'<div>'+
		'<p style="color:black;font-family:'+'"Gotham Book"'+'">TEXTO<img src="http://localhost/cms/themes/beta/images/map_icon.png" /></p>'+
		'</div>'+
		'</div>';

		var infowindow = new google.maps.InfoWindow({
		    content: contentString
		});
		*/
		
		var marker = new google.maps.Marker({
		    position: latlng, 
		    map: map, 
		    title:"Odd Digital Entertainment School",
		    icon: image
		});   

		//google.maps.event.addListener(marker, 'click', function() {
		//  infowindow.open(map,marker);
		//});	
	}
			
	jQuery("#username").focus(function() {			
		onFocusHandler(this, "Username");				
	});

	jQuery("#username").blur(function() {
		onBlurHandler(this, "Username");
	});
			
	jQuery("#password").focus(function() {
		onFocusHandler(this, "Password");
	});

	jQuery("#password").blur(function() {
		onBlurHandler(this, "Password");
	});
	
	jQuery("a[rel='external']").attr('target', '_blank');

	jQuery("input[type='password']").attr('autocomplete', 'off');
	
	jQuery('.button').mouseover(function() {
		jQuery(this).stop().animate({boxShadow: '0 -1px 5px #b0c1c9'});
	});
	
	jQuery('.button').mouseout(function() {
		jQuery(this).stop().animate({boxShadow: '0 -1px 0px #3a3a3a'});
	});
		
	jQuery('.button a').focus(function() {
		jQuery(this).parent().stop().animate({boxShadow: '0 -1px 5px #b0c1c9'});
	});

	jQuery('.button a').blur(function() {
		jQuery(this).parent().stop().animate({boxShadow: '0 -1px 0px #3a3a3a'});
	});
	
	jQuery('#course-tab-button a').click(function(evt) {
		evt.preventDefault();
		if(jQuery('#course-panel-container').css('display') == 'none') {
			jQuery('#course-panel-container').slideToggle({duration: 500, easing: 'easeOutBack'});
		} else {
			jQuery('#course-panel-container').slideToggle({duration: 500, easing: 'easeInBack'});
		}
	});

	jQuery('body').removeClass('no-jQuery');
	jQuery('.social-icons a').addClass('jq-fader');
	jQuery('#partnerships td a').addClass('jq-fader');
	
	jQuery('.jq-fader').css('opacity','0.7');
	
	jQuery('.jq-fader').mouseover(function(evt) {
		jQuery(this).stop().animate({opacity: '1'}, 500);
	});
	
	jQuery('.jq-fader').mouseout(function(evt) {
		jQuery(this).stop().animate({opacity: '0.7'}, 500);
	});	
});

function onBlurHandler(element, option) {
	var value = jQuery(element).attr('value');
	if (value == '') {
		jQuery(element).attr('value', option);
	}				
}

function onFocusHandler(element, option) {
	var value = jQuery(element).attr('value');
	if (value == option) {
		jQuery(element).attr('value', '');
	}			
}
