if(window.location.pathname.substring(4)!="index.html"){
  window.onLoad=setTimeout('checkFrame();', 500);
}else{
  window.onLoad=setTimeout('reloadIt();', 500);
}

function reloadIt(){
  var reloadSide = window.location.search.substring(8);
  parent.frames["main"].location.href=reloadSide;
}

function checkFrame(){
  if(parent.frames[0]==null){
    // reload in frame
    var thisSide = window.location.pathname.substring(4);
    location.href='./index.html?reload='+thisSide;
  }
}
