try doing this.. just look at their javascript and copy it...
what I do when i want to know something I take the whole page, fix the urls so they are complete urls then I start taking code by code out until what I want it works...
Code:
<script type=text/javascript src="https://mail.google.com/mail?view=page&name=browser"></script>
<script type=text/javascript>
<!--
var start_time = (new Date()).getTime();
if ((top.location != self.location)&&(top.location.href.indexOf('https://www.google.com/analytics/siteopt/preview')!=0)) {
top.location = self.location.href;
}
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 != '&') 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 = [
[ 1175414400000, 2835 ],
[ 1192176000000, 2912 ],
[ 1193122800000, 4321 ],
[ 1199433600000, 6283 ],
[ 2147328000000, 43008 ],
[ 46893711600000, Number.MAX_VALUE ]
];
var quota;
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) {
quota = el("quota");
updateQuota();
}
LoadConversionScript();
}
function updateQuota() {
if (!quota) {
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.innerHTML = CP[i - 1][1];
} else {
var ts = CP[i - 1][0];
var bs = CP[i - 1][1];
quota.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>
then add this..
<span id=quota>2757.272164</span>
not really sure if this is right...
Bookmarks