/**
*	(c) 2010 Thomas Klokosch <thomas.klokosch@me.com>
*/

$(document).ready(function(){

	if($("#searchword").val() == ''){
		$("#searchword").defaultvalue($("#searchwordlabel").html());		
	}
	$("#searchwordlabel").hide();
	$("#searchbutton").click(function(){
		if($("#searchword").val() == $("#searchwordlabel").html()){
			$("#searchform").effect("shake", { times: 2 }, 120);
			return false;
		}
	});
	
	$('a').click(function() { this.blur(); });

	$(document).ready(function(){
	  // Reset Font Size
	  var originalFontSize = $('html').css('font-size');
	  $(".resetFont").click(function(){
	  $('html').css('font-size', originalFontSize);
	  });
	  // Increase Font Size
	  $(".increaseFont").click(function(){
	  	var currentFontSize = $('html').css('font-size');
	 	var currentFontSizeNum = parseFloat(currentFontSize, 10);
	    var newFontSize = currentFontSizeNum*1.2;
		$('html').css('font-size', newFontSize);
		return false;
	  });
	  // Decrease Font Size
	  $(".decreaseFont").click(function(){
	  	var currentFontSize = $('html').css('font-size');
	 	var currentFontSizeNum = parseFloat(currentFontSize, 10);
	    var newFontSize = currentFontSizeNum*0.8;
		$('html').css('font-size', newFontSize);
		return false;
	  });
	});
	
	if ( typeof GBrowserIsCompatible == 'undefined' ) {
	     alert('Google Maps api is not loaded');
	     return;
	} else {
		//alert($(".map").attr("rel"));
		$(".locationPin").locationPopup();
	}
	
	$(".gallery").scrollable({size: 1, loop: true});
	
});
