

function loadXMLDoc(url){
  req = false;
  if(window.XMLHttpRequest) {
    try {
      req = new XMLHttpRequest();
    } catch(e) {
      req = false;
    }
  } 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.open("GET", url, true);
    req.send("");
    reqTimeout = setTimeout("req.abort();", 5000);

    req.onreadystatechange = function(){




//Если обмен данными завершен
if (req.readyState == 4){

     // Передаем управление обработчику
        if (req.status == 200)  {

var nl = req.responseXML.getElementsByTagName('data');
var nli = nl.item(0);

//
//alert(nli.getAttribute('boolean').toString());


if(nli.getAttribute('boolean').toString() > 0) {
//opener.window.reload();
//'msg'+id
//
//
//f.opener.document.frames['shp'].reload();
//
play();

//MsgsWndw = eval('msg'+ auth_id);
if (!MsgWndw.closed) {
MsgWndw.IfReload(nli.getAttribute('boolean').toString());

}
/*




//else { }

*/

return true;
 }

return false;

}


// Оповещаем о произошедшей ошибке
      } 

//Оповещаем о загрузке
    }


return false;

         }
 
return false;
}



function play() {
//document.all.sound.src = "/img/msg.swf";
//document.sound.src = "/img/msg.swf";
//document.sound.play();
playSound('/img/msg.swf');
}




function _ajax_msg_sound(){

//alert(Host+'/inc/_xml_msg_sound.php?id='+auth_id);
loadXMLDoc(Host+'/inc/_xml_msg_sound.php?id='+auth_id);

//if(loadXMLDoc(Host+'/inc/_xml_msg_sound.php?id='+auth_id)) {
//opener.window.reload();
//'msg'+id
//alert('errrrrrrr');
//f.opener.document.frames['shp'].reload();
//play();
return true;

//     }
     
}



function blendMe() {

//window.parent.document.getElementById("ИД")

//window.parent.frames["wshp"].location = "http://photoo.loc/";

//window.parentWindow.IfReload();
//alert(window.document.frames["wshp"].document);window.

//parent.frames["wshp"].location = "http://photoo.loc/";
//f.frames[0].location.reload();.src.location   frames("wshp").
//window.opener.frames[0].location.reload();
//.reload();
//window.opener.document.getElementById('shp').reload();document.
//window.opener.document.bgColor='cyan'opener.
//alert(auth_id);
//window.opener.document.all.shp.reload();
//document.all.shp.src = "/index.php";
//f.document.frames['shp'].src = "/index.php";
//window.parent.iframe("shp").location.reload();.opener.document

//window.opener.document.frames['shp'].location.reload();
//window.opener.frames("shp").location.reload();
//window.frames['shp']opener.
//

//auth_id = getCookie('auth_id');
//
if (auth_id == 0) {
return;
   }

_ajax_msg_sound();
window.setTimeout("blendMe()", 15000);

}


//
blendMe();

