function doBig(id, phone_id){
    var req = new JsHttpRequest();
    var s=id;
    req.onreadystatechange = function() {
        if (req.readyState == 4) {
            // Write result to page element (_RESULT becomes responseJS). 
            document.getElementById('big_photo').innerHTML = '<img src="'+req.responseJS.big_img+'" border="0">';
        }
    }
    if(id=='99999') s+='&'+phone_id;
    // Prepare request object (automatically choose GET or POST).
    req.open(null, '/ajax/getImg.php', true);
    // Send data to backend.
    req.send( { q: s } );
}

function bigChoose(f){
    var req = new JsHttpRequest();

        req.onreadystatechange = function() {
        if (req.readyState == 4) {
            document.getElementById('big_compare').innerHTML = req.responseJS.res_html;
        } else document.getElementById('big_compare').innerHTML = "<h1 align='center'>Загрузка...</h1>";
    }
    req.open(null, '../big_choose.php', true);
    // Send data to backend.
    req.send( {q: f} );
}

function stat(lot_id){
    var req = new JsHttpRequest();

        req.onreadystatechange = function() {
        if (req.readyState == 4) {};
    }
    req.open(null, '../ajax/ajax_stat.php', true);
    // Send data to backend.
    req.send( {q: lot_id} );
}

function fast_go(c){
    var req = new JsHttpRequest();

        req.onreadystatechange = function() {
        if (req.readyState == 4) {
            document.getElementById('fast_span').innerHTML = req.responseJS.res_html;
        };
    }
    req.open(null, '/ajax/fast_go.php', true);
    // Send data to backend.
    if(c.value!='000') req.send( {q: c} );
}

function goto_link(URL){
if(URL.value!='000')window.location.href = URL.value;
}

function chooser_animate(q) {
if(q=="more"){
    $("#table_more").animate({height: "show"}, 500);
    $("#a_more").css("display","none");
}else{
    $("#table_more").animate({height: "hide"}, 500);
    $("#a_more").css("display","block");
 }
}

function do_animate(q,obj,ahref) {
if(q=="more"){
    $(obj).animate({height: "show"}, 500);
    $("#stat_more").css("display","none");
    $("#stat_less").css("display","block");
}else{
    $(obj).animate({height: "hide"}, 500);
    $("#stat_more").css("display","block");
    $("#stat_less").css("display","none");
 }
}

function set_value(obj_,val){
    obj_.value=val;
}

function smslen(){
	alert(document.getElementById("sms_text").value.length);
document.getElementById("sms_len").innerHTML=document.getElementById("sms_text").value.length;
} 


