    try {
      ajax_method = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e1) {
      try {
        ajax_method = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (e2) {
        ajax_method = null;
      }
    }

    if (!ajax_method) {
      if (typeof XMLHttpRequest != "undefined") {
        ajax_method = new XMLHttpRequest();
      } else {
        failed = true;
      }
    };
	
	function updatephoto(){
	 loadlink();
	 setTimeout("updatephoto()", 10000);
	}
	function synchronize(src){
	 if(src){
	  var div = document.getElementById('ajaxphoto');
	  var temp = new Array();
	  temp = src.split('|');
	  div.style.width = temp[2] + "px";
	  div.style.height = temp[3] + "px";
	  var img = document.getElementById('ajaxphotoimg');
	  img.style.marginTop=temp[4]+"px";
	  img.style.marginLeft=temp[5]+"px";
	  img.src = "/"+temp[0];
	  img.parentNode.href="/"+temp[1];
	 }
	}
	function loadlink(){
	 ajax_method.onreadystatechange = function(){
	  if(ajax_method.readyState == 4 && ajax_method.status == 200){
	   synchronize(ajax_method.responseText);
	  }
	 };
	 ajax_method.open( "GET", '/sites/all/themes/milikowice/includes/randomPhoto.php');
	 ajax_method.send(null);
	}
