function showFeedBackFrm()
{
    document.getElementById('feed_frm').style.display = 'block';
    document.getElementById('main_content').className = 'decor_stand';
    document.getElementById('frm_link').style.display = 'none';
    window.location.href = window.location.href.split('#')[0] + '#frm';
}

win = 0;
function enlargeImg(src, title)
{
/*
	if (src.charAt(src.length - 1) == '/') {
		src = src.substr(0, src.length - 1);
	}
  */
	html = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n";
	html += "\n";
	html += "<html>\n";
	html += "<head>\n";
	html += "<title>" + title + "</title>\n";
	
	html += '<script language="JavaScript" type="text/javascript">';
	html += 'document.oncontextmenu = function(){return false;}';
	html += '</script>';
	
	html += "</head>\n";
	html += "\n";
	html += "<body leftmargin=\"0\" rightmargin=\"0\" topmargin=\"0\" bottommargin=\"0\" marginheight=\"0\" marginwidth=\"0\">\n";
	html += "<a href=\"#\" title=\"Закрыть\"><img border=\"0\" id=\"img_id\" src=\"/img/loading.gif\" onclick=\"window.close();\" alt=\"Закрыть\"></a>";
	html += "<script language=\"JavaScript\">\n";
	html += "var img = new Image();\n";
	html += "img.onload = function () {window.moveTo(0, 0); window.resizeTo(img.width + 10, img.height + 50);\n";
	html += "";
	html += "document.getElementById('img_id').src = '" + src + "';}\n";
	html += "img.src = '" + src + "';\n";
	
    html += "</script>\n";
	html += "</body>\n";
	html += "</html>";

	if(win){
		if(!win.closed) {
			win.close();
		}
	}
	win = window.open('', '', 'width=100, height=100, status = 1');

	win.document.write(html);
	win.document.close();
}

function changeImg(src)
{
    return false;
}

function buildUrl(get, loc)
{
    arr = new Array();
    for (i in get) {
        if (i == 'url' && (get[i] != 1 && get[i] != 2 && get[i] != 0)) continue;
        arr.push(i + '/' + get[i].replace('/', '-slash-'));    
    }
    return arr.join('/');
    return loc ? loc + '/' + arr.join('/') : get['url'] + arr.join('/');
}

function onSbmt(frm, rloc)
{
    frm = document.getElementById('srch_frm');
    $url = frm.elements['url'].options[frm.elements['url'].selectedIndex].value;
    if (url != 1 && url != 2) frm.action = url;
    return true;
}
function onSbmt1(frm, rloc)
{
    wname = '';
    frm = document.getElementById('srch_frm');
    get = new Object();
    for (i in frm.elements) {
        val = '';
        cont = 1;
        el = frm.elements[i];
        if (el == null) continue;
        name = el.name;
        switch (el.type) {
            case 'select-one':
                val = el.options[el.selectedIndex].value;
                cont = 0;
            break;
            case 'checkbox':
                if (el.checked) {
                    val = el.value;
                    cont = 0;
                } else {
                    cont = 1;
                }
            break;
        }
        if (cont == 1) continue;
        if (wname == name && get[name]) {
            get[name] += ';' + val;
        } else {
            get[name] = val;
        }
        wname = name;
    }
    
    if (get['url'] == 1 || get['url'] == 2 || get['url'] == 0) {
        if (get['url'] == 0) {
            loc = '/' + rloc;
        } else {
            loc = rloc;
        }
    } else {
        loc = get['url'];
    }
    alert(loc + buildUrl(get, loc) + '/');
    window.location.href = loc + buildUrl(get, loc) + '/';
    
    return false;
}

function sbmt()
{
    document.getElementById('login_form').method="post";
    document.getElementById('login_form').submit();
}
