String.prototype.endsWith = function (s) {
    var start = this.length - s.length;
    return this.substring(start) == s;
};

var full = new YAHOO.util.Element('fullscreen');
var map = new YAHOO.util.Element('map');
full.on('click', function(e) { 
	if (full.get('src').endsWith('maximize.jpg')) { 
        full.set('src', 'images/minimize.jpg');
        var h = YAHOO.util.Dom.getViewportHeight() - 40;
        map.setStyle('height', h + 'px');
	} else {
        full.set('src', 'images/maximize.jpg');
        var h = YAHOO.util.Dom.getViewportHeight() - 40;
        map.setStyle('height', '390px');
	}
    map.set('src', 'http://trafficnz.net/map.html?');
});

function openSignup() {
  day = new Date();
  id = day.getTime();
  eval("page" + id + " = window.open('/signup.html', '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width=430,height=490');");
}

function openHelp() {
  day = new Date();
  id = day.getTime();
  eval("page" + id + " = window.open('/maphelp.html', '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width=430,height=490');");
}

