var slide_id = -1;
$(document).ready(function() {
	if (window.location.hash != ''){
		var anchor_name = window.location.hash.replace('#','');
		anchor_name = anchor_name.split('_');
		try{
		slide_id = anchor_name[1];
		}catch(e){
			slide_id = -1;
		}
		if (slide_id == undefined){
			slide_id = -1;
		}
		anchor_name = anchor_name[0];
		
		
		$('body').scrollTo(0, 1);
 		var selected_ank = 0;
		$('a').each(function(){
			if ($(this).attr('name') != ''){
				if ($(this).attr('name') == anchor_name){
					//console.log(selected_ank);
					var calculated_scroll = selected_ank*516;
					setTimeout(function(){$('body').scrollTo('+='+calculated_scroll+'px', 1000);}, 800);
					
					
				}
				selected_ank++;			
			}
		});
		//setTimeout(function(){$('body').scrollTo($('a[name='+anchor_name+']'), 1000);}, 800);


	}
	
	if ($('#selected_item_id').length){
	if ($('#selected_item_id').val() != ''){
	var anchor_name = 'project-'+$('#selected_item_id').val();
	var selected_ank = 0;
	$('a').each(function(){
			if ($(this).attr('name') != ''){
				if ($(this).attr('name') == anchor_name){
					//var calculated_scroll = selected_ank*510;
					var calculated_scroll = $(this).position().top;
					setTimeout(function(){$('body').scrollTo('+='+calculated_scroll+'px', 1000);}, 800);
				}
				selected_ank++;			
			}
		});
	}
	}
	
	
	setTimeout(function(){$('.for_show').show();},500)
	

});



