$(document).ready(function(){
	document.getElementById('tit').style.display="block";
$("#header").imagecube({direction: 'up', speed: 3000, shading: false, reduction: 90, expansion: 0, Segments: 70, repeat: false});
var cuebe = $('#header');
$('#header div').css({"visibility":"visible"});
switch (window.location.hash)
{
case "#index":
	cub_number = 0;
  break;
case "#shop":
	cub_number = 1;
  break;
case "#ads":
	cub_number = 2;
  break;
case "#cod":
	cub_number = 3;
  break;
case "#shopm":
	cub_number = 4;
  break;
case "#about":
	cub_number = 5;
  break;
case "#contact":
	cub_number = 6;
  break;
default:
	cub_number = 0;
}
cuebe.imagecube('change', {direction: 'up', speed: 0}).
	imagecube('rotate', cub_number);
});
$('.b0, .b1, .b2, .b3, .b4, .b5, .b6').click(function() {
	var cube = $('#header');
	var next = parseInt($(this).attr('rel'),10);
	cube.imagecube('change', {direction: 'up', speed: 2000}).
		imagecube('rotate', next);
});
$(document).ready(function(){
if(window.location.hash == ""){
	$('#index1').fadeIn(1400);
	$.ajax({
		  url: 'pages/index.html',
		  error: function(){
			$('#index1 .center_tit').html('به علتی نا معلوم صفحه مورد نظر لود نشده است لطفاً بر روی لینک مورد نظر کلیک کنید');
		  },
		  success: function(d){
		    $('#index1 .center_tit').html(d);
		  }
	})
}else{
	$("#index1").stop().fadeIn();
	$.ajax({
		  url: 'pages/'+window.location.hash.substr(1,window.location.hash.length)+'.html',
		  error: function(){
			$('#index1 .center_tit').html('به علتی نا معلوم صفحه مورد نظر لود نشده است لطفاً بر روی لینک مورد نظر کلیک کنید');
		  },
		  success: function(d){
		    $('#index1 .center_tit').html(d);
		  }
	})
}
$('.b0').click(function(){
	$('#shop1').stop().hide(),
	$('#ads1').stop().hide(),
	$('#cod1').stop().hide(),
	$('#shopm1').stop().hide(),
	$('#about1').stop().hide(),
	$('#contact1').stop().hide(),
	$('#index1').stop().fadeIn(1400);
	window.location.hash="#index";
});
$('.b1').click(function(){
	$('#index1').stop().hide(),
	$('#ads1').stop().hide(),
	$('#cod1').stop().hide(),
	$('#shopm1').stop().hide(),
	$('#about1').stop().hide(),
	$('#contact1').stop().hide(),
	$('#shop1').stop().fadeIn(1400);
	window.location.hash="#shop";
});
$('.b2').click(function(){
	$('#shop1').stop().hide(),
	$('#index1').stop().hide(),
	$('#cod1').stop().hide(),
	$('#shopm1').stop().hide(),
	$('#about1').stop().hide(),
	$('#contact1').stop().hide(),
	$('#ads1').stop().fadeIn(1400);
	window.location.hash="#ads";
});
$('.b3').click(function(){
	$('#shop1').stop().hide(),
	$('#ads1').stop().hide(),
	$('#index1').stop().hide(),
	$('#shopm1').stop().hide(),
	$('#about1').stop().hide(),
	$('#contact1').stop().hide(),
	$('#cod1').stop().fadeIn(1400);
	window.location.hash="#cod";
});
$('.b4').click(function(){
	$('#shop1').stop().hide(),
	$('#ads1').stop().hide(),
	$('#cod1').stop().hide(),
	$('#index1').stop().hide(),
	$('#about1').stop().hide(),
	$('#contact1').stop().hide(),
	$('#shopm1').stop().fadeIn(1400);
	window.location.hash="#shopm";
});
$('.b5').click(function(){
	$('#shop1').stop().hide(),
	$('#ads1').stop().hide(),
	$('#cod1').stop().hide(),
	$('#shopm1').stop().hide(),
	$('#index1').stop().hide(),
	$('#about1').stop().fadeIn(1400);
	$('#contact1').stop().hide(),
	window.location.hash="#about";
});
$('.b6').click(function(){
	$('#shop1').stop().hide(),
	$('#ads1').stop().hide(),
	$('#cod1').stop().hide(),
	$('#shopm1').stop().hide(),
	$('#index1').stop().hide(),
	$('#about1').stop().hide(),
	$('#contact1').stop().fadeIn(1400);
	window.location.hash="#contact";
});
$('.b8').click(function(){
	$('#shop1').stop().hide(),
	$('#ads1').stop().hide(),
	$('#cod1').stop().hide(),
	$('#shopm1').stop().hide(),
	$('#index1').stop().hide(),
	$('#contact1').stop().hide(),
	$('#about1').stop().fadeIn(1400);
	window.location.hash="#benefit";
});
$('.b7').click(function(){
	$('#shop1').stop().hide(),
	$('#ads1').stop().hide(),
	$('#cod1').stop().hide(),
	$('#shopm1').stop().hide(),
	$('#index1').stop().hide(),
	$('#contact1').stop().hide(),
	$('#about1').stop().fadeIn(1400);
	window.location.hash="#logo";
});
$('.b0').click(function(e){
	$.ajax({
	  url: 'pages/index.html',
	  error: function(){
		$('#index1 .center_tit').html('به علتی نا معلوم صفحه مورد نظر لود نشده است لطفاً بر روی لینک مورد نظر کلیک کنید');
	  },
	  success: function(d){
	    $('#index1 .center_tit').html(d);
	  }
	}) })
$('.b1').click(function(e){
	$.ajax({
	  url: 'pages/shop.html',
	  error: function(){
		$('#shop1 .center_tit').html('به علتی نا معلوم صفحه مورد نظر لود نشده است لطفاً بر روی لینک مورد نظر کلیک کنید');
	  },
	  success: function(d){
	    $('#shop1 .center_tit').html(d);
	  }
	}) })
$('.b2').click(function(e){
	$.ajax({
	  url: 'pages/ads.html',
	  error: function(){
		$('#ads1 .center_tit').html('به علتی نا معلوم صفحه مورد نظر لود نشده است لطفاً بر روی لینک مورد نظر کلیک کنید');
	  },
	  success: function(d){
	    $('#ads1 .center_tit').html(d);
	  }
	}) })

$('.b3').click(function(e){
	$.ajax({
	  url: 'pages/cod.html',
	  error: function(){
		$('#cod1 .center_tit').html('به علتی نا معلوم صفحه مورد نظر لود نشده است لطفاً بر روی لینک مورد نظر کلیک کنید');
	  },
	  success: function(d){
	    $('#cod1 .center_tit').html(d);
	  }
	}) })
$('.b4').click(function(e){
	$.ajax({
	  url: 'pages/shop.html',
	  error: function(){
		$('#shop1 .center_tit').html('به علتی نا معلوم صفحه مورد نظر لود نشده است لطفاً بر روی لینک مورد نظر کلیک کنید');
	  },
	  success: function(d){
	    $('#shopm1 .center_tit').html(d);
	  }
	}) })
$('.b5').click(function(e){
	$.ajax({
	  url: 'pages/about.html',
	  error: function(){
		$('#about1 .center_tit').html('به علتی نا معلوم صفحه مورد نظر لود نشده است لطفاً بر روی لینک مورد نظر کلیک کنید');
	  },
	  success: function(d){
	    $('#about1 .center_tit').html(d);
	  }
	}) })

$('.b6').click(function(e){
	$.ajax({
	  url: 'pages/contact.html',
	  error: function(){
		$('#contact1 .center_tit').html('به علتی نا معلوم صفحه مورد نظر لود نشده است لطفاً بر روی لینک مورد نظر کلیک کنید');
	  },
	  success: function(d){
	    $('#contact1 .center_tit').html(d);
	  }
	}) })

$('.b8').click(function(e){
	$.ajax({
	  url: 'pages/benefit.html',
	  error: function(){
		$('#about1 .center_tit').html('به علتی نا معلوم صفحه مورد نظر لود نشده است لطفاً بر روی لینک مورد نظر کلیک کنید');
	  },
	  success: function(d){
	    $('#about1 .center_tit').html(d);
	  }
	}) })
	$('.b7').click(function(e){
	$.ajax({
	  url: 'pages/logo.html',
	  error: function(){
		$('#about1 .center_tit').html('به علتی نا معلوم صفحه مورد نظر لود نشده است لطفاً بر روی لینک مورد نظر کلیک کنید');
	  },
	  success: function(d){
	    $('#about1 .center_tit').html(d);
	  }
	}) })
});
$('.b0').click(function(){
	$('#back2').stop().hide(),
	$('#back3').stop().hide(),
	$('#back4').stop().hide(),
	$('#back5').stop().hide(),
	$('#back1').stop().hide(),
	$('#back6').stop().hide(),
	$('#back0').stop().fadeIn(1400);
});
$('.b1').click(function(){
	$('#back2').stop().hide(),
	$('#back3').stop().hide(),
	$('#back4').stop().hide(),
	$('#back5').stop().hide(),
	$('#back0').stop().hide(),
	$('#back6').stop().hide(),
	$('#back1').stop().fadeIn(1400);
});
$('.b2').click(function(){
	$('#back1').stop().hide(),
	$('#back3').stop().hide(),
	$('#back4').stop().hide(),
	$('#back5').stop().hide(),
	$('#back0').stop().hide(),
	$('#back6').stop().hide(),
	$('#back2').stop().fadeIn(1400);
});
$('.b3').click(function(){
	$('#back2').stop().hide(),
	$('#back1').stop().hide(),
	$('#back4').stop().hide(),
	$('#back5').stop().hide(),
	$('#back0').stop().hide(),
	$('#back6').stop().hide(),
	$('#back3').stop().fadeIn(1400);
});
$('.b4').click(function(){
	$('#back2').stop().hide(),
	$('#back3').stop().hide(),
	$('#back1').stop().hide(),
	$('#back5').stop().hide(),
	$('#back0').stop().hide(),
	$('#back6').stop().hide(),
	$('#back4').stop().fadeIn(1400);
});
$('.b5').click(function(){
	$('#back2').stop().hide(),
	$('#back3').stop().hide(),
	$('#back4').stop().hide(),
	$('#back1').stop().hide(),
	$('#back0').stop().hide(),
	$('#back6').stop().hide(),
	$('#back5').stop().fadeIn(1400);
});
$('.b6').click(function(){
	$('#back2').stop().hide(),
	$('#back3').stop().hide(),
	$('#back4').stop().hide(),
	$('#back1').stop().hide(),
	$('#back0').stop().hide(),
	$('#back5').stop().hide(),
	$('#back6').stop().fadeIn(1400);
});
$(document).ready(function(){
	$("#loading_page").ajaxStart(function(){
		$(this).fadeIn();
	});
	$("#loading_page").ajaxStop(function(){
		$(this).fadeOut(500);
	});
});
