function ruon_gup(url, name){
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec(url);
  if( results == null )
    return "";
  else
    return results[1];
}

function ruon_checkFrame() {
    if (window.parent==window) {
        if (window.location.href.indexOf("&topicID=")>0) {
            var topic = ruon_gup(window.location.href, "topicID");
            window.top.location = "http://www.r-u-on.com/ctrl?action=forum&topic="+topic;
        } else {
            window.top.location = "http://www.r-u-on.com/ctrl?action=forum"
        }
    }
}

ruon_checkFrame();
