$(document).ready(function(){
	
	//Image Hover Action
	var $photowidthS, $photowidthL, $photoheightS, $photoheightL;

	//start Event set for Photo Action
	Obj.photo();

	//Start Color Animation
	Obj.photo.animateColor();


});

var Obj = new Object();

Obj.photo = function(){
	//iPhone photo size (original)
	$size1 = 375;
	$size2 = 500;
	
	//$photowidthL = 375;
	//$photoheightL = 500;

	//Event set
	$(".photo", "#content").click(function(){
		if($(this).hasClass('large')){
			Obj.photo.animate(this, 'out');
		}else{
			//get Data only once
			$photowidthS = $(this).width();
			$photoheightS = $(this).height();
	
			$photowidthL = ($(this).width() > $(this).height()) ? $size2 : $size1;
			$photoheightL = ($(this).width() > $(this).height()) ? $size1 : $size2;
			if(!$(this).hasClass('gotsize')){
				$(this).addClass('gotsize');
			}
			Obj.photo.animate(this, null);
		}
	});
}

Obj.photo.animate = function(e, ev){
	if(($(e).width() == $photowidthL) || (ev == 'out')){
		$(e).animate({
			'width':$photowidthS + 'px',
			'height':$photoheightS + 'px'
		}, 200).removeClass('large');
	}else{
		$(e).animate({
			'width':$photowidthL + 'px',
			'height':$photoheightL + 'px'
		}, 200).addClass('large');
	}
}

Obj.photo.animateColor = function(){
	//alert("start");
	//$("h2").animate({color:'#ff0000'}, 1000).animate({color:'#00ff00'}, 1000);
	$("a", "#logo").colorBlend([{colorList:["#9dba3e",  "#78be00", "yellow", "#a7ff00", "#78be00"], param:"color", fps:400, random:true}]);
}