﻿var _doc = document;
var popupEl = null;
var tempX = 0;
var tempY = 0;
var IE = document.all?true:false
// If NS -- that is, !IE -- then set up for mouse capture
if (!IE) document.captureEvents(Event.MOUSEMOVE)
// Set-up to use getMouseXY function onMouseMove
document.onmousemove = function(event){ getMPos(event) };

function getMPos(e) {
    var tempX = 0;
    var tempY = 0;
  if (IE) { // grab the x-y pos.s if browser is IE
    tempX = event.clientX + document.body.scrollLeft;
    tempY = event.clientY + document.body.scrollTop;
  } else {  // grab the x-y pos.s if browser is NS
    tempX = e.pageX;
    tempY = e.pageY;
  } 
  return true
}
function sizePopupViewUOID(left,top,width,height,step) {
	var html, mouse;
	width = width + 15;	
	height = height + 4;
	left = left -10;
	//top = top -1;
	sX(popupEl, left);
	sY(popupEl, top);
	sW(popupEl, width);
	sH(popupEl, height);
	if (width < 340) {
		setTimeout("sizePopupViewUOID("+left+","+top+","+width+","+height+","+(step-1)+")",0);
	} else {
	
		temp = '<div class="content"><h5>Transaction UOID<span><a href="#"><img src="http://my.paysociety.com/images/Cross.gif" width="21" height="21" border="0" alt="Close" title="Close" onclick="deleteThis()"/></a></span></h5>';
		temp = temp + '<iframe frameborder="0" width="350" height="86" src="view_UOID.aspx" class="mailframeUOID" marginwidth="0px"></iframe>';
		temp = temp + '</div>'; 
		popupEl.innerHTML = temp;
		};
}
function sX(e,x){e.style.left=x+'px'}
function sY(e,y){e.style.top=y+'px'}
function sW(e,w){e.style.width=w+'px'}
function sH(e,h){e.style.height=h+'px'}

function sizePopupViewAddress(left,top,width,height,step) {
	var html, mouse;
	width = width + 15;	
	height = height + 20;
	left = 580;
	top = 143;
	sX(popupEl, left);
	sY(popupEl, top);
	sW(popupEl, width);
	sH(popupEl, height);
	if (width < 340) {
		setTimeout("sizePopupViewAddress("+left+","+top+","+width+","+height+","+(step-1)+")",0);
	} else {
		temp = '<div class="content"><h5>Address Detail<span><a href="#"><img src="http://my.paysociety.com/images/Cross.gif" width="21" height="21" border="0" alt="Close" title="Close" onclick="deleteThis()"/></a></span></h5>';
		temp = temp + '<iframe frameborder="0" width="350" height="306" src="view_address.aspx" class="mailframeadrs" marginwidth="0px"></iframe>';
		temp = temp + '</div>'; 
		popupEl.innerHTML = temp;
	};
}

function sizePopupViewBank(left,top,width,height,step) {
	var html, mouse;

	width = width + 15;	
	height = height + 20;

	left = 580;
	top = 143;
	sX(popupEl, left);
	sY(popupEl, top);

	sW(popupEl, width);
	sH(popupEl, height);
	if (width < 340) {
		setTimeout("sizePopupViewBank("+left+","+top+","+width+","+height+","+(step-1)+")",0);
	} else {
		temp = '<div class="content"><h5>Bank A/C Detail<span><a href="#"><img src="http://my.paysociety.com/images/Cross.gif" width="21" height="21" border="0" alt="Close" title="Close" onclick="deleteThis()"/></a></span></h5>';
		temp = temp + '<iframe frameborder="0" width="350" height="306" src="view_bank.aspx" class="mailframe" marginwidth="0px" scrolling="no"></iframe>';
		temp = temp + '</div>'; 
		popupEl.innerHTML = temp;
	};
}

function deleteThis() {
	if (popupEl) {
		var code = '_doc.body.removeChild(popupEl);popupEl=null;'
		eval(code);
	};
	document.onmousemove = function(event){ getMPos(event) };
}

function cPopUpViewAddress() {	
	if (!popupEl) {
		popupEl = _doc.createElement('div');
		popupEl.className = 'pop_sendafriendbox';
		
		_doc.body.appendChild(popupEl);	
		
		popupEl.style.left	= '10px';
		popupEl.style.top	= '10px';

		popupEl.innerHTML = '<div class="content"></div>';
		sizePopupViewAddress(tempX-100,tempY-2,140,50,10);
	};
};

function cPopUpViewBank() {	
	if (!popupEl) {
		popupEl = _doc.createElement('div');
		popupEl.className = 'pop_sendafriendbox';
		
		_doc.body.appendChild(popupEl);	
		
		popupEl.style.left	= '10px';
		popupEl.style.top	= '10px';

		popupEl.innerHTML = '<div class="content"></div>';
		sizePopupViewBank(tempX-100,tempY-2,140,50,10);
	};
};	

function cPopUpViewUOID() {	
	if (!popupEl) {
		popupEl = _doc.createElement('div');
		popupEl.className = 'pop_sendafriendbox';
		
		_doc.body.appendChild(popupEl);	
		
		popupEl.style.left	= '10px';
		popupEl.style.top	= '10px';

		popupEl.innerHTML = '<div class="content"></div>';
		sizePopupViewUOID(tempX-100,tempY-2,140,50,10);
	};
};	
