IE=(navigator.appName.indexOf("Internet Explorer")>=0);
OPERA=(navigator.appName.indexOf("Opera")>=0);

function dlpic(file) {
    document.PICLIST.text.value=document.PICLIST.text.value+"http://nskpunk.ru"+file+"\n";
    return false;
}

function hlrow(row) {
	row.style.background = '#b9b9b9';
}

function unhlrow(row) {
	row.style.background = 'transparent';
}

function ctrlenter(k) {

	if (k)
	{
		ctrl=k.ctrlKey;
		k=k.which;
	} else {
		k=event.keyCode;
		ctrl=event.ctrlKey;
	}

	if ((k==13 && ctrl) || (k==10)) {
		document.REPLIER.submit.click();
	}
}

function showdiv(id) {
    thisStyle = document.getElementById('f_upload').style;
    thisStyle.display="none";
    thisStyle = document.getElementById('f_internet').style;
    thisStyle.display="none";
    thisStyle = document.getElementById('f_server').style;
    thisStyle.display="none";
    thisStyle = document.getElementById(id).style;
    thisStyle.display="block";
}

function hover_menu(menuId)
{
    document.getElementById(menuId).className="menu_hover";
}
function unhover_menu(menuId)
{
    document.getElementById(menuId).className="menu_def";
}
function show_commentsfloat(menuId,OPERA)
{
  thisStyle = document.getElementById(menuId).style;
  if (OPERA=="1")
      thisStyle.display="table"; else
      thisStyle.display="block";
}
function hide_commentsfloat(menuId)
{
    thisStyle = document.getElementById(menuId).style;
    thisStyle.display="none";
}
function pastecomments(author,text)
{
    document.REPLIER.text.value=document.REPLIER.text.value+"[quote]"+text+"[/quote]\n";
    document.REPLIER.text.focus();
    return false;
}
function pastename(name)
{
    document.REPLIER.text.value=document.REPLIER.text.value+"[b]"+name+",[/b] ";
    document.REPLIER.text.focus();
    return false;
}
function pastetext(text)
{
    document.REPLIER.text.value=document.REPLIER.text.value+text;
    document.REPLIER.text.focus();
    return false;
}
function ValidateForm()
{
errors = "";
if (document.REPLIER.text.value.length<2)
    errors = errors + "Ââåäèòå ñîîáùåíèå!\n";

if (errors != "")
{
    alert(errors);
    return false;
}

 else
{
    document.REPLIER.submit.disabled = true;
    return true;
}
}
function switchvisible(id) {
	var st = document.getElementById(id).style;
	if (st.display == 'none') st.display = 'block'; else st.display = 'none';
}
