From: Subject: Mustkiirguri spekter 2.01 Date: Sat, 30 Oct 2010 20:06:26 +0300 MIME-Version: 1.0 Content-Type: multipart/related; type="text/html"; boundary="----=_NextPart_000_0000_01CB786D.EEFA71B0" X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5994 This is a multi-part message in MIME format. ------=_NextPart_000_0000_01CB786D.EEFA71B0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Location: http://phet.colorado.edu/sims/blackbody-spectrum/blackbody-spectrum_et.html Mustkiirguri spekter = 2.01 ------=_NextPart_000_0000_01CB786D.EEFA71B0 Content-Type: application/octet-stream Content-Transfer-Encoding: quoted-printable Content-Location: http://phet.colorado.edu/js/autoTracking_phet.js var docIdentifier =3D '/download';=0A= var simIdentifier =3D ''; // No identifier for now=0A= =0A= function listenToClicks() {=0A= var domains =3D ["phet.colorado.edu"];=0A= var fileTypes =3D = [".doc",".xls",".exe",".zip",".pdf",".mp3",".bin"];=0A= =0A= if (document.getElementsByTagName) {=0A= var aTags =3D document.getElementsByTagName('a');=0A= =0A= ANCHOR:=0A= for (var i =3D 0; i < aTags.length; i++) {=0A= if (aTags[i]=3D=3D"") = { continue ANCHOR; }=0A= if (typeof aTags[i].hostname =3D=3D "undefined") = { continue ANCHOR; }=0A= if (aTags[i].protocol.indexOf("javascript") !=3D -1) = { continue ANCHOR; }=0A= =0A= DOMAIN:=0A= for (var j =3D 0; j < domains.length; j++) {=0A= if (aTags[i].href.indexOf(domains[j]) !=3D -1) { //if = the anchor tag we're checking matches a domain from our list=0A= =0A= FILE:=0A= // look for a file extension=0A= for (k =3D 0; k < fileTypes.length; k++){=0A= if (aTags[i].pathname.indexOf(fileTypes[k]) !=3D = -1) {=0A= // file extension was found, go to next = anchor=0A= = startListening(aTags[i],"click",trackDocuments);=0A= continue ANCHOR;=0A= }=0A= }=0A= =0A= // look for a sim file extension for direct download=0A= if (=0A= (aTags[i].pathname.indexOf(".jnlp") !=3D -1) &&=0A= (aTags[i].pathname.indexOf("sims") !=3D -1)) {=0A= // file extension was found, go to next anchor=0A= startListening(aTags[i],"click",trackOnlineSims);=0A= continue ANCHOR;=0A= }=0A= =0A= // look for a sim that is run offline=0A= if (aTags[i].pathname.indexOf("get-run-offline") = !=3D -1) {=0A= // file extension was found, go to next anchor=0A= = startListening(aTags[i],"click",trackOfflineSims);=0A= continue ANCHOR;=0A= }=0A= =0A= // file extension was not found, see if we should = use Linker=0A= if (window.location.href.indexOf(domains[j]) =3D=3D = -1) { // and our current location.href does not match=0A= // then use _link and go to the next anchor tag=0A= startListening(aTags[i],"click",useLinker);=0A= continue ANCHOR;=0A= }=0A= else {=0A= // otherwise it is a link on the same domain, so = just go to the next anchor tag=0A= continue ANCHOR;=0A= }=0A= }=0A= }=0A= =0A= // if we were tracking external links, we would do it here, = after looping through all of the domains in our list and not finding a = match.=0A= =0A= }=0A= }=0A= }=0A= =0A= function startListening (obj,evnt,func) {=0A= if (obj.addEventListener) {=0A= obj.addEventListener(evnt, func, false);=0A= } else if (obj.attachEvent) {=0A= obj.attachEvent("on" + evnt, func);=0A= }=0A= }=0A= =0A= function useLinker (evnt) {=0A= var lnk;=0A= if (evnt.srcElement) {=0A= var elmnt =3D evnt.srcElement;=0A= while (elmnt.tagName !=3D "a") {=0A= var newelmnt =3D elmnt.parentNode;=0A= elmnt =3D newelmnt;=0A= }=0A= lnk =3D "http://" + elmnt.hostname + "/" + elmnt.pathname + = elmnt.search;=0A= }=0A= else {=0A= lnk =3D "http://" + this.hostname + this.pathname + this.search;=0A= }=0A= =0A= if (typeof(benchmarkTracker) =3D=3D "object") {=0A= benchmarkTracker._link(lnk);=0A= if (evnt.preventDefault) {=0A= evnt.preventDefault();=0A= }=0A= else {=0A= evnt.returnValue=3Dfalse;=0A= }=0A= =0A= return false;=0A= }=0A= =0A= // Remove warnings in the console=0A= return undefined;=0A= }=0A= =0A= // trackDocuments: calls _trackPageview before downloading a file=0A= function trackDocuments (evnt) {=0A= var url =3D (evnt.srcElement) ? "/" + evnt.srcElement.pathname : = this.pathname;=0A= url =3D docIdentifier + url;=0A= if (typeof(benchmarkTracker) =3D=3D "object") {=0A= benchmarkTracker._trackPageview(url);=0A= }=0A= =0A= if (typeof(overallTracker) =3D=3D "object") {=0A= overallTracker._trackPageview(url);=0A= }=0A= }=0A= =0A= function trackOnlineSims(evnt) {=0A= var url =3D (evnt.srcElement) ? "/" + evnt.srcElement.pathname : = this.pathname;=0A= url =3D simIdentifier + url;=0A= if (typeof(benchmarkTracker) =3D=3D "object") {=0A= benchmarkTracker._trackPageview(url);=0A= }=0A= =0A= if (typeof(overallTracker) =3D=3D "object") {=0A= overallTracker._trackPageview(url);=0A= }=0A= }=0A= =0A= function trackOfflineSims(evnt) {=0A= target =3D (evnt.srcElement) ? evnt.srcElement : this;=0A= // Get the pathname including the query string=0A= // TODO: make efficient=0A= idx =3D target.href.indexOf(target.pathname);=0A= url =3D simIdentifier + target.href.substr(idx);=0A= if (typeof(benchmarkTracker) =3D=3D "object") {=0A= benchmarkTracker._trackPageview(url);=0A= }=0A= =0A= if (typeof(overallTracker) =3D=3D "object") {=0A= overallTracker._trackPageview(url);=0A= }=0A= }=0A= =0A= // register an event listener to run the script when the load event = fires.=0A= startListening(window, 'load', listenToClicks);=0A= ------=_NextPart_000_0000_01CB786D.EEFA71B0--