function goto_model(label, label_id, model, model_id, category) {
	model_href	=	"/ru/" + category + "/" + label + "/" + label_id + "/" + model + "/" + model_id + ".html";
	document.location.href = model_href;
}

function goto_compare(phone_1, phone_2, phone_3) {
	compare_href	=	"/ru/compare/" + phone_1 + "/" + phone_2 + "/" + phone_3;
	document.location.href = compare_href;
}

function showblock(id) {
	document.getElementById(id).style.display = "block";
}
function hideblock(id) {
	document.getElementById(id).style.display = "none";
}

function get_models(label_id, block, phone_number) { 
			var Aj = new XHConn();
			
			document.getElementById(block).innerHTML = "<img src='/img/ajax-loader.gif' width='32' height='32' alt='' title='' />";
			Aj.connect("/ajax_scripts/get_models.php", "POST", "label_id=" + label_id + "&phone_number=" + phone_number,
			function ( res ) { 
					if (res && res.responseText) 
								{ 
									var el = document.getElementById ? document.getElementById(block) : eval("document.all."+block);
									if (el && el.innerHTML) el.innerHTML = res.responseText;

								}
								else
								{
									document.getElementById(block).innerHTML = "empty";
								}
        	        	}
					);
}

//перетаскивание объекта
     var flag=false;
     var shift_x;
     var shift_y;
  
function start_drag(itemToMove,e){
     if(!e) e = window.event;
     flag=true;
     shift_x = e.clientX-parseInt(itemToMove.style.left);
     shift_y = e.clientY-parseInt(itemToMove.style.top);
  
     if(e.stopPropagation) e.stopPropagation();
     else e.cancelBubble = true;
     if(e.preventDefault) e.preventDefault();
     else e.returnValue = false;
}
  
function end_drag(){ flag=false; }
  
function dragIt(itemToMove,e){
     if(!flag) return;
     if(!e) e = window.event;
     itemToMove.style.left = (e.clientX-shift_x) + "px";
     itemToMove.style.top = (e.clientY-shift_y) + "px";
  
     if(e.stopPropagation) e.stopPropagation();
     else e.cancelBubble = true;
     if(e.preventDefault) e.preventDefault();
     else e.returnValue = false;
}

//конец перетаскивание объекта

function is_empty_fiels() {
	if ($('#name').val() && $('#email2').val() && $('#textmessage').val()) 
		$('#submit').removeAttr("disabled").val("Отправить").css("color","#444444");
		else 
		$('#submit').attr("disabled", "disabled").val("Не все поля заполнены!").css("color","#DA1117");		
}

function hide_text() {
	if ($('input.input_search').val() == "Введите запрос")
	$('input.input_search').val("");
};
function show_text() {
	if ($('input.input_search').val() == "")
	$('input.input_search').val("Введите запрос");
};

