window.currentmargin=0;
window.marginright=0;
function slideleften(){
if(window.currentmargin==0){
if (!$('.imagescenter .overflow').hasClass('animated')){
	$('.imagescenter .overflow').addClass('animated');
	window.currentmargin=window.minmargin;
	$('.imagescenter .overflow').animate({'margin-left':''+window.minmargin+"px"}, {queue:false, duration:300});
setTimeout(function() {
  $('.imagescenter .overflow').removeClass('animated');
}, 500);	
		
	}
	} else {
		if (!$('.imagescenter .overflow').hasClass('animated')){
	window.currentmargin=window.currentmargin+window.itemnode;
	$('.imagescenter .overflow').animate({'margin-left':'+='+window.itemnode}, {queue:false, duration:300});
setTimeout(function() {
  $('.imagescenter .overflow').removeClass('animated');
}, 500);

	
	}
		
	}	
}	




function sliderighten(){
	if(window.currentmargin>window.minmargin){
if (!$('.imagescenter .overflow').hasClass('animated')){
	$('.imagescenter .overflow').addClass('animated');
	window.currentmargin=window.currentmargin-window.itemnode;
	$('.imagescenter .overflow').animate({'margin-left':'-='+window.itemnode}, {queue:false, duration:300});
setTimeout(function() {
  $('.imagescenter .overflow').removeClass('animated');
}, 500);
}
} else {
	if (!$('.imagescenter .overflow').hasClass('animated')){
	$('.imagescenter .overflow').addClass('animated');
	window.currentmargin=0;
	$('.imagescenter .overflow').animate({'margin-left':''+0+"px"}, {queue:false, duration:300});
setTimeout(function() {
  $('.imagescenter .overflow').removeClass('animated');
}, 500);	
		
	}
}
}

function slideright(side){

	if(window.currentmargin<0){
if (!$('.imagescenter .overflow').hasClass('animated')){
	$('.imagescenter .overflow').addClass('animated');
	window.currentmargin=window.currentmargin+window.itemnode;

	if(side=='left') $('.imagescenter .overflow').animate({'margin-left':'+='+window.itemnode}, {queue:false, duration:300});else
	 $('.imagescenter .overflow').animate({'margin-right':'+='+window.itemnode}, {queue:false, duration:300});
setTimeout(function() {
  $('.imagescenter .overflow').removeClass('animated');
}, 500);	
}
	} else {
if (!$('.imagescenter .overflow').hasClass('animated')){
	$('.imagescenter .overflow').addClass('animated');
	window.currentmargin=window.minmargin;
	$('.imagescenter .overflow').animate({'margin-right':window.currentmargin+"px"}, {queue:false, duration:300});
setTimeout(function() {
  $('.imagescenter .overflow').removeClass('animated');
}, 500);	
}
	
}
}
function slideleft(side){
	if(window.currentmargin>window.minmargin){
		
		//alert(window.item);
if (!$('.imagescenter .overflow').hasClass('animated')){
	$('.imagescenter .overflow').addClass('animated');

	if(side=='left') $('.imagescenter .overflow').animate({'margin-left':'-='+window.itemnode}, {queue:false, duration:300}); else	
$('.imagescenter .overflow').animate({'margin-right':'-='+window.itemnode}, {queue:false, duration:300});
window.marginright=window.marginright+window.itemnode;
	window.currentmargin=window.currentmargin-window.itemnode;
 setTimeout(function() {
  $('.imagescenter .overflow').removeClass('animated');
}, 500);	
	
	
}
	}
	else {
	if (!$('.imagescenter .overflow').hasClass('animated')){
	$('.imagescenter .overflow').addClass('animated');
	window.currentmargin=0;
$('.imagescenter .overflow').animate({'margin-right':window.currentmargin+"px"}, {queue:false, duration:300});
window.marginright=window.marginright+window.item;
 setTimeout(function() {
  $('.imagescenter .overflow').removeClass('animated');
}, 500);	
	
	
}	
		
		
	}
}
$(document).ready(function(e) {
	
	$('.socialcont img').hover(
  function () {
    window.tempsrc=$(this).attr("src");
    $(this).attr("src",$(this).attr("role"));
  }, 
  function () {
         $(this).attr("src",window.tempsrc);
  }
);
	$('.singleproject').hover(
  function () {
  	$(this).addClass('hover');

    $(this).find('.projectname').addClass('visible');
   var margin=$(this).find('.projectname').height();
     $(this).find('.projectname').css('margin-top','-'+(parseInt(margin)-1)+"px");
  }, 
  function () {
       $(this).find('.projectname').removeClass('visible');
       $(this).removeClass('hover');
  }
);
$('.contact-r .email').hover(
  function () {
    $(this).find('a').addClass('hover');
  }, 
  function () {
       $(this).find('a').removeClass('hover');
  }
);
$('.contact-r .email').click(function() {
	var email=$(this).find('a').text();
	  window.location.href='mailto:'+email;

});	
    $('.textwidget .formo input,.textwidget .formo textarea').focus(function(){
     if($(this).val()==$(this).attr("title")) $(this).attr("value","");
    }).focusout(function(){
       if($(this).attr("value")=='') $(this).attr("value",$(this).attr("title"));
    });
});
