
function createXmlHttpRequestObject() 
{	
  var xmlHttp;
    try 
    {
      xmlHttp = new XMLHttpRequest();
    }
    catch (e) 
    {
      try 
      {
      xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
      }
      catch (e) 
      {
        xmlHttp = false;
      }
    }
  
  if (!xmlHttp)
 
    alert("Невозможно создать XMLHttpRequest объект.");
  else 
    return xmlHttp;
}

function handleServerResponse() 
{
  if (xmlHttp.readyState == 4) 
  {
    if (xmlHttp.status == 200) 
    {
      cont_vote =  xmlHttp.responseText;
      document.getElementById('vote').innerHTML = cont_vote;
    } 
    else 
    {
      //alert("Проблемы передачи данных: " + xmlHttp.statusText);
    }
  }
}



nereidFadeObjects = new Object();
nereidFadeTimers = new Object();
function nereidFade(object, destOp, rate, delta){
if (!document.all)
return
if (object != "[object]"){ 
setTimeout("nereidFade("+object+","+destOp+","+rate+","+delta+")",0);
return;
}
clearTimeout(nereidFadeTimers[object.sourceIndex]);
diff = destOp-object.filters.alpha.opacity;
direction = 1;
if (object.filters.alpha.opacity > destOp){
direction = -1;
}
delta=Math.min(direction*diff,delta);
object.filters.alpha.opacity+=direction*delta;

if (object.filters.alpha.opacity != destOp){
nereidFadeObjects[object.sourceIndex]=object;
nereidFadeTimers[object.sourceIndex]= setTimeout("nereidFade(nereidFadeObjects["+object.sourceIndex+"],"+destOp+","+rate+","+delta+")",rate);
}
}

function showimg(url, w, h)
{

        bw=w+0;
        bh=h+0;
	openview=window.open("","openview",'width='+bw+',height='+bh+',top=100,left=100,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes');
	openview.document.writeln("<html><head><title>Просмотр фотографии</title>");
        openview.document.writeln("</head>");
        openview.document.writeln("<body style='background-color: #fff;' leftMargin='0' topMargin='0' marginwidth='0' marginheight='0'>");
	openview.document.writeln("<img class='brd' src='"+url+"' width='"+w+"',height='"+h+"' alt=''>");
	openview.document.writeln("</body></html>");
	openview.document.close();
	openview.focus();
}
function openMenu(id){
	if (document.getElementById(id).style.display == "none"){
		document.getElementById(id).style.display = "block";
	}else{
		document.getElementById(id).style.display = "none"; 
	}
}
function openMenu2(id){
	if (document.getElementById(id).style.display == "none"){
		document.getElementById(id).style.display = "block";
		document.getElementById(id+"_i").src= "img/ext/folder_up.gif";
		document.getElementById(id+"_t").style.color = "#b60101";

	}else{
		document.getElementById(id).style.display = "none"; 
		document.getElementById(id+"_i").src= "img/ext/folder_down.gif";
		document.getElementById(id+"_t").style.color = "";
	}
}

function openMenu3(id){
	if (document.getElementById(id).style.display == "none"){
		document.getElementById(id).style.display = "block";
		document.getElementById(id+"_i").src= "img/ext/minus.gif";
		document.getElementById(id+"_t").style.color = "#b60101";

	}else{
		document.getElementById(id).style.display = "none"; 
		document.getElementById(id+"_i").src= "img/ext/plus.gif";
		document.getElementById(id+"_t").style.color = "";
	}
}

function openform(id1,id2){
		document.getElementById(id1).style.display = "block";
		document.getElementById('id').value = id2;
}

function form_search_pg(act){
document.form_search.action=act;
document.form_search.submit();
}

function vievcount(u){
    xmlHttp2.open("GET", "/ajax/vievcount.ax.php?"+u, true);  
	xmlHttp2.onreadystatechange = vievcountrespon;
    xmlHttp2.send(null);
}

function vievcountrespon()
{
  if (xmlHttp2.readyState == 4) 
  {
    if (xmlHttp2.status == 200) 
    {
      cont_vote =  xmlHttp2.responseText;
      document.getElementById('vievcountblock').innerHTML = cont_vote;
    } 
    else 
    {
      //alert("Проблемы передачи данных: " + xmlHttp.statusText);
    }
  }
}






