
	function ShowMoreWeather(more)
	{
		var weatherTable = document.getElementById("weather_table");
		var weatherMore = document.getElementsByTagName("td");
		if (more) {
			weatherTable.width = "100%";
			switchDisplay("more_weather_link");
			for (var i=0;i<weatherMore.length;i++) {
				if (weatherMore[i].className == "weather_more")
					weatherMore[i].style.display = "block";
			}
		} else {
			weatherTable.width = "80%";
			//weatherMore.style.display = "none";
		}
	}
	
	//----------------
	
	show_load_title = true
	var Signup = {
		
		signupActions : "/actions/users.php",
		
		CheckLogin : function()
		{
			var login = document.getElementById("login_signup_field").value;
			if (login == "") {
				document.getElementById("checkLogin").innerHTML = "Сначала введите логин";
				return false;
			}
			var vars = "action=check_login&user_name=" + login;
			try {
				sendXmlHttpRequest("post", this.signupActions, vars, Signup.checkLoginCallback);
			} catch (e) {
				alert(e);
			}		
		},
		checkLoginCallback : function(jsHttp)
		{
			eval("var json = " + jsHttp.responseText);
			if (json.Message.Type == "info")
				document.getElementById("checkLogin").style.color = "green";
			else
				document.getElementById("checkLogin").style.color = "red";
			setHtml("checkLogin", json.Message.Text);
		},
		
		checkPass : function()
		{
			var pass1 = document.getElementById("pass_signup_field").value;
			var pass2 = document.getElementById("pass_signup_field2").value;
			if (pass1 == "" || pass2 == "") {
				return false;
			}
			if (pass1 != pass2) {
				document.getElementById("checkPass").innerHTML = "Пароли не совпадают";
				return false;
			} else {
				document.getElementById("checkPass").innerHTML = "Пароли совпадают";
				return true;
			}		
		}
	}
	
	
	var Mobile = {
		
		actionsPath : "/actions/mobile.php",
		
		GetBrandsList : function()
		{
			vars = "action=get_mobile_brands";
			sendXmlHttpRequest("get", this.actionsPath, vars, this.getBrandsCallback);
		},
		getBrandsCallback : function(jsHttp)
		{
			eval("var json = " + jsHttp.responseText);
			var html = 'Модель: <select name="mobile_brand" onChange="Mobile.GetModelsList(this.value);">';
			html += '<option value="0">---</option>';
			for (var i=0;i<json.MobileBrands.length;i++) {
				html += '<option value="'+json.MobileBrands[i].Id+'">'+json.MobileBrands[i].Name+'</option>';
			}
			html += '</select> <span id="mobileModels"></span>';
			html += ' <div style="text-align: right;"> или введите своё название <input class="textbox" type="text" name="custom_name"></div>';
			document.getElementById("customDiv").innerHTML = html;
		},
		
		GetModelsList : function(brandId)
		{
			vars = "action=get_mobile_models&brand=" + brandId;
			sendXmlHttpRequest("get", this.actionsPath, vars, this.getModelsCallback);
		},
		getModelsCallback : function(jsHttp)
		{
			eval("var json = " + jsHttp.responseText);
			var html = '<select name="mobile_model">';
			html += '<option value="0">---</option>';
			for (var i=0;i<json.MobileModels.length;i++) {
				html += '<option value="'+json.MobileModels[i].Id+'">'+json.MobileModels[i].Name+'</option>';
			}
			html += "</select>";
			document.getElementById("mobileModels").innerHTML = html;
		}
		
	}
