﻿function Paid(id) { if (confirm("Продлить показ анкеты?")) { __doPostBack('cmdPaid', id); } }
function DeleteAnket(id) { if (confirm("Удалить анкету?")) { __doPostBack('cmdDelete', id); } }
function Delete(){return confirm ("Удалить?");}
function Show(id,name){var im="<img src='pic.ashx?id="+id+"&full="+name+"' onclick='Hide()'>";$("#picture").html(im).fadeIn();}
function Hide(){$("#picture").html("").fadeOut();}
function AppendAdvert(p)
{
    $('.alert').remove();
    if(p==true)
    {
        if ($('#message').val() == "" || $('#subject').val())
        {
            alert("Необходимо заполнить все обязательные поля");
            return;
        }
        
        elite.egservice.AppendAdvert($('#city').val(),$('#email').val(),$('#phone').val(),$('#username').val(),$('#subject').val(),$('#message').val(),function(result){$('#advert').hide().before("<div class=alert>"+result+"<div>");});
        $("#advert td input, textarea").val("");
    }
    if(p==false){$('#advert').hide();}
    if(p==null){$('#advert').show();}
}
function ReadAdvert(e)
{
    var comment=$(e).parents(".item").children(".comment");
    if(comment.css("display")=="none"){comment.show();}else{comment.hide();}
}

function stations() {
    var city = $("#ctl00_ContentMain_cityid").val();
    var st = $("#ctl00_ContentMain_ugid").val();
    if (isNaN(st)) {st=0}
    elite.egservice.GetUStations(city, st, function(result) { $("#ug").html(result); });
}