
	var oPopin = null ;

	function popinInit()
	{
		oPopin = new popin() ;
		oPopin.lookForFakeLinks() ;
		oPopin.getClosebutton() ;
	}
	
	
	function popin()
	{
		var mouseX = 0 ;
		var mouseY = 0 ;
		//none
	}
	
	
	popin.prototype.lookForFakeLinks = function()
	{
		var links = document.getElementsByTagName( 'span' ) ;

		for ( var q=0; q < links.length ; q++ ) 
		{
			if ( links[q].className == 'fakelink' )
			{
				links[q].onclick = oPopin.openPopup ;			 	
			}
		}	
	}
	
	popin.prototype.getClosebutton = function()
	{
		document.getElementById( 'popinclose' ).onclick = oPopin.closePopup ;
	}
	
	
	popin.prototype.openPopup = function(e)
	{
	   if (!e) {
      		e=window.event ;
      		var caller=e.srcElement ;
   		} else {
      		var caller=e.target ;
   		}
   		oPopin.getMousePos(e);
   		oPopin.shade() ;
   		oPopin.showPopup() ;
   		var sId = caller.id.substring( 1 );
   		document.getElementById('popincontent').innerHTML = 
   			document.getElementById( 'popincontent' + sId ).innerHTML ;
	}
	
	
	popin.prototype.closePopup = function(e)
	{
	   if (!e) {
      		e=window.event ;
      		var caller=e.srcElement ;
   		} else {
      		var caller=e.target ;
   		}
   		oPopin.unShade() ;
   		oPopin.hidePopup() ;
	}	
	

	popin.prototype.shade = function()
	{
		document.getElementById( 'shader' ).style.display = 'block' ;
		//special style for iex6, it kinda loses the 100% screen height bug
		//when setting via javascript
		document.getElementById( 'shader' ).style.height = document.body.offsetHeight + 'px' ;
	}


	popin.prototype.unShade = function()
	{
		document.getElementById( 'shader' ).style.display = 'none' ;
	}


	popin.prototype.showPopup = function()
	{
		//show
		document.getElementById( 'popinwrapper' ).style.display = 'block' ;
		document.getElementById( 'popin' ).style.display = 'block' ;
		
		//Evaluate position popup		
		var Xoffset = Math.max( ( ( document.documentElement.clientWidth - 921 ) /2) + 156 , 100 ) ;
		var Yoffset = 200 ;

		if (self.pageYOffset) // all except Explorer 
			Yoffset = Math.max( self.pageYOffset, 200 ) + 100 ;
		else if (document.documentElement && document.documentElement.scrollTop) // Explorer 6 Strict
			Yoffset = Math.max( document.documentElement.scrollTop, 200 ) + 100 ;
		else if (document.body) // all other Explorers
			Yoffset = Math.max( document.body.scrollTop, 200 ) + 100 ;
			
		//place popup
		document.getElementById( 'popin' ).style.marginLeft = Math.ceil( Xoffset ) + 'px' ;
		document.getElementById( 'popin' ).style.top = Math.ceil( Yoffset ) + 'px' ;
	}
	
	
	popin.prototype.hidePopup = function()
	{
		document.getElementById( 'popinwrapper' ).style.display = 'none' ;
		document.getElementById( 'popin' ).style.display = 'none' ;
	}	
	
	
	popin.prototype.getMousePos = function(e) 
	{
		if (e.pageX || e.pageY){  
			// this doesn't work on IE6!!  
			mouseX = e.pageX; 
			mouseY = e.pageY; 
		} 
		else if (e.clientX || e.clientY){ 
			// works on FF,Moz,Opera7 
			mouseX = e.clientX ; 
			mouseY = e.clientY ; 
		}  
	}
	
