var frame_url = encodeURI(window.location.pathname+window.location.search);
var frame_host =  window.location.hostname;
document.write('<SCRIPT LANGUAGE="JavaScript">')
document.write('if (parent.frames.length < 1)')
document.write('{')
document.write('document.location.href = "http://"+frame_host+"/index.php?page="+frame_url;')
document.write('}')
document.write('</SCRIPT>')
