function getPageSize() {
	        
	     var xScroll, yScroll;
		
		if (window.innerHeight && window.scrollMaxY) {	
			xScroll = window.innerWidth + window.scrollMaxX;
			yScroll = window.innerHeight + window.scrollMaxY;
		} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
			xScroll = document.body.scrollWidth;
			yScroll = document.body.scrollHeight;
		} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
			xScroll = document.body.offsetWidth;
			yScroll = document.body.offsetHeight;
		}
		
		var windowWidth, windowHeight;
		
		if (self.innerHeight) {	// all except Explorer
			if(document.documentElement.clientWidth){
				windowWidth = document.documentElement.clientWidth; 
			} else {
				windowWidth = self.innerWidth;
			}
			windowHeight = self.innerHeight;
		} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
			windowWidth = document.documentElement.clientWidth;
			windowHeight = document.documentElement.clientHeight;
		} else if (document.body) { // other Explorers
			windowWidth = document.body.clientWidth;
			windowHeight = document.body.clientHeight;
		}	
		
		// for small pages with total height less then height of the viewport
		if(yScroll < windowHeight){
			pageHeight = windowHeight;
		} else { 
			pageHeight = yScroll;
		}
	
		// for small pages with total width less then width of the viewport
		if(xScroll < windowWidth){	
			pageWidth = xScroll;		
		} else {
			pageWidth = windowWidth;
		}

		return [pageWidth,pageHeight];
	}


function addClass(element, value) {
   if (!element.className) {
   element.className = value;
   } else {
   var newClassName = element.className;
   newClassName += " ";
   newClassName += value;
   element.className = newClassName;
   }
}

function myPop() { 
    this.square = null;
    this.overdiv = null;

    this.popOut = function(msgtxt,user) {
        //filter:alpha(opacity=25);-moz-opacity:.25;opacity:.25;
        this.overdiv = document.createElement("div");
        this.overdiv.className = "overdiv";

        this.square = document.createElement("div");
        this.square.className = "square";
        this.square.Code = this;
        var msg = document.createElement("div");
        msg.className = "msg";
        msg.innerHTML = msgtxt;
        this.square.appendChild(msg);        
		var aggreebtn = document.createElement("button");
		var dontagreebtn = document.createElement("button");	
		addClass(aggreebtn, "agree");
		addClass(dontagreebtn, "disagree");
        aggreebtn.onclick = function() {
            if (user == 'hcp'){
			 window.location.href = "http://localhost:3926/display.aspx?id=319&child=319&myparent=312&showgrndchild=1&topParent=4";}
			if (user == 'patient'){
			 window.location.href = "http://localhost:3926/display.aspx?id=324&child=324&myparent=321&showgrndchild=1&topParent=2";}
			if(user == 'patientfaq'){
			  window.location.href = "http://localhost:3926/display.aspx?id=324&child=324&myparent=321&showgrndchild=1&topParent=2";}
            if(user == 'hcpfaq'){
              window.location.href = "http://localhost:3926/display.aspx?id=324&child=324&myparent=321&showgrndchild=1&topParent=2";}			  
			this.parentNode.Code.popIn();
        }
        aggreebtn.innerHTML = "I agree and I wish to proceed";
        this.square.appendChild(aggreebtn);
		
		 dontagreebtn.onclick = function() {            
			this.parentNode.Code.popIn();
        }
		
		dontagreebtn.innerHTML="I do not wish to proceed";
		this.square.appendChild(dontagreebtn);

        document.body.appendChild(this.overdiv);
        document.body.appendChild(this.square);
    }
    this.popIn = function() {
        if (this.square != null) {
            document.body.removeChild(this.square);
            this.square = null;
        }
        if (this.overdiv != null) {
        document.body.removeChild(this.overdiv);
        this.overdiv = null;
        }

    }
}
