function submit_login(frm)
{
//	var frm = document.getElemantById("login_box");
	if(!form_check(frm, "username::Логин::any::req::255;;password::Пароль::any::req::255;;", 'ru')) {
		alert(form_check_msg(",\n"), true);
		form_check_getfield(0).focus();
		return false;
	}
	return true;
}
function submit_subscription(frm,lang)
{
//	var frm = document.getElemantById("login_box");\
	if(!form_check(frm, frm.validator.value, frm.lang.value)) {
		alert(form_check_msg(",\n"), true);
		form_check_getfield(0).focus();
		return false;
	}
	return true;
}


function SendPoll()
{
	var poll,N=0;
	for(var i=1;i<=6;i++){
		poll = document.getElementById("poll_"+i);
		if(poll==null) continue;
		if(poll.checked){
			N=i;
			break;
		}
	}
	if(N==0){
		alert("Выбирите вариант ответа");
	}else{
		if(servicePoll_ajax==null)
		servicePoll_ajax =new carservice(servicePollCallback);
		var poll_id = document.getElementById("poll_id");
		servicePoll_ajax.voitpoll(poll_id.value,N);
	}
	
	return false;
}
function ShowVoitPoll(result){
	var poll =document.getElementById("poll");
	poll.innerHTML = result;
}

var servicePollCallback = {
    // after a review we get a chunk of html that we can update the reviewList with
	    voitpoll: function(result) {
			ShowVoitPoll(result);
	    }
}
var servicePoll_ajax    ;//= new CarService(serviceCarCallback);

function getAllList(lang ,url , list, type, page_type){
	if(list=='type'){
		$.get(lang+"/ajax_html.php", { list: list, type: type, url:url, page_type:page_type }, ListInType );
	}
	if(list=='tags'){
		$.get(lang+"/ajax_html.php", { list: list, type: type, url:url, page_type:page_type }, ListInTags );
	}
	return false;

}
function ListInType(data){
	$('#types_list').html(data);
	$("#types_list").show("slow");
}
function ListInTags(data){
	$('#tags_list').html(data);
	$("#tags_list").show("slow");
}

