

/*------------Global Script-------------*/


$(document).ready(function(){
     
     //USE class "mouseover" for hover images
	 //the hover images should be end with "_over" with same name and extension
	$("IMG.mouseover").bind("mouseover",function(){
		var str = $(this).attr("src");
		var totalStr = str.length;
		var overimg = str.substring(0,(totalStr - 4))+"_over"+str.substring((totalStr - 4),totalStr);
		$(this).attr("src", overimg);
	}).bind("mouseout",function(){
		var str = $(this).attr("src");
		var totalStr = str.length;
		var overimg = str.substring(0,(totalStr - 9))+str.substring((totalStr - 4),totalStr);
		$(this).attr("src", overimg);
	});
	
	
	//ADDING hover effect for the album images
	var OVER_DEPT = 0.3;
	
	$(".overlay").css({"opacity":OVER_DEPT}).hover(function(){
		$(this).stop().animate({"opacity":"1"},1000);	
	},function(){
		$(this).stop().animate({"opacity":OVER_DEPT},500);	
	})

	$(".overlay2").hover(function(){
		$(this).stop().animate({"opacity":"0.5"},200).animate({"opacity":"1"},200);	
	},function(){
		//nothing
	})	
	
	//ADDing a arrow before h1, css defined.
	$("h1").prepend("<span><img src='/images/point_arrow.png' alt='' /></span>")
	
	  // Buttons - add onclick styles on touch for super-responsive action.
	  // Much faster than :active, or :hover.
	  $('.button').bind('touchstart', function(){
	    $(this).addClass('pressed')
	  }).bind('touchend', function(){
	    $(this).removeClass('pressed')
	  })
});

