function confirmDelete(delUrl) {
  if (confirm("Вы действительно хотите удалить ?")) {
    document.location = delUrl;
  }
}
function confirmDone(delUrl,message) {
  if (confirm(message)) {
    document.location = delUrl;
  }
}
function closeWin(obj){
    $("#loading").fadeOut(500);
    $("#blackwrap").fadeOut(500);
    $("#loadData").html('');
}
function addNotice(id){
    $("#notice").hide();
    $("#notice").html('<div class="subscribe"><form action="" method="post"><input type="hidden" name="id" value="'+ id +'"/><input type="hidden" name="act" value="view"/><p>Написать жаблобу</p><fieldset id="subscribeForm"><p><textarea name="describe" class="inp"></textarea></p><p><input type="submit" value="Добавить" /></p></fieldset></div></form>');
    $("#notice").slideDown(500);
}
function onAjaxSuccess(){
    $("#loading").fadeOut(500);
}
function addmark(val){
    $("#loading").show();
    $("#s1").load("/loadmark",{act: 'loadmark',mark: val}, onAjaxSuccess );
}
function addmark2(val){
    $("#loading").show();
    $("#s12").load("/loadmark",{act: 'loadmark',mark: val}, onAjaxSuccess );
}
function addmarksmall(val){
    $("#loading").show();
    $("#s1small").load("/loadmark",{act: 'loadmark',mark: val}, onAjaxSuccess );
}
function subscribe(val){
    var s0,s1,email;
    //$("#loading").show();
    s0 = document.getElementById('s0').value;
    s1 = document.getElementById('s12').value;
    email = document.getElementById('email').value;
    $("#subscribeForm").load("/subscribe",{act: 'subscribe',s0: s0,s1: s1,useremail: email}, onAjaxSuccess );
}
function addfind(val){
    if(val == 2){
        $("#loading").show();
        $("#addfind").load("/loadoptions",{act: 'loadoptions'}, onAjaxSuccess );
    } else {
        $("#addfind").html('<span><a href="#" onClick="addfind(2)" class="findadd">расширенный поиск</a></span>');
    }
}
function loadComment(parentId,actnews){
    $("#comment"+parentId).load("/loadcomment",{act: 'loadcomment',parentid: parentId,actnews: actnews});
}
function bookmark(title, url) {
	// если название страницы не было чётко указано, возьмём заголовок текущей страницы
	if (title == undefined)
		title = document.title;

	// то же самое и с URL-ом
	if (url == undefined)
		url = top.location.href;

	if (window.sidebar) {
		// Firefox
		window.sidebar.addPanel(title, url, '');
	} else if (window.opera && window.print) {
		// Opera
		var t = document.createElement('a');
		t.setAttribute('rel', 'sidebar');
		t.setAttribute('href', url);
		t.setAttribute('title', title);
		t.click();
	} else {
		// IE
		window.external.AddFavorite(url, title);
	}
	return false;
        }
