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 loginForm(obj){
    obj.href = '#';
    $("#loading").show();
    $("#blackwrap").show();
    $("#loadData").load("/loginform",{act: 'loginform'}, onAjaxSuccess );
    return false;
}
function regForm(obj){
    obj.href = '#';
    $("#loading").show();
    $("#blackwrap").show();
    $("#loadData").load("/regform",{act: 'regform'}, onAjaxSuccess );
    return false;
}
function addNotice(id){
    $("#addTape").hide();
    $("#addTape").html('<form action="" method="post"><input type="hidden" name="id" value="'+ id +'"/><input type="hidden" name="act" value="view"/><div id="regform" style="width:310px;"><div class="title"><span>Написать жалобу</span></div><div id="standarForm"><fieldset class="noline"><br /><label>Описание: <br /></label><textarea name="describe" class="inp"></textarea><br /><div class="clear"></div><input type="image" class="submit5" src="/images/assets/next.png" value="Подписаться"/></fieldset></div></div></form>');
    $("#addTape").slideDown(500);
}
function onAjaxSuccess(){
    $("#loading").fadeOut(500);
}
function addmark(val){
    $("#loading").show();
    $("#s1").load("/loadmark",{act: 'loadmark',mark: val}, onAjaxSuccess );
}
function subscribe(val){
    var s0,s1,email;
    //$("#loading").show();
    s0 = document.getElementById('s0').value;
    s1 = document.getElementById('s1').value;
    email = document.getElementById('email').value;
    $("#standarForm").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 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;
        }
