﻿var i;
var img = new Image();

$(img).load( function() {
$(document).ready(function(){

	i='url('+img.src+')';

	$('#photo').css("background-image", i);
	$('#photo').css("width", "0");
	$('#photo').css("height", img.height);
  	$('#photo').animate({ width: img.width }, 250, function() { });
	$('#photo').css("border", "1px solid #FFF");


	setleftright();

	$("#photo").hover(
	  function () {
	  	$('#photoinfo').animate({ bottom: 0 }, 250, function() { });
	  }, 
	  function () {
	  	$('#photoinfo').animate({ bottom: -110 }, 250, function() { });
	  }
	);



});

$(window).resize(function(){
	setleftright();
});
}).error( function() {});



function setleftright() {

	i=($(window).width()-img.width) / 2;
	$('#toleft').css("height", img.height+2);	
	$('#toleft').css("width", i);
	$('#toright').css("height", img.height+2);
	$('#toright').css("width", i);

	$('#toright').css("display", "block");
	$('#toleft').css("display", "block");



   	




}



