// read a file from the server
function process2(idkom)
{

  // only continue if xmlHttp isn't void
  if (xmlHttp)
  {
    // try to connect to the server
    try
    {
		id = idkom;
      // get the two values entered by the user
      //var error_text = selected; 
		//idkom=document.getElementById('com_zal_el').value;		
	//  alert(divstroka);
	  /*divstroka.innerHTML = "" + responseText;*/
      // create the params string
      var params = "error_text=" + idkom;
      // initiate the asynchronous HTTP request
     // alert('nach1');
	  xmlHttp.open("GET", "report.php?" + params, true);
      xmlHttp.onreadystatechange = handleRequestStateChange3;
      xmlHttp.send(null);
	  
    }
    // display the error in case of failure
    catch (e)
    {
      //alert("Can't connect to server:\n" + e.toString());
    }
  }
}

// function called when the state of the HTTP request changes
function handleRequestStateChange3() 
{
var divstroka="com_zalElement" + id;
var com_zal = document.getElementById(divstroka);
  //alert(divstroka);
  /*alert(xmlHttp.readyState);
//  alert(xmlHttp.status);
  //alert(xmlHttp.statusText);
  alert('kon');
*/
  if (xmlHttp.readyState != 4)
  {
    com_zal.innerHTML = "<img src='images/loader.gif' width='15' height='15' alt='' />";
  }else
  
 if (xmlHttp.readyState == 4)
  {
   // when readyState is 4, we are ready to read the server response
   // continue only if HTTP status is "OK"
    if (xmlHttp.status == 200) 
    {
      try
      {
        // do something with the response from the server
        handleServerResponse3();
      }
      catch(e)
      {
        // display error message
        //alert("Error reading the response: " + e.toString());
      }
    } 
    else
    {
      // display status message
      //alert("There was a problem retrieving the data:\n" + xmlHttp.statusText);
    }
  }
}

// handles the response received from the server
function handleServerResponse3()
{
 divstroka="com_zalElement" + id;
 com_zal = document.getElementById(divstroka);
 // retrieve the server's response packaged as an XML DOM object
  var xmlResponse = xmlHttp.responseXML;
  // catching potential errors with IE and Opera
  if (!xmlResponse || !xmlResponse.documentElement)
    throw("Invalid XML structure:\n" + xmlHttp.responseText);
 
  // catching potential errors with Firefox
  var rootNodeName = xmlResponse.documentElement.nodeName;
  if (rootNodeName == "parsererror") 
    throw("Invalid XML structure:\n" + xmlHttp.responseText);
  // getting the root element (the document element)
  xmlRoot = xmlResponse.documentElement;
  // testing that we received the XML document we expect
  if (rootNodeName != "response" || !xmlRoot.firstChild)
    throw("Invalid XML structure:\n" + xmlHttp.responseText);
  // the value we need to display is the child of the root <response> element
  responseText = xmlRoot.firstChild.data;
	// display the user message
 var divstroka="com_zalElement" + id;
var com_zal = document.getElementById(divstroka);
	//alert(com_zal);
 com_zal.innerHTML = "" + responseText;
}






// ротация партнёров
 
var i_strngth=(document.getElementById)?0:1;
var i_image=0

var imageurl = new Array()
imageurl[0] ="images/powernet.jpg"
imageurl[1] ="images/partner.png"
imageurl[2] ="images/yavol.ru.gif"
imageurl[3] ="images/sportcom.gif"
imageurl[4] ="img/reklama/yourstartpage-mini.gif"
imageurl[5] ="images/vkontakte.jpg"
imageurl[6] ="images/facebook.png"
imageurl[7] ="img/reklama/vdt.jpg"
imageurl[8] ="images/logoteatr.jpg"
 
var url = new Array()
url[0] ="http://li.ru/go?powernet.com.ru/"
url[1] ="http://li.ru/go?www.partner34.ru/"
url[2] ="http://li.ru/go?yavol.ru/"
url[3] ="http://li.ru/go?www.volgosport.com.ru/"
url[4] ="http://li.ru/go?yourstartpage.ru/"
url[5] ="http://li.ru/go?vk.com/volzsky_ru"
url[6] ="http://li.ru/go?facebook.com/volzsky.ru"
url[7] ="http://li.ru/go?vdt-teatr.ru"
url[8] ="http://li.ru/go?meteatr.ucoz.ru"
 
   

function showimage() {  
    if(document.all) {
        if (i_strngth <=110) {
            testimage.innerHTML="<a href='"+url[i_image]+"' target='_blank' rel='nofollow'><img style='filter:alpha(opacity="+i_strngth+")' src="+imageurl[i_image]+" ></a>";
            i_strngth=i_strngth+10
            var timer=setTimeout("showimage()",100)
        }    
        else {
            clearTimeout(timer)
            var timer=setTimeout("hideimage()",5000)
        }
    }    
    if (document.getElementById&&!document.all)
    {
    
            if (i_strngth <1) {
            //alert(i_strngth)
            testimage.innerHTML="<a href='"+url[i_image]+"' target='_blank' rel='nofollow'><img style='opacity:"+i_strngth+"' src="+imageurl[i_image]+" ></a>";
            i_strngth=i_strngth+0.1
            var timer=setTimeout("showimage()",100)
        }    
        else {
        
            clearTimeout(timer)
            var timer=setTimeout("hideimage()",5000)
        }
    }
    
    if(document.layers) {
            clearTimeout(timer)
            document.testimage.document.write("<a href='"+url[i_image]+"' target='_blank' rel='nofollow'><img src="+imageurl[i_image]+" ></a>")
            document.close()
            i_image++
            if (i_image >= imageurl.length) {i_image=0}    
            var timer=setTimeout("showimage()",2000)
                
    }
           
}
 
 
function hideimage() {        
    if (document.all&&i_strngth >=-10) {
        testimage.innerHTML="<a href='"+url[i_image]+"' target='_blank' rel='nofollow'><img style='filter:alpha(opacity="+i_strngth+")' src="+imageurl[i_image]+" ></a>";
        i_strngth=i_strngth-10
        var timer=setTimeout("hideimage()",100)
    }
        else if(document.getElementById&&!document.all&&i_strngth>0.1)
        {
                      
      testimage.innerHTML="<a href='"+url[i_image]+"' target='_blank' rel='nofollow'><img style='opacity:"+i_strngth+"' src="+imageurl[i_image]+" ></a>";
        i_strngth=i_strngth-0.1;
        var timer=setTimeout("hideimage()",100)
        }    
    else {
    
        clearTimeout(timer)
        i_image++
        if (i_image >= imageurl.length) {i_image=0}
        i_strngth=(document.getElementById)?0:1;
        if (document.getElementById&&!document.all)
        showimage();
        else
        var timer=setTimeout("showimage()",500)    
        
    }
}
 setTimeout("showimage()",5000);

