//var proxy_url = '/exec/proxy.php';
var ajax_url = '/ajax/ajax.php';
//var ajax_url2 = 'http://profile.segodnya.ua/ajax2.php';
var my_url = window.location;
$(document).ready(function() {
  function getCookie(name) {
	var matches = document.cookie.match(new RegExp(
	  "(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)"
	))
	return matches ? decodeURIComponent(matches[1]) : undefined
}
  var data = new Object();
  data.field = getCookie("nick");
  data.field2 = getCookie("key1");
  data.field3 = getCookie("key2");
  data.ajax_url = ajax_url;
  $.ajax({
    type: 'POST', url: ajax_url, dataType: 'html', data: data,
    success: function(res) {
      flag = res.substring(0, 2);
      if (flag != '0|')  $("#userinfo").html(res);
    },
    error: function(xhr, er_type) {  }
  });
});

