﻿// JScript File

function externalLinks() {

 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
 }

}

function doTrack(url)
{
	try {
		var request1 = new asyncRequest.ContentLoader(url, defaultAsyncOnload);
	} catch (e1) {
		alert('error: ' + e1);
	}

}

function defaultAsyncOnload() {
	//alert (this.url + " loaded: \n\n" + this.req.responseText);
	//loadXML(this.req.responseXML);
}


//Popup positioning used on landing and dm pages
var cX = 0; var cY = 0; 
if(document.all) { document.onmousemove = UpdateCursorPositionDocAll; }
else { document.onmousemove = UpdateCursorPosition; }

function UpdateCursorPosition(e){ 
    cX = e.pageX;
    cY = e.pageY;
}

function UpdateCursorPositionDocAll(e){ 
    cX = event.clientX; 
    cY = event.clientY;
}

function AssignPosition(d, width, height) {
    d.style.left = (cX-width) + "px";
    d.style.top = (cY-height) + "px";
}

function getViewport()
    {
    if (self.innerHeight) // all except Explorer
    {
	    this.x = self.innerWidth;
	    this.y = self.innerHeight;
    }
    else if (document.documentElement && document.documentElement.clientHeight)
	    // Explorer 6 Strict Mode
    {
	    this.x = document.documentElement.clientWidth;
	    this.y = document.documentElement.clientHeight;
    }
    else if (document.body) // other Explorers
    {
	    this.x = document.body.clientWidth;
	    this.y = document.body.clientHeight;
    }
}
//end Popup positioning