	var browser = new Browser();
	
	function WindowClass( content )
	{
		var innerTable;
		var innerTr;
		var innerTd;
		var temp;

		this.isOpen = false;

		this.Body = null;
		this.BodyFrame = null;
		this.closeButton = null;
		this.contentFrame = null;

		this.Body = document.createElement("div");
		this.Body.id = "proactiveWindow";
		this.Body.className = "MainContainer";
		this.Body.style.position = "absolute";
		this.Body.style.zindex = 9999;
		this.Body.style.display = "block";
		//this.Body.style.top = screen.availHeight / 2;
		//this.Body.style.left = screen.availWidth / 2;
		//this.Body.style.top = "500";
		//this.Body.style.left = "500";
		
		//this.Body.height = "169";
		//this.Body.width = "224";
		document.body.appendChild( this.Body );
		
		this.BodyFrame = document.createElement("iframe");
		this.BodyFrame.id = "proactiveFrame";
		this.BodyFrame.style.position = "absolute";
		this.BodyFrame.zindex = this.Body.style.zindex - 1;
		this.BodyFrame.style.width = this.Body.offsetWidth;
		this.BodyFrame.style.height = this.Body.offsetHeight;
		this.BodyFrame.style.top = this.Body.style.top;
		//this.BodyFrame.style.top = "500";
		this.BodyFrame.style.left = this.Body.style.left;
		//this.BodyFrame.style.left = "500";
		this.BodyFrame.style.display = "block";
		this.BodyFrame.style.filter = "alpha(opacity=0)";
		this.BodyFrame.style.opacity = "0";
		this.BodyFrame.frameBorder = "no";
		document.body.appendChild( this.BodyFrame );

		this.closeButton = document.createElement("div");
		this.closeButton.className = "CloseImage";
		this.closeButton.onclick = CancelProactive;
		this.closeButton.height = "18";
		this.closeButton.width = "73";
		this.closeButton.innerHTML = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
		this.Body.appendChild( this.closeButton );

		this.contentFrame = document.createElement("div");
		this.contentFrame.id = 'divProactiveText';
		this.contentFrame.className = "TextContainer";
		this.contentFrame.onclick = AcceptProactive;
		this.contentFrame.innerHTML = content;
		this.Body.appendChild( this.contentFrame );

		document.SetTimeOut = 'false';
	}
	WindowClass.prototype.Show = function()
	{
		BodyScrolled();
		attachEvent( 'onscroll', BodyScrolled);
		this.Body.style.display = "block";	
	}
	function AcceptProactive()
	{
		userChoiceHandler( 'YES' )
	}
	function CancelProactive()
	{
		userChoiceHandler( 'NO' )
	}
	function userChoiceHandler( statusValue )
	{
		hidewindow();
		try
		{
			head = document.getElementsByTagName('head').item(0);
			script = document.createElement('script');
			script.type = 'text/javascript';
			
			script.src = strBuyerURL + "ProActiveRequestMessage.aspx?LocationID=" + document.LocationID + "&CompanyID=" + document.CompanyID + "&TeamID=" + document.TeamID + "&BuyerStatus=" + statusValue;

			script.defer = true;

			void(head.appendChild(script));
		}
		catch(err)
		{}
		
		try
		{
			if( statusValue == 'YES' )
			{
				var top = (screen.availHeight / 2 ) - 250;
				var left = (screen.availWidth / 2 ) - 186;
				window.open( document.NewWindowLoaction, '', 'scrollbars=yes,toolbars=no,resizable=no,status=no,height=500,width=370,top=' + top + ',left=' + left );				
				//window.open( document.NewWindowLoaction, '', 'scrollbars=yes,toolbars=no,resizable=no,status=no,height=368,width=216,left=500,top=0' );				
			}
		}
		catch( err ){}
	}
	function hidewindow()
	{
		////It doesnt work in Mozilla Firefox//////
		if (browser.isIE)
		{
			detachEvent( 'onscroll', BodyScrolled );
		}
		//document.getElementById( "proactiveWindow" ).style.display = "none";
		document.body.removeChild(document.getElementById( "proactiveFrame" ));
		document.body.removeChild(document.getElementById( "proactiveWindow" ));
	}
	function BodyScrolled()
	{
		var h,w;
		var height = getWinHeight();
		//h = document.body.scrollTop + (document.body.clientHeight / 2 ) - (document.getElementById( "proactiveWindow" ).offsetHeight / 2);
		h = document.body.scrollTop + (height / 2) - (document.getElementById( "proactiveWindow" ).offsetHeight / 2);		
		//alert(h);
		if( h < 0 ) h = 0;
				
		var width = getWinWidth();
		w = document.body.scrollLeft + (width / 2 ) - (document.getElementById( "proactiveWindow" ).offsetWidth / 2);
		//alert(w);
				
		if (browser.isIE)
		{
			CenterInIE(h,w);
		}
		else
		{
			CenterInOtherBrowser(h,w);
		}		
	}
	
	function getWinWidth()
	{
		var width = 0;
		if (window.innerWidth) width = window.innerWidth - 18;
		else if (document.documentElement && document.documentElement.clientWidth) 
  			width = document.documentElement.clientWidth;
		else if (document.body && document.body.clientWidth) 
  			width = document.body.clientWidth;
  		return width;
	}
	
	function getWinHeight() 
	{
		var height = 0;
		if (window.innerHeight) height = window.innerHeight - 18;
  		else if (document.documentElement && document.documentElement.clientHeight) 
  			height = document.documentElement.clientHeight;
  		else if (document.body && document.body.clientHeight) 
  			height = document.body.clientHeight;
  			
  		return height;
	}
	
	function CenterInIE(h,w)
	{
		//alert('CenterInIE called');
		document.getElementById( "proactiveFrame" ).style.top = h;
		document.getElementById( "proactiveFrame" ).style.left = w;
	
		document.getElementById( "proactiveWindow" ).style.top = document.getElementById( "proactiveFrame" ).style.top;
		//alert(document.getElementById( "proactiveWindow" ).style.top);
		
		document.getElementById( "proactiveWindow" ).style.left = document.getElementById( "proactiveFrame" ).style.left;
		//alert(document.getElementById( "proactiveWindow" ).style.left);
	}
	
	function CenterInOtherBrowser(h,w)
	{
		//alert('CenterInOtherBrowser called');
		document.getElementById( "proactiveFrame" ).clientTop = h;
		document.getElementById( "proactiveFrame" ).clientLeft = w;		
		
		document.getElementById( "proactiveWindow" ).clientTop = document.getElementById( "proactiveFrame" ).clientTop;
		//alert(document.getElementById( "proactiveWindow" ).clientTop);
		
		document.getElementById( "proactiveWindow" ).clientLeft = document.getElementById( "proactiveFrame" ).clientLeft;
		//alert(document.getElementById( "proactiveWindow" ).clientLeft);
		
		//alert('OBJ called');
		//alert(h);
		//alert(w);
	
		//var obj1,obj2;
		
		//obj1 = document.getElementById("proactiveFrame");
		//obj1.style.left = w;
		//obj1.style.top = h;
		
		//obj2 = document.getElementById("proactiveWindow");
		//obj2.style.left = w;
		//obj2.style.top = h;
		
		//document.getElementById( "proactiveFrame" ).top = "200px";
		//document.getElementById( "proactiveFrame" ).left = "350px";
	
		//document.getElementById( "proactiveWindow" ).top = document.getElementById( "proactiveFrame" ).top;
		//alert(document.getElementById( "proactiveWindow" ).top);
		
		//document.getElementById( "proactiveWindow" ).left = document.getElementById( "proactiveFrame" ).left;
		//alert(document.getElementById( "proactiveWindow" ).left);
		
	}
