// JavaScript Document


//alert("Components.aspx");
uName="";
function zix_setup(){
	document.write("<div id='zixFloat'>");
	document.write("<span id='closeX' onmouseover='hideZIX();'></span>");
	document.write("<div id='zixText'>");
	document.write("This is the ZIX div");
	document.write("</div></div>");
}	
	//document.onmousedown=mouseMoved;

	function mousePoint(x,y) {
	   this.x = x;
	   this.y = y;
	   
	   this.x = x;
	   this.y = y;
	}
	
	function mousePosition(evt){
	  var x = parseInt(evt.clientX);   
	  var y = parseInt(evt.clientY);   
	  return new mousePoint(x,y);
	}
	
	function xmouseMoved(evt){
		var mousePos  = mousePosition(evt);
		var ZWin=document.getElementById("zixFloat");
		writeMe(uName);
		//ZWin.style.top=(mousePos.y-40)+"px";	//Height is 320
		//ZWin.style.left=(mousePos.x-200)+"px";	//Width is 400
		
		ZWin.style.top=(yMousePos)+"px";	//Height is 320
		ZWin.style.left=(xMousePos)+"px";	//Width is 400
	}
	
	function writeMe(refName){
		document.getElementById('zixText').innerHTML="<h2>First Time Users</h2>";
		document.getElementById('zixText').innerHTML+="<p>If this is your first time using the Secure Messaging Center, you will need to create an account. <a href='https://securemail.members1st.org/s/preregister?b=members1st' target='_new' >Click here</a> to create a new account.</p>";
		//document.getElementById('zixText').innerHTML+="<a href='videoAssistant.aspx' class='assist'><span class='ass'></span><span class='arrowRed'></span>HOW DO I CREATE AN ACCOUNT?</a>";
		document.getElementById('zixText').innerHTML+="<div class='zixDivider'></div>";
		document.getElementById('zixText').innerHTML+="<h2>Returning Users</h2>";
		document.getElementById('zixText').innerHTML+="<p>If you have already created an account, <a href='https://securemail.members1st.org/' target='_new' >click here to sign in</a>.</p>";
		document.getElementById('zixText').innerHTML+="<p class='youNeed'>After signing in, select <strong class='red'>"+refName+"</strong> from the drop down list to send your message to the appropriate person or department.</p>";
		//document.getElementById('zixText').innerHTML+="<a href='videoAssistant.aspx' class='assist'><span class='ass'></span><span class='arrowRed'></span>HOW DO I LOGIN IF I ALREADY CREATED AN ACCOUNT?</a>";
		document.getElementById('zixText').innerHTML+="<a href='http://www.zixhelp.com/zixport/3.8/en/webhelp/portalhelp.htm' target='_blank' class='assist'><span class='arrowRed'></span><span classs='speedbump'><span></span></span>FOR ASSISTANCE WITH THE SECURE EMAIL PORTAL, CLICK HERE.</a>";
		//document.getElementById('zixText').innerHTML+="<div class='zixDivider'></div>";	
	}
	
	function hideZIX(){
		var ZWin=document.getElementById("zixFloat");
		ZWin.style.top=0;
		ZWin.style.left=-5000+"px";
	}




// Set Netscape up to run the "captureMousePosition" function whenever
// the mouse is moved. For Internet Explorer and Netscape 6, you can capture
// the movement a little easier.
if (document.layers) { // Netscape
    document.captureEvents(Event.MOUSEMOVE);
    document.onmousemove = captureMousePosition;
} else if (document.all) { // Internet Explorer
    document.onmousemove = captureMousePosition;
} else if (document.getElementById) { // Netcsape 6
    document.onmousemove = captureMousePosition;
}
// Global variables
xMousePos = 0; // Horizontal position of the mouse on the screen
yMousePos = 0; // Vertical position of the mouse on the screen
xMousePosMax = 0; // Width of the page
yMousePosMax = 0; // Height of the page

function captureMousePosition(e) {
    if (document.layers) {
        // When the page scrolls in Netscape, the event's mouse position
        // reflects the absolute position on the screen. innerHight/Width
        // is the position from the top/left of the screen that the user is
        // looking at. pageX/YOffset is the amount that the user has 
        // scrolled into the page. So the values will be in relation to
        // each other as the total offsets into the page, no matter if
        // the user has scrolled or not.
        xMousePos = e.pageX;
        yMousePos = e.pageY;
        xMousePosMax = window.innerWidth+window.pageXOffset;
        yMousePosMax = window.innerHeight+window.pageYOffset;
    } else if (document.all) {
        // When the page scrolls in IE, the event's mouse position 
        // reflects the position from the top/left of the screen the 
        // user is looking at. scrollLeft/Top is the amount the user
        // has scrolled into the page. clientWidth/Height is the height/
        // width of the current page the user is looking at. So, to be
        // consistent with Netscape (above), add the scroll offsets to
        // both so we end up with an absolute value on the page, no 
        // matter if the user has scrolled or not.
        xMousePos = window.event.x+document.body.scrollLeft;
        yMousePos = window.event.y+document.body.scrollTop;
        xMousePosMax = document.body.clientWidth+document.body.scrollLeft;
        yMousePosMax = document.body.clientHeight+document.body.scrollTop;
    } else if (document.getElementById) {
        // Netscape 6 behaves the same as Netscape 4 in this regard 
        xMousePos = e.pageX;
        yMousePos = e.pageY;
        xMousePosMax = window.innerWidth+window.pageXOffset;
        yMousePosMax = window.innerHeight+window.pageYOffset;
    }
}


function mouseMoved(){
	//alert("Mouse Moved"+uName);
	window.location="/SMS.aspx?refer="+uName;
}
