function crawl() {
	var locationHash = String(location.hash);
	var hash = locationHash.split("/");
	var langHash = hash[0].split("#!");
	langHash = langHash[1];
	
	var categoryHash = hash[1];
	var modelIDHash = hash[2];
	var modelNameHash = hash[3];
	var modelPicHash = hash[4];
	var liteboxHash = hash[5];
	
	
	if (langHash && langHash == "hu") { lang = "1"; }
	else if (langHash && langHash == "en") { lang = "2"; }
	
	
	
	if (!modelIDHash) {
		// ha ures es csak a nyelv van benne...
		if (!categoryHash) {
			$.ajax({
				success: function() {
					$("#languageValue").val(lang);
					$("#fader-container").animate({top: -600, opacity: 0}, 400, "easeInOutCubic");
					$("#logo-landingpage").delay(75).animate({top: 600, opacity: 0}, 325, "easeInOutCubic");
					$("#languages, #footer").animate({bottom: -300, opacity: 0}, 400, "easeInOutCubic");
					
					$("#main-bg").delay(400).animate({opacity: 1}, 400, function() {
						$.ajax({
							url: 'main.php?lang=' + lang, 
							success: function(response) {
								$('#wrap').html(response);
								$("#logo, #menu, #search, #footer").fadeIn(300);
							}
						});
					});
				}
			});
		}
		
		
		
		// ha valamelyik kategoriat / oldalt nezi
		else if (categoryHash == "girls" || categoryHash == "boys" || categoryHash == "part-time-models" || categoryHash == "new-faces" || categoryHash == "become-a-model" || categoryHash == "about" || categoryHash == "contact" || categoryHash == "vm-supermodel" || categoryHash == "terms" || categoryHash == "confirm") {
			
			$.ajax({
				success: function() {
					$("#languageValue").val(lang);
					$("#fader-container").animate({top: -600, opacity: 0}, 400, "easeInOutCubic");
					$("#logo-landingpage").delay(75).animate({top: 600, opacity: 0}, 325, "easeInOutCubic");
					$("#footer").animate({bottom: -300, opacity: 0}, 400, "easeInOutCubic");
					$("#languages").animate({bottom: -300, opacity: 0}, 400, "easeInOutCubic", function() {
						$.ajax({
							url: "main.php?lang=" + lang, 
							success: function(response) {
								$("#wrap").html(response);
								$("#logo, #menu, #search, #footer").fadeIn(300);
								$("#visibleContainer").val('0');
								
								if (categoryHash == "girls") { modelsShowCategory('girl', '1'); }
								if (categoryHash == "boys") { modelsShowCategory('boy', '2'); }
								if (categoryHash == "part-time-models") { modelsShowCategory('ptm', '3'); }
								if (categoryHash == "new-faces") { modelsShowCategory('newface', '4'); }
								
								if (categoryHash == "become-a-model") { pageShow('become', '5'); }
								if (categoryHash == "about") { pageShow('about', '6'); }
								if (categoryHash == "contact") { pageShow('contact', '7'); }
								if (categoryHash == "vm-supermodel") { pageShow('vmsupermodel', '8'); }
								if (categoryHash == "terms") { pageShow('terms', '9'); }
								if (categoryHash == "confirm") { pageShow('confirm', '10'); }
							}
						});
					});
				}
			});
		}
	} // if (!modelIDHash)
	
	
	
	// ha egy modellt nez...
	else if (modelIDHash && modelIDHash != "") {
		// confirm with id
		if (categoryHash == 'confirm') {
			$.ajax({
				success: function() {
					$("#languageValue").val(lang);
					$("#fader-container").animate({top: -600, opacity: 0}, 400, "easeInOutCubic");
					$("#logo-landingpage").delay(75).animate({top: 600, opacity: 0}, 325, "easeInOutCubic");
					$("#footer").animate({bottom: -300, opacity: 0}, 400, "easeInOutCubic");
					$("#languages").animate({bottom: -300, opacity: 0}, 400, "easeInOutCubic", function() {
						$.ajax({
							url: "main.php?lang=" + lang, 
							success: function(response) {
								$("#wrap").html(response);
								$("#logo, #menu, #search, #footer").fadeIn(300);
								$("#visibleContainer").val('0');
								
								pageShowConfirm('confirm', '10', modelIDHash);
							}
						});
					});
				}
			});
			
			
			//pageShowConfirm('confirm', '10', modelIDHash);
			return;
		}
		
		
		if (lang == 1) {
			if (categoryHash == "girls") { breadcrumbs = "Lányok"; }
			else if (categoryHash == "boys") { breadcrumbs = "Fiúk"; }
			else if (categoryHash == "part-time-models") { breadcrumbs = "Part Time Models"; }
			else if (categoryHash == "new-faces") { breadcrumbs = "Új Arcok"; }
			else if (categoryHash == "confirm") { breadcrumbs = "Jelentkezés megerősítése"; }
		}
		
		else if (lang == 2) {
			if (categoryHash == "girls") { breadcrumbs = "Girls"; }
			else if (categoryHash == "boys") { breadcrumbs = "Boys"; }
			else if (categoryHash == "part-time-models") { breadcrumbs = "Part Time Models"; }
			else if (categoryHash == "new-faces") { breadcrumbs = "New Faces"; }
			else if (categoryHash == "confirm") { breadcrumbs = "Confirm application"; }
		}
		
		
		
		if (categoryHash == "girls") { var menuItemCategory = "girl"; }
		else if (categoryHash == "boys") { var menuItemCategory = "boy"; }
		else if (categoryHash == "part-time-models") { var menuItemCategory = "ptm"; }
		else if (categoryHash == "new-faces") { var menuItemCategory = "newface"; }
		
		
		
		if (liteboxHash && liteboxHash != "") {
			$.ajax({
				success: function() {
					$("#languageValue").val(lang);
					$("#fader-container").animate({top: -600, opacity: 0}, 400, "easeInOutCubic");
					$("#logo-landingpage").delay(75).animate({top: 600, opacity: 0}, 325, "easeInOutCubic");
					$("#footer").animate({bottom: -300, opacity: 0}, 400, "easeInOutCubic");
					$("#languages").animate({bottom: -300, opacity: 0}, 400, "easeInOutCubic", function() {
						$.ajax({
							url: "main.php?lang=" + lang, 
							success: function(response) {
								$("#wrap").html(response);
								
								$("#logo, #menu, #search, #footer").fadeIn(300);
								
								// add class="selected"
								var divClass = $("#menu-item-" + menuItemCategory).attr("class");
								var newDivClass = divClass + " selected";
								$("#menu-item-" + menuItemCategory).attr("class", newDivClass);
								
								
								$("#breadcrumbs").animate({opacity: 0}, 0, function() {
									$("#breadcrumbs").html(breadcrumbs).animate({opacity: 1}, 400);
								});
								showModel(modelIDHash, '12', modelNameHash, modelPicHash, '');
								
								
								//setTimeout(function() {showModelPicCrawl(modelPicHash)}, 300);
							}
						});
					});
				}
			});
		}
		
		
		
		else if (!liteboxHash) {
			$.ajax({
				success: function() {
					$("#languageValue").val(lang);
					$("#fader-container").animate({top: -600, opacity: 0}, 400, "easeInOutCubic");
					$("#logo-landingpage").delay(75).animate({top: 600, opacity: 0}, 325, "easeInOutCubic");
					$("#footer").animate({bottom: -300, opacity: 0}, 400, "easeInOutCubic");
					$("#languages").animate({bottom: -300, opacity: 0}, 400, "easeInOutCubic", function() {
						$.ajax({
							url: "main.php?lang=" + lang, 
							success: function(response) {
								$("#wrap").html(response);
								
								$("#logo, #menu, #search, #footer").fadeIn(300);
								
								// add class="selected"
								var divClass = $("#menu-item-" + menuItemCategory).attr("class");
								var newDivClass = divClass + " selected";
								$("#menu-item-" + menuItemCategory).attr("class", newDivClass);
								
								
								$("#breadcrumbs").animate({opacity: 0}, 0, function() {
									$("#breadcrumbs").html(breadcrumbs).animate({opacity: 1}, 400);
								});
								showModel(modelIDHash, '12', modelNameHash, modelPicHash, '');
							}
						});
					});
				}
			});
		}
	} // else if (modelIDHash && modelIDHash != "")
}
