// ==UserScript==
// @name           Gaia Redirect Frame Remover
// @namespace      http://techspeak.2ya.com/
// @description    Removes the redirect frame from Gaia's redirect pages. Warns you with a pop-up when needed. Idea from dantman.
// @include        *gaiaonline.com/gaia/redirect.php?r=*
// ==/UserScript==
(function()
{
	var url=document.getElementsByTagName('frame')[1].src;
	if(url.indexOf('gaiaonline.com')==-1)
	{
		var warn=window.open('','warn','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+600+',height='+100+',left='+parseInt((screen.width/2)-300)+',top='+parseInt((screen.height/2)-50)+',screenX='+parseInt((screen.width/2)-300)+',screenY='+parseInt((screen.height/2)-50));
		warn.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head>
<link rel="icon" href="/animated_favicon1.gif" type="image/gif" /><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>Warning ! - WindPower\\\'s Redirect Frame Remover</title><script language="javascript" type="text/javascript">var tim=3;function timout(){tim--;document.getElementById(\'clo\').innerHTML=\'Auto closing in \'+tim+\' seconds.\';if(tim==0){document.getElementById(\'clo\').innerHTML=\'<input type="button" value="Close Window" onclick="window.close();" />\';window.close();}}</script></head><body bgcolor="#fef0ee"><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#fef0ee"><tr><td width="57"><img src="http://graphics.gaiaonline.com/images/template/quick/quick_10_on.gif" width="57" height="57" alt="Attention!" /></td><td><span style="font-size: 16px; font-weight: bold; color: #FF0000;">Attention!</span><br /><span style="font-size: 12px;">The site you are accessing below is not part of Gaia Online.<strong> This site should not ask for your Gaian Password. </strong>If they do, please report this site to an online moderator.<br /><div align="right"><a href="javascript:window.close();">[Click here to close this window]</a></div><div id="clo">Auto closing in 3 seconds.</div></span></td></tr></table><script>setInterval(\'timout();\',1000);</script></body></html>');
	}
	top.location.href=url;
})();
