function CompareDate(d,d1,d2)
{
  if((new Date(d1.replace(/-/g,"\/")))<=(new Date(d.replace(/-/g,"\/"))))
  {
    if((new Date(d.replace(/-/g,"\/")))<=(new Date(d2.replace(/-/g,"\/"))))
    { return true }else{return false}
  }else{ return false ;}
}
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async="false";
xmlDoc.load("Ad_files/PopWin.xml");
nodes=xmlDoc.getElementsByTagName('DocumentElement')[0].childNodes;
var id;
var start_time,stop_time,today;
var now_time;
var width,height,left,top;
for(i=0;i<nodes.length;i++){
  id=nodes.item(i).childNodes.item(0).text;
  start_time=nodes.item(i).childNodes.item(1).text;
  stop_time=nodes.item(i).childNodes.item(2).text;
  width=nodes.item(i).childNodes.item(3).text;
  height=nodes.item(i).childNodes.item(4).text;
  content=nodes.item(i).childNodes.item(5).text;
  left = 200 + i * 20;
  top = 100 + i * 20;
  today=new Date();
  now_time = today.getYear()+"-"+(today.getMonth()+1)+"-"+today.getDate();
  if(CompareDate(now_time,start_time,stop_time)){
    popwin=window.open("about:blank","","toolbar=0,menubar=0,scrollbars=0,resizable=1,location=0,status=0,width="+width+",height="+height+",left="+left+",top="+top);
    popwin.document.write(content);
  }
}
