	s1 = new Image();
	s1.src = "http://img.imgsmail.ru/r/agent/bg_agent2.jpg";
	s2 = new Image();
	s2.src = "http://img.imgsmail.ru/r/agent/bg_agent1.gif";

// --
function popup() {
	window.open("http://exe.agent.mail.ru/magentsetup.exe", "agentdownload", "width=10,height=10,top=0,left=0,menubar=no,location=no,resizable=no,scrollbars=no,status=no,directories=no");
	}

function popup_wm() {
	window.open("http://exe.agent.mail.ru/mobile/WM/MobileAgentWM.exe", "agentdownload", "width=10,height=10,top=0,left=0,menubar=no,location=no,resizable=no,scrollbars=no,status=no,directories=no");
	}
function popup_java() {
	window.open("http://my.agent.mail.ru/mobile/1v3v15/General1/MobileAgent.jad", "agentdownload", "width=10,height=10,top=0,left=0,menubar=no,location=no,resizable=no,scrollbars=no,status=no,directories=no");
	}

		
// --
var max_num = 6;

function call_slide(slide_num){	
	var n = 1;
	while(n<=max_num){
		if(slide_num == n){		
			document.getElementById('slide'+n+'_1').style.display = 'block';
			document.getElementById('slide'+n+'_2').style.display = 'block';
			document.getElementById('but_'+n).className = 'act';
			
		}
		else {
			document.getElementById('slide'+n+'_1').style.display = 'none';
			document.getElementById('slide'+n+'_2').style.display = 'none';
			document.getElementById('but_'+n).className = '';		
		}
		n++
	}	
}

// --
function statusimage()
	{
		var a = document.getElementById('email').value;
		if(a.indexOf('@mail.ru')!=-1 || a.indexOf('@bk.ru')!=-1 || a.indexOf('@list.ru')!=-1 || a.indexOf('@corp.mail.ru')!=-1 || a.indexOf('@inbox.ru')!=-1){
		document.getElementById('status_div').style.display = '';
		document.getElementById('stcode').value='<a href="http://www.mail.ru/agent?message&to='+a+'"><img src="http://status.mail.ru/?'+a+'" width="13" height="13" alt="Агент@mail.ru" border="0"></a>';
		} else {
			alert('неправильный e-mail!')
		}
	}
	
// --
    function status()
	{
		var a = document.getElementById('email').value;
		var status_code = 'http://status.mail.ru/?'+a;
	}
	
	
// -- ajax
function slider(slide) {
	var str = "" + document.location;
	var param = str.split("?");
	var slide = param[1];
	if (slide==2) {
		call_slide(2);
        stop_sliders_interval();
	}
	else if (slide==3) {
		call_slide(3);
        stop_sliders_interval();
	}
    else if (slide==4) {
		call_slide(4);
        stop_sliders_interval();
	}
	else {
		call_slide(1);
        stop_sliders_interval();
	}
}
//window.onload = slider(location.search);


var id;
var req;

function loadXMLDoc(url) {
	req = false;
    // branch for native XMLHttpRequest object
    if(window.XMLHttpRequest) {
    	try {
			req = new XMLHttpRequest();
        } catch(e) {
			req = false;
        }
    // branch for IE/Windows ActiveX version
    } else if(window.ActiveXObject) {
       	try {
        	req = new ActiveXObject("Msxml2.XMLHTTP");
      	} catch(e) {
        	try {
          		req = new ActiveXObject("Microsoft.XMLHTTP");
        	} catch(e) {
          		req = false;
        	}
		}
    }
	if(req) {
		req.onreadystatechange = processReqChange;
		req.open("GET", url, true);
		req.send("");
	}
}

function processReqChange() {
    // only if req shows "loaded"
    if (req.readyState == 4) {
        // only if "OK"
        if (req.status == 200) {
            // ...processing statements go here...
            var response = req.responseText;
            var array = new Array();
            array = response.split('\n');
            var method = array.shift();
            var obj = new objargument();
            obj.array = array;
            eval(method + '(obj)');
        } else {
            //alert("There was a problem retrieving the XML data:\n" + req.statusText);
        }
    }
}

function processReqChange1() {
    // only if req shows "loaded"
    if (req.readyState == 4) {
        // only if "OK"
        if (req.status == 200) {
            // ...processing statements go here...
            var response = req.responseText;
            update1(response);
        } else {
            //alert("There was a problem retrieving the XML data:\n" + req.statusText);
        }
    }
}
function update1(obj) {
  var smra = document.getElementById('smra');
  smra.innerHTML = "";
  smra.innerHTML = obj;
}

function objargument() {
  this.array = new Array;
}

function update(obj) {
  var i;
  var item;
  var s;
  var j = 0;
  for (i in obj.array)
  {
  	j++;
	item = obj.array[i];
	var a = item.split(':');
	var email	= a[0];
	var uid		= a[1];
	var pos		= a[2];
	var uname	= a[3];
	var sex		= a[4];
	var age		= a[5];
	var avatar	= a[6];
	var avatarsmall	= a[7];
	var years	= a[8];
	var ulocation	= a[9];
	document.getElementById("email"+j).href="http://www.mail.ru/agent?message&to="+email;
	document.getElementById("avatar"+j).src="http://avt.foto.mail.ru"+avatar;
	document.getElementById("emaildown"+j).href="http://www.mail.ru/agent?message&to="+email;
	document.getElementById("status"+j).src="http://status.mail.ru/?"+email;
	document.getElementById("name"+j).innerHTML=uname;
	var age_tmp = age + '&nbsp;';
	if (years == 1)
	{
		age_tmp += 'год';
	}
	else if (years == 2)
	{
		age_tmp += 'года';
	}
	else
	{
		age_tmp += 'лет';
	}
	if (age)
	{
		document.getElementById("age"+j).innerHTML=age_tmp;
	}
	else
	{
		document.getElementById("age"+j).innerHTML="";
	}
	if (sex==1)
	{
		document.getElementById("imgsex"+j).src="http://img.mail.ru/mail/ru/images/agent/ico_f.gif";
		document.getElementById("imgsex"+j).title="Девушка";
	}
	else
	{
		document.getElementById("imgsex"+j).src="http://img.mail.ru/mail/ru/images/agent/ico_m.gif";
		document.getElementById("imgsex"+j).title="Парень";
	}
  }
}

function reload1()
{
  var rand = Math.ceil(1000000000*Math.random());
  var url  = 'http://agent.mail.ru/mrasmstopu_load.html';
  clearInterval(id);
  loadXMLDoc(url+'?'+rand);
  id=setInterval('reload1()',60*1000);
  return;
}

function reload2()
{
  id=setInterval('reload1()',60*1000);
}

reload2();
