// Borrowed from addons.mozilla.org - thanks :) var PLATFORM_OTHER = 0; var PLATFORM_WINDOWS = 1; var PLATFORM_LINUX = 2; var PLATFORM_MACOSX = 3; var PLATFORM_MAC = 4; // Default to windows var gPlatform = PLATFORM_WINDOWS; if (navigator.platform.indexOf("Win32") != -1) gPlatform = PLATFORM_WINDOWS; else if (navigator.platform.indexOf("Linux") != -1) gPlatform = PLATFORM_LINUX; else if (navigator.userAgent.indexOf("Mac OS X") != -1) gPlatform = PLATFORM_MACOSX; else if (navigator.userAgent.indexOf("MSIE 5.2") != -1) gPlatform = PLATFORM_MACOSX; else if (navigator.platform.indexOf("Mac") != -1) gPlatform = PLATFORM_MAC; else gPlatform = PLATFORM_OTHER; var gPlatformVista = navigator.userAgent.indexOf('Windows NT 6.0') !=-1 // This function is used on the firstrun pages to show the correct image next to the // "click this close button" text function loadFirstRunInstallImage() { // The only thing we care about is if it's a mac, we're going to switch the // class, otherwise, stick with defaults. if (gPlatform == PLATFORM_MAC || gPlatform == PLATFORM_MACOSX) { _proxy_jslib_handle(_proxy_jslib_handle(document, 'getElementById', '')('tab-close'), 'setAttribute', '')('class','mac'); } } // Will change the class for the given element. This is currently used on // /index.html and /firefox/index.html function rotateBackgroundForDiv(div_id) { // We're leaving a blank in here, since that is another (default) image var class_options = new Array( "variation1", "variation2", "variation3" ); if (Math.random) { var choice = Math.floor(Math.random() * (class_options.length)); // Just in case javascript gets carried away... choice = ( (choice < class_options.length) && choice >= 0) ? choice : 0; if (_proxy_jslib_handle(document, 'getElementById', '')(div_id)) { _proxy_jslib_handle(_proxy_jslib_handle(document, 'getElementById', '')(div_id), 'setAttribute', '')('class',_proxy_jslib_handle(class_options, (choice))); } } } function createCookie(name,value,days, domain) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else { var expires = ""; } if(_proxy_jslib_handle(null, 'domain', domain)) { domain= _proxy_jslib_assign_rval('', 'domain', '=', ( "; "+_proxy_jslib_handle(null, 'domain', domain)), domain); } else { domain= _proxy_jslib_assign_rval('', 'domain', '=', ( ''), domain); } _proxy_jslib_assign('', document, 'cookie', '=', ( name+"="+_proxy_jslib_handle(null, 'value', value)+expires+"; path=/"+_proxy_jslib_handle(null, 'domain', domain))); } function getArgs() { var args = new Object(); var query = _proxy_jslib_handle(_proxy_jslib_handle(null, 'location', location), 'search', '').substring(1); var pairs = query.split("&"); for(var i = 0; i < pairs.length; i++) { var pos = _proxy_jslib_handle(pairs, (i)).indexOf('='); if (pos == -1) continue; var argname = _proxy_jslib_handle(pairs, (i)).substring(0,pos); var value = _proxy_jslib_handle(pairs, (i)).substring(pos+1); _proxy_jslib_assign('', args, (argname), '=', ( unescape(_proxy_jslib_handle(null, 'value', value)))); } return args; } function in_array(search, array) { var found = false; for(_proxy_jslib_handle(null, 'value', value) in array) { if(_proxy_jslib_handle(array, (_proxy_jslib_handle(null, 'value', value))) == _proxy_jslib_handle(null, 'search', search)) { found = true; } } return found; } ; _proxy_jslib_flush_write_buffers() ;